Hi Steve I did have to put something together for alarm on a dynamic group, example query below for hosts in a group. For a container(location3) you can play with using "OR"''s for group names, or look for the join field for dynamicGroup to Container to add to query. Someone will probably have a better query then mine :)
select alarms.hostname,alarms.message,alarms.severity from cm_group_member gmem
join cm_computer_system system on gmem.cs_id = system.cs_id
join nas_alarms alarms on alarms.hostname like '%'+ system.name +'%'
join cm_group cmgroup on gmem.grp_id = cmgroup.grp_id
where cmgroup.name = 'Windows'
Original Message:
Sent: 10-15-2021 01:59 AM
From: Steve B
Subject: Possible to extract alarms via API or SQL based on the OC group?
Hi guys,
I've been trying to find a way to extract a list of alarms based on whether the alarming host is located under a particular OC group. There doesn't seem to be any way to do it via the API that I can find - but curious if anyone has any experience with the groups in the database?
Our OC group structure is similar to this:
Sites
|- Location 1
|- System 1
|- Host 1
|- Host 2
|- Host 3
|- System 2
|- Host 1
|- Host 2
|- Host 3
|- System 3
|- Location 2
|- System 1
|- Host 1
|- Host 2
|- Host 3
|- System 2
|- Host 1
|- Host 2
|- Host 3
|- Location 3 <--
|- System 1
|- Host 1
|- Host 2
|- Host 3
|- System 2
|- Host 1
|- Host 2
|- Host 3
So for example - how do i extract the alarms for hosts that are only sitting under Location 3?
Any advice or info would be greatly appreciated.
Cheers