Page 1 of 1

not show soft states

Posted: Sat Oct 31, 2015 7:26 am
by WillemDH
Is there some way to not show soft states in open service / host problems? We have a lot of instable hosts which keep popping up, I'm really trying to find a solution for them to not pollute our problem views. Any other suggestions?

Re: not show soft states

Posted: Sat Oct 31, 2015 10:43 am
by BanditBBS
I can't think of anything, but that'd be a heck of a feature request to add to those screens and the birdseye, operations screen, operations center and all others like that!

Re: not show soft states

Posted: Sun Nov 01, 2015 11:25 pm
by Box293
I can tell you how to do it but it's a tad confusing.

Basically the URLs contain the key to it all. For example:

Code: Select all

http://xiproduction/nagiosxi/includes/components/xicore/status.php?show=services&servicestatustypes=28
This &servicestatustypes=28 makes the page display with the filters Service=Warning,Unknown,Critical.

If you look in this file /usr/local/nagiosxi/html/includes/constants.inc.php you'll find this:

Code: Select all

// PSEUDO-STATES (USED IN LINKS, ETC)
define("SERVICESTATE_PENDING", 1);
define("SERVICESTATE_OK", 2);
define("SERVICESTATE_WARNING", 4);
define("SERVICESTATE_UNKNOWN", 8);
define("SERVICESTATE_CRITICAL", 16);
define("SERVICESTATE_ANY", 31);
4 (Warning) + 8 (Unknown) + 16 (Critical) = 28

So it should be a matter of defining an extra filter to only display hard states. You'll see this in the file:

Code: Select all

define("SERVICESTATUSATTR_HARDSTATE", 262144);
So you should be able to add &serviceattr=262144 to any URL and it will only show you HARD states. However you still need the other filter, so it would be something like:

Code: Select all

http://xitest/nagiosxi/includes/components/xicore/status.php?show=services&servicestatustypes=28&serviceattr=262144
Which should show a filter like Service=Warning,Unknown,Critical,Hard State,Hard State

/usr/local/nagiosxi/html/includes/constants.inc.php is a handy file to go digging in :)

Re: not show soft states

Posted: Mon Nov 02, 2015 5:49 am
by WillemDH
Troy,

Thanks for the nice as-always in-depth explanation. Imho this should be integrated ina future releaase of XI? If possible make it a changeable and saveable setting per user. I think there should be a global admin setting (like the sticky ack) which would set the default setting for all users, but it should be overridable with a small button like the 'hide/show handled' button on the Birdseye component?

Grtz

Re: not show soft states

Posted: Mon Nov 02, 2015 5:24 pm
by Box293
Yes I think it would be a great feature as well. I've created TASK ID 6859 for this.

At least you have some way of making it work in the mean time by adding &serviceattr=262144 to any URLs.

Re: not show soft states

Posted: Tue Dec 01, 2015 7:38 am
by WillemDH
Thanks Troy,

This can be closed.