0

How do I enumerate all monitoring objects on a machine?
Today I'm trying to query ManagementPacks that I know should be there. It is inconvenient especially in cases when packs added.
This is what I'm doing today:
Get the pack and a class

var pack = mg.ManagementPacks.GetManagementPack("Microsoft.Windows.Library", "31bf3856ad364e35", new Version(1, 0, 0, 0));
var managementClass = mg.EntityTypes.GetClass("Microsoft.Windows.Computer", pack);

Create a query to get all objects

EnterpriseManagementObjectCriteria machineCriteria = new EnterpriseManagementObjectCriteria("DisplayName like '%" + machineName + "%'", managementClass);

Get monitor objects

mg.EntityObjects.GetObjectReader<MonitoringObject>(machineCriteria, ObjectQueryOptions.Default)

Not most convenient way - I have to know the pack name and the class name.

kreuzerkrieg
  • 3,009
  • 3
  • 28
  • 59

1 Answers1

0

It would be much easier for you to write a stored procedure on database. Or create custom database for you purposes & set up daily update from SCOM DWH base to it. Object parent-child relations easily accessible in DB, but in the microsoft scom library... I can't say a lot of good things about it.

Vital
  • 91
  • 1
  • 6
  • Do you mean read directly from SCOM tables? Is there a documentation anywhere about how to do that? – Karlth Feb 06 '16 at 11:07
  • 1
    apart of Kevin Holman's blog... I don't think so. But you definitely should consider checking out Squared UP [link](https://squaredup.com/) – Vital Oct 17 '16 at 16:17