Page 1 of 1

Create Nagios XI URL

Posted: Mon Feb 13, 2017 6:17 pm
by nietonoshana
Hello I need create a URL in Nagios XI

with Host Down &hoststatustypes=4
and
Host state unacknowledged &hostprops=8

But I see UNACKNOWLEDGED and ACKNOWLEDGED

Can you helpme whit this.

I have Nagios XI 5.4.2 in Centos 7

The URL is:
http:/servernagios/nagiosxi/includes/components/xicore/status.php?&show=hosts&hoststatustypes=4&hostprops=8

Re: Create Nagios XI URL

Posted: Tue Feb 14, 2017 1:01 pm
by mcapra
Try this:

Code: Select all

http://nagios_host/nagiosxi/includes/components/xicore/status.php?&show=hosts&hoststatustypes=12&hostattr=8
These are the GET vars you can leverage:

Code: Select all

    $dargs = array(
        DASHLET_ARGS => array(
            "host" => $host,
            "hostgroup" => $hostgroup,
            "servicegroup" => $servicegroup,
            "hostattr" => $hostattr,
            "serviceattr" => $serviceattr,
            "hoststatustypes" => $hoststatustypes,
            "servicestatustypes" => $servicestatustypes,
            "show" => $show
        )
    );
And the constants used are located in /usr/local/nagiosxi/html/includes/constants.inc.php. Relevant ones i'm leveraging here:

Code: Select all

define("HOSTSTATUSATTR_NOTACKNOWLEDGED", 8);
..
define("HOSTSTATE_DOWN", 4);
define("HOSTSTATE_UNREACHABLE", 8);
Basically, like Unix permissions, you add up the numbers from each constant to get the desired filtering. For my hoststatustypes I want to see "DOWN" and "UNREACHABLE", so I add 8+4=12. Since I also only want to see un-acknowledged problems, I add the hostattr=8 to my request.

Re: Create Nagios XI URL

Posted: Wed Feb 15, 2017 1:35 pm
by nietonoshana
Thanks it's what I was looking for

Re: Create Nagios XI URL

Posted: Wed Feb 15, 2017 1:47 pm
by rkennedy
Great - would you mind if we closed this thread up and marked it resolved?

Re: Create Nagios XI URL

Posted: Wed Feb 15, 2017 1:50 pm
by nietonoshana
Yes, thanks