question

Michael-4753 avatar image
0 Votes"
Michael-4753 asked RogerXue-3369 commented

Disable all alerts/rules generated by management pack

How do I disable all alerts generated by monitors/rules from a specific mgmt pack?

134251-udklip.png


msc-operations-manager-general
udklip.png (88.1 KiB)
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.

AlexZhu-MSFT avatar image
0 Votes"
AlexZhu-MSFT answered Michael-4753 commented

Hi,

I've downloaded the mp bundle from systemwiki, imported it in the lab. No rule and 7 monitors are found in this management pack.

To disable them, we can find each monitor (in Authoring pane), create an overrides and save it in an unsealed management pack.

screenshots for your reference

Get-SCOMManagementPack -DisplayName "pki certificate validation v2" | Get-SCOMRule
134543-scom-disable-monitor-00.png

disable the monitor
134494-scom-disable-monitor-01.png


Alex
If the response is helpful, please click "Accept Answer" and upvote it.



· 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.

Hello Alex

Thank you for response.

Are we certain that all certificate related monitors/rules are handled with your solution?

0 Votes 0 ·
RogerXue-3369 avatar image
1 Vote"
RogerXue-3369 answered RogerXue-3369 commented

Use the following powershell

1) The Name management pack which i want to disable all its of alerts/rules is "Microsoft System Center Management Pack for Windows 10 (Monitoring)"
2) The override is save in the MP ,'samplemp'.

You should modify the above parameter in your PowerShell cmdlet



$MP=get-scommanagementpack -displayname 'samplemp'
$monitors=get-scommanagementpack -displayname 'Microsoft System Center Management Pack for Windows 10 (Monitoring)'|get-scommonitor
foreach ($monitor in $monitors) {
Disable-SCOMMonitor -ManagementPack $MP -Monitor $Monitor -Enforce
}

$rules=get-scommanagementpack -displayname 'Microsoft System Center Management Pack for Windows 10 (Monitoring)'|get-scomrule
foreach ($rule in $rules) {
Disable-SCOMRule -ManagementPack $MP -Rule $Rule -Enforce
}



Roger


· 2
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 for response.

Are we certain that all certificate related monitors/rules are handled with your solution? Dont know if any Microsoft mgmt packs handles certificate issues.

0 Votes 0 ·


$monitors=get-scommanagementpack -displayname 'Microsoft System Center Management Pack for Windows 10 (Monitoring)'|get-scommonitor
will extract all monitors for a particular MP.
If you want to disable all monitors for MP "PKI Certificate Validation V2", just replace 'Microsoft System Center Management Pack for Windows 10 (Monitoring)' with 'PKI Certificate Validation V2,'

roger

0 Votes 0 ·
AlexZhu-MSFT avatar image
0 Votes"
AlexZhu-MSFT answered AlexZhu-MSFT edited

Hi,

Yes, the cmdlet will output all the rules/monitors in the specified (sealed) management pack. If the number is small (in above example, only 7 monitors), we can disable it (via overrides) manually. If the number is larger, we can use Roger's excellent script to automate the process.

 $MP = get-scommanagementpack -displayname 'pa'
 $monitors = Get-SCOMManagementPack -DisplayName "pki certificate validation v2" | Get-SCOMMonitor
 foreach ($monitor in $monitors) 
 {
  Disable-SCOMMonitor -ManagementPack $MP -Monitor $Monitor -Enforce
 }

quick lab test screenshot:

134926-scom-disable-monitor-02.png


Alex
If the response is helpful, please click "Accept Answer" and upvote it.




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.