This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

NPM Alert based on percentage of group members status?

I have a group of nodes, which I would like to be alerted on IF a certain percentage (let's go with 50% for the example) of a group's members are down.

So:

- Single member of group down = no problem

- 50% or more of groups members down = alert

As far as I can see the alert wizard does not support this natively, I can only do alerting if the entire group is down. And the group status rollup itself (from the group properties) can only be set as "show best/worst/mixed", but not more granular.

Anyone who can show a way out of this? A custom DB query? but how to integrate this with alerting?

Thanks in advance!

Lasse

Parents
  • Easy to do if you understand sql/swql

    Create an alert and change the first box on the trigger page to Custom SWQL Alert

    Second box should be Group

    Lower box that you can type into should say

    join (select count(Name) as [Total], containerid FROM Orion.ContainerMembers group by containerid) t on t.containerid=Groups.containerid

    join (select count(Name) as [Down], containerid FROM Orion.ContainerMembers where status=2 group by containerid) d on d.containerid=Groups.containerid

    where (d.Down/t.Total)*100>50 -- change 50 to whatever percent of the nodes you want to trigger on

    pastedImage_0.png

    -Marc Netterfield

        Loop1 Systems: SolarWinds Training and Professional Services

  • Hi Mesverrum,

    That looks like exactly what I was looking for - Could you also help me figure out where in the SQL statement I specify the actual group I want to apply this for?

    Thanks,

    Lasse

  • That one is written for any group, but if you want to specify a single group then just add to the WHERE section a line saying

    and groups.name='your group here'

  • Hi Mesverum,

    Thank you for your kind assistance - I am really trying to learn here.

    You mean like this(?)

    join (select count(Name) as [Total], containerid FROM Orion.ContainerMembers group by containerid) t on t.containerid=Groups.containerid

    join (select count(Name) as [Down], containerid FROM Orion.ContainerMembers where status=2 group by containerid) d on d.containerid=Groups.containerid where (d.Down/t.Total)*100>50 and groups.name='DUMMYGROUP'

    When I use the statement above, the statement validates, but it does not trigger even though the group DUMMYGROUP has more than 50% downed members. If I omit the "and groups.name='DUMMYGROUP'" from the statement, it triggers, but on a completely different group (and only that group), even though more groups exist with the condition more than 50% members down exist.

    Regards Lasse

  • Lasse, Looking at the query in my lab i see that i did the math wrong.

    try changing the where line from

    where (d.Down/t.Total)*100>50

    to

    where (d.Down*100/t.Total)>50

    Since I didn't specify the numbers to be floats SQL was rounding things to the nearest whole number and then multiplying that, which gave unexpected results. 

Reply
  • Lasse, Looking at the query in my lab i see that i did the math wrong.

    try changing the where line from

    where (d.Down/t.Total)*100>50

    to

    where (d.Down*100/t.Total)>50

    Since I didn't specify the numbers to be floats SQL was rounding things to the nearest whole number and then multiplying that, which gave unexpected results. 

Children
No Data