Page 1 of 1
List of NON-Active hosts with API v1 and php function
Posted: Thu Apr 01, 2021 3:50 am
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,
Re: List of NON-Active hosts with API v1 and php function
Posted: Thu Apr 01, 2021 1:49 pm
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.
Re: List of NON-Active hosts with API v1 and php function
Posted: Wed Apr 07, 2021 5:28 am
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);
Re: List of NON-Active hosts with API v1 and php function
Posted: Wed Apr 07, 2021 5:46 pm
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.