List of NON-Active hosts with API v1 and php function

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
Francesco
Posts: 124
Joined: Wed Oct 28, 2015 5:02 am
Location: /usr
Contact:

List of NON-Active hosts with API v1 and php function

Post by Francesco »

Hi,
Nagios XI 5.5.9
  • How get a list of non-active hosts trough APIv1? is_active=0 does not works

Code: Select all

https://<ip nagios>/nagiosxi/api/v1/objects/host?apikey=<apy_key>&pretty=1&is_active=0
{
    "recordcount": "0"
}
Same question but in php, I see that with get_xml_host_objects() I can get the list of host, but ' "is_active" => 0 ' does not works.
  • How to get a list of non-active hosts with get_xml_host_objects(), or other php function?
Other similar question, how to get the list of non-active services with API v1 and php function?

Thanks,
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: List of NON-Active hosts with API v1 and php function

Post by ssax »

The API doesn't currently support checking for is_active at this time. I have already previously submitted a request to development for them to add that functionality but it hasn't been implemented yet.

get_xml_host_objects will not list those either as the query that it uses requires an entry in nagios_hosts for it to work and that doesn't exist, development would need to implement the functionality for this to work. I can submit a request to development to see if they will add that to that function if you'd like? Please keep in mind that the decision to implement the enhancement is at the discretion of our development team.
User avatar
Francesco
Posts: 124
Joined: Wed Oct 28, 2015 5:02 am
Location: /usr
Contact:

Re: List of NON-Active hosts with API v1 and php function

Post by Francesco »

Yes, please submit a request to development to see if they will add that to that function.

List non-active hosts and services trough API/get_xml_host_objects()/get_xml_service_objects()

The PHP function get_xml_objects() can be used to get the list of disabled hosts/services?

If yes with what args?

Code: Select all

 $args = array(???);
 $objsXML = get_xml_objects($args);
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: List of NON-Active hosts with API v1 and php function

Post by ssax »

I submitted it with a link back to this thread so development will see it:

FR: XI - API - Add the ability to show inactive objects
The PHP function get_xml_objects() can be used to get the list of disabled hosts/services?
No, it's the same with get_xml_objects.
Locked