SCOM | Monitored Objects | What services are being monitored on monitored object.

raymond 0 Reputation points
2024-01-09T19:17:07.24+00:00

Hi,

I would like to generate a report to keep track of what services are being monitored and on which monitored object. I would like to create a similar report documenting which management packs are assigned to which monitored object.

The goal is to reduce our SCOM footprint and ensure that our devices are monitored by our global monitoring tool and identify any gaps in our monitoring.

To achieve this goal, I would like to do a side by side review between our monitoring tools.

Thank you in advance,

Raymond

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,417 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,076 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,553 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rich Matheisen 45,011 Reputation points
    2024-01-11T22:28:00.87+00:00

    @XinGuo-MSFT Most of that script is unnecessary. The Export-SCOMEffectiveMonitoringConfiguration cmdlet exports a CSV file. To import that file you can use the Import-CSV cmdlet with the "Delimiter '|' parameter.

    $computer = "name-of-computer-goes-here"
    $file = "{0}.csv" -f $computer
    $dir = "drive-and-path-name-goes-here"      # Do NOT include trailing "\"
    
    $path = join-path -Path $dir -ChildPath $file
    $class = Get-SCOMClass -Name "System.Computer"
    Get-SCOMClassInstance -Class $class | 
        Where-Object { $_.DisplayName -eq $computer } |
            ForEach-Object { 
                Export-SCOMEffectiveMonitoringConfiguration -Instance $_ -Path $path -RecurseContainedObjects 
            }
    

    To import the CSV:

    Import-CSV $path -Delimeter "|"
    
    1 person found this answer helpful.
    0 comments No comments

  2. XinGuo-MSFT 14,461 Reputation points
    2024-01-10T07:22:26.0766667+00:00

    Hi,

    You may run below script to get a CSV file and then filter out rules and monitors:

    
     $class = Get-SCOMClass -Name "System.Computer"
     $members= Get-SCOMClassInstance -Class $class | Where-Object {$_.DisplayName -eq $computer}
     $members | ForEach-Object { Export-SCOMEffectiveMonitoringConfiguration –Instance $_ -Path ($path + "$computer.csv") –RecurseContainedObjects }
    
    
     $lines = Get-Content ($path + "$computer.csv")
    remove-item ($path + "$computer.csv")
     ForEach ($line in $lines) {
    ForEach ($field in $line)
    {
    $Values = $field.Split('|')
    $object = New-Object –TypeName PSObject
    $object | Add-Member –MemberType NoteProperty –Name Class –Value $Values[0].Replace('"','')
    $object | Add-Member –MemberType NoteProperty –Name InstanceName –Value $Values[1]
    $object | Add-Member –MemberType NoteProperty –Name RuleMonitor –Value $Values[2]
    $object | Add-Member –MemberType NoteProperty –Name Enabled –Value $Values[3]
    $object | Add-Member –MemberType NoteProperty –Name GeneratesAlert –Value $Values[4]
    $object | Add-Member –MemberType NoteProperty –Name AlertSeverity –Value $Values[5]
    $object | Add-Member –MemberType NoteProperty –Name AlertPriority –Value $Values[6]
    $object | Add-Member –MemberType NoteProperty –Name AlertType –Value $Values[7]
    $object | Add-Member –MemberType NoteProperty –Name AlertDescription –Value $Values[8]
    $object | Add-Member –MemberType NoteProperty –Name Overriden –Value $Values[9]
    $object | Add-Member –MemberType NoteProperty –Name Parameter1 –Value $Values[10]
    $object | Add-Member –MemberType NoteProperty –Name DefaultValue1 –Value $Values[11]
    $object | Add-Member –MemberType NoteProperty –Name EffectiveValue1 –Value $Values[12]
    $object | Add-Member –MemberType NoteProperty –Name Parameter2 –Value $Values[13]
    $object | Add-Member –MemberType NoteProperty –Name DefaultValue2 –Value $Values[14]
    $object | Add-Member –MemberType NoteProperty –Name EffectiveValue2 –Value $Values[15]
    $object | Add-Member –MemberType NoteProperty –Name Parameter3 –Value $Values[16]
    $object | Add-Member –MemberType NoteProperty –Name DefaultValue3 –Value $Values[17]
    $object | Add-Member –MemberType NoteProperty –Name EffectiveValue3 –Value $Values[18]
             $object | Add-Member –MemberType NoteProperty –Name Parameter4 –Value $Values[19]
             $object | Add-Member –MemberType NoteProperty –Name DefaultValue4  –Value $Values[20]
             $object | Add-Member –MemberType NoteProperty –Name EffectiveValue4 –Value $Values[21]
             $object | Add-Member –MemberType NoteProperty –Name Name –Value $Values[22]
    $array += $object
    }
     }
    
     $array | export-csv c:\test\x.csv
    

  3. Marius Ene 335 Reputation points
    2024-01-11T23:07:19.7633333+00:00

    The goal is to reduce our SCOM footprint and ensure that our devices are monitored by our global monitoring tool and identify any gaps in our monitoring.

    Another approach you could do is to export all you SCOM management packs that you are using in your environment and review them using a tool called MPViewer. This allows to export the MP in excel format and review all monitor, rules, classes. Then you can sit down and decide which monitors/rules are necessary and identify the ones that you want to disable. https://kevinholman.com/2018/12/30/scom-tools/ https://github.com/JeanCloud365/mpviewer/releases/tag/R1

    0 comments No comments