Hi!
It really depends on how the discovery of apps has been defined. Typically
classes that represents applications has a relationship to a computer
object(Windows Server/*nix Server) not the the agent.
In a group definition you could have something like this
<MembershipRules>
<MembershipRule>
<MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass>
<RelationshipClass>$MPElement[Name="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer"]$</RelationshipClass>
<Expression>
<Contains>
<MonitoringClass>$MPElement[Name="My.Application.Class"]$</MonitoringClass>
</Contains>
</Expression>
</MembershipRule>
</MembershipRules>
Meaning "Give me all windows computer that has an instance of 'My Application'
discovered."
I'm not a Powershell champ, but you could do something like:
$AppClass = get-monitoringclass -name "Your.app.Class"
$MyApps = get-monitoringobject -monitoringclass $AppClass
Foreach($app in $MyApps)
{
($app.GetParentMonitoringObjects()|where-object {$_.FullName -like
"Microsoft.Windows.Computer*"}).DisplayName
}
Someone can properly come up with a one-liner:)
/Henrik
From: [email protected] [mailto:[email protected]] On
Behalf Of Jorgensen, Erik
Sent: Tuesday, November 05, 2013 10:07 PM
To: [email protected]
Subject: [msmom] RE: Getting from Monitoring Group to Agents
MOM Experts,
Sorry for replying to my own note, but I realized I was asking how to do one
step in what we are trying to do instead of explaining the base question in
case I am going about it the wrong way.
My group manages some applications monitored by SCOM, and as part of our
documentation, we would like to have a list in SharePoint that lists all the
actual servers that our apps rely on. Looking in SCOM, this information seems
to live at the Agent level as that appears to be the base level object that
that ties together the system name, IP Addresses and such. My plan was to start
with a group, find all the agents that that are monitored as part of that
group, query the agent object and push that data to an SP list.
By starting with monitoring groups, I figured that we would only have to keep
our monitoring groups up to date, and the list of servers that provide the
services monitored by those groups could automatically be pulled out of SCOM.
Thanks,
Jorgie
--
Erik Jorgensen
Support Systems Administrator - Principal
Tier 2 Applications Support
Division of IT
University of Missouri - Columbia
[email protected]<https://um-ncas2.um.umsystem.edu/owa/UrlBlockedError.aspx>
573.882.5974
Sent from Outlook 2013 on a Surface Pro with Windows 8.1 Enterprise!
From: [email protected]<mailto:[email protected]>
[mailto:[email protected]] On Behalf Of Jorgensen, Erik
Sent: Tuesday, November 5, 2013 2:51 PM
To: [email protected]<mailto:[email protected]>
Subject: [msmom] Getting from Monitoring Group to Agents
MOM Experts,
In PowerShell, I have a list of SCOM Monitoring Groups, and I from that I would
like to get a list of Monitoring Agents.
Does anyone know the path to following to filter the list of all agents to just
those with monitors in a specific set of monitoring groups?
Here is how I get the list of groups I am interested in:
$ AllGroups = Get-MonitoringObjectGroup;
$ VASSGroups = $Global:AllGroups | Where-Object { $_.DisplayName -like
'Vended*' };
As you can see, the groups I am interested in all begin with 'Vended'. This
works perfectly, I just don't know where to go from here as the list of methods
supported by the MonitoringGroup object does not easily lead me to agents.
Thanks!
Jorgie
--
Erik Jorgensen
Support Systems Administrator - Principal
Tier 2 Applications Support
Division of IT
University of Missouri - Columbia
[email protected]<https://um-ncas2.um.umsystem.edu/owa/UrlBlockedError.aspx>
573.882.5974
Sent from Outlook 2013 on a Surface Pro with Windows 8.1 Enterprise!