Hi,
We have an internal application that fetches Service Status by using the list of Host Names and shows the results using Nagios XI Rest endpoints.
If all hosts are having at least service, then Services Data is coming, But if any of the Hosts are not having at least one service, then Services Data is NOT coming instead we are getting empty Service Status.
URL: http://nagios.com/nagiosxi/api/v1/objec ... OST2,HOST3
HOST1: No Services
HOST2: Disk Check
HOST3: Memory Check
Actual: Empty Service Status List
Expected: Two Service Status List
Could anyone please help me.
Nagios XI Service Status Rest API - No Data Returning
-
rgangavarapu
- Posts: 9
- Joined: Wed Apr 25, 2018 8:06 pm
Re: Nagios XI Service Status Rest API - No Data Returning
Can you please specify what you are referring to for the syntax near the end of that link? Is that how your internal application would handle iterating through hosts?
Also, just so we understand the issue correctly if the script works as long as all hosts have an associated service, but if one host does not, no data is being retrieved by the API call? Is this correct?
It may also be helpful for you to send us your internal script in a private message.
Also, just so we understand the issue correctly if the script works as long as all hosts have an associated service, but if one host does not, no data is being retrieved by the API call? Is this correct?
It may also be helpful for you to send us your internal script in a private message.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
rgangavarapu
- Posts: 9
- Joined: Wed Apr 25, 2018 8:06 pm
Re: Nagios XI Service Status Rest API - No Data Returning
We are not passing anything at the end of the link. I have given the URL (added space after the http to ensure it won't convert to URL in the post)
URL: http:// nagios.com/nagiosxi/api/v1/objects/servicestatus?apikey=XXXXXXAPI_KEYXXXXXX&host_name=in:HOST1,HOST2,HOST3
Yes, No Data is being retried by API if any one of the hosts doesn't have any data. But if the NO service Host is at the end of the list (last Host), then data is being retried.
In our case, First Host is having NO service and NO data is being retried.
We are using "check_http" (binary script) of the Nagios Plugins to validate the Application Status. But in the case of Database servers or Utility, we don't have any applications running, so there is no service configured.
We do get the list of hosts using another Rest Endpoint by using Host Group and pass the list (comma separated) to Service Status Rest Endpoint to the services and their statuses.
URL: http:// nagios.com/nagiosxi/api/v1/objects/servicestatus?apikey=XXXXXXAPI_KEYXXXXXX&host_name=in:HOST1,HOST2,HOST3
Yes, No Data is being retried by API if any one of the hosts doesn't have any data. But if the NO service Host is at the end of the list (last Host), then data is being retried.
In our case, First Host is having NO service and NO data is being retried.
We are using "check_http" (binary script) of the Nagios Plugins to validate the Application Status. But in the case of Database servers or Utility, we don't have any applications running, so there is no service configured.
We do get the list of hosts using another Rest Endpoint by using Host Group and pass the list (comma separated) to Service Status Rest Endpoint to the services and their statuses.
Re: Nagios XI Service Status Rest API - No Data Returning
The API seems to be working for multiple hosts on our test instance, even when one of those does not have a service associated with it. It could be a bug in a particular version. What version of Nagios XI are you running?
There is another forum topic that looks slightly similar, and they found that the problem was related to a limitation in PHP do to the size of the API call. I would recommend following the guide to optimize the PHP settings in XI.
Nagios XI - Optimizing The PHP Settings File
There is another forum topic that looks slightly similar, and they found that the problem was related to a limitation in PHP do to the size of the API call. I would recommend following the guide to optimize the PHP settings in XI.
Nagios XI - Optimizing The PHP Settings File
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
rgangavarapu
- Posts: 9
- Joined: Wed Apr 25, 2018 8:06 pm
Re: Nagios XI Service Status Rest API - No Data Returning
We have made php.ini changes as suggested at https://support.nagios.com/kb/article/n ... e-611.html and we are validating the API Results.
Nagios XI Version: 5.4.10
Current /etc/php.ini file changes are listed below
max_input_vars => 5000
memory_limit => 1024M
max_execution_time => 90
max_input_time => 90
Nagios XI Version: 5.4.10
Current /etc/php.ini file changes are listed below
max_input_vars => 5000
memory_limit => 1024M
max_execution_time => 90
max_input_time => 90
Re: Nagios XI Service Status Rest API - No Data Returning
You are using an old version of Nagios XI. I haven't been able to recreate the issue in the latest version of XI (5.6.13), so I am pretty confident that the issue has been resolved.
I would recommend that you upgrade your Nagios XI instance to the latest in order to fix the issue.
I would recommend that you upgrade your Nagios XI instance to the latest in order to fix the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!