question

VibinRajNadakkal avatar image
0 Votes"
VibinRajNadakkal asked VibinRajNadakkal commented

SCOM single rule/monitor disable script

Hi Team,

Please let me know if any script for single rule/monitor disable for a server.

I have found script to disable or enable rule/monitor bulkily but I need a script to execute single server rule/monitor needs to disable.


Thanks in advance


Regards,
Vibin Raj N

msc-operations-manager
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

StoyanChalakov avatar image
1 Vote"
StoyanChalakov answered VibinRajNadakkal commented

Hi @VibinRajNadakkal,

if you want to apply obverrides to a broader number of systems, the best way is to create group for them:

Manage and Create Groups

and then apply the override to a group:

Using classes and groups for overrides

The second link is very, very important as it describers the concept of targeting and overriding in SCOM, which is the most bnnasic thing you need to learn if you work with SCOM.

Here are a couple of other, very important articles on the topic:

Best practices for configuring overrides in Operations Manager

How to create a management pack for overrides

How to Correctly Create an Override for a SCOM Workflow
https://monitoringguys.com/2016/05/24/how-to-correctly-create-an-override-for-a-scom-workflow/



(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Stoyan Chalakov


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you Stoyan.

I have tried with a group concept and disable the rule/monitor for couple of servers. I have created a group with dynamic inclusion rule and it's working fine. We have to give object as windows computer in dynamic rule and most of the rule/monitor able to change the override value.

0 Votes 0 ·
StoyanChalakov avatar image
0 Votes"
StoyanChalakov answered VibinRajNadakkal commented

Hi @VibinRajNadakkal,

If you insist doing this with a scrupot instead of the GUI, you can use the "Start-SCOMOverride" cmdlet (tool) from the SCOM PowerShell module:

SCOMHelper PowerShell Module – A SCOM Admin’s Best Friend
https://monitoringguys.com/2019/11/12/scomhelper/

or

just use this script (haven't tested it personally, but look pretty ok):

POWERSHELL OVERRIDES – NOT ONLY ENABLE/DISABLE
https://armiev.com/124/


You can put only one server in the CSV. Please note that your CSV needs to be in the proper format, as depicted in the article:

 > #Load csv file, the file format is Monitor Name,Class Name,Parameter to be changed 
 > #in a monitor you can change the next parameters:
 > # * Enabled
 > # * GenerateAlert
 > # * AutoResolve
 > # * AlertPriority
 > # * AlertOnState
 > # * AlertSeverity

The class name would of course be the targeted class of the monitor. For example "Windows Computer", "Agent", Windows Server", etc...



(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Stoyan Chalakov






· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Stoyan,

I have tried with GUI option and it will take time complete the activity. My scenario I have 200+ parameter needs to disable for some of the servers but parameter applied to other servers also. So individually each server I need to take override option and do the changes. If getting single line command to override the server parameter change it will be good.


Regards,
Vibin Raj N

0 Votes 0 ·
Crystal-MSFT avatar image
0 Votes"
Crystal-MSFT answered

@VibinRajNadakkal, For our request, I have done some research and find some links about bulk disabling monitors or rules for the reference:
https://effectiveit.wordpress.com/2014/07/26/scom-2012-how-to-bulk-disable-monitorsrulesdiscoveries/
https://monitoringguys.com/2019/11/12/scomhelper/
Note: non-Microsoft link, just for the reference.

Hope it can help.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.