Hi guys,
we're having a strange issue while calling /nagiosxi/api/v1/objects/hostgroup
When we're calling via curl, it returns the objects without an issue, but when calling it within a python script (w/ requests), it returns recordcount = 0 (when we have over 25).
Furthermore, when we remove objects.cache and objects.precache (which are both around 9 mb) , it works more than usual, but still returns recordcount = 0 sometimes.
We tried increasing php values (like memory_limit) to no avail.
Do you have any idea why this is happening? It is extremely strange that nagios returns recordcount = 0 for a call from a script, and recordcount = 25 when calling via curl.
Another issue we have is that /nagiosxi/api/v1/objects/service returns inconsistent results almost every run. (hosts missing, checks missing, etc)
API call returns recordcount = 0
Re: API call returns recordcount = 0
Can you show us the curl command VS what your Python is running? It might be useful in determining exactly where the problem is.
Do you have any automation scripts working in the background currently? Or anything that would alter the state of the nagios database?ibnetworking wrote: Another issue we have is that /nagiosxi/api/v1/objects/service returns inconsistent results almost every run. (hosts missing, checks missing, etc)
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
ibnetworking
- Posts: 19
- Joined: Mon Jan 16, 2017 4:32 am
Re: API call returns recordcount = 0
Hi,
this was a result of running reconfigure_nagios.sh and asking for list of services via API too fast, where nagios didn't managed to load all 10k checks from the database.
This was resolved by time.sleep(15).
It would very helpful to get the reply to the API call once the backend is done reconfiguring, not when the call was sent. Have you planned on adding this feature?
this was a result of running reconfigure_nagios.sh and asking for list of services via API too fast, where nagios didn't managed to load all 10k checks from the database.
This was resolved by time.sleep(15).
It would very helpful to get the reply to the API call once the backend is done reconfiguring, not when the call was sent. Have you planned on adding this feature?
Re: API call returns recordcount = 0
An issue has already been raised internally from a separate customer with the same issue, so you're not the only one to have been inconvenienced by this.
That's one solution, but changes with Core 5 may make this unnecessary. It's on our radar for sure, though.ibnetworking wrote: It would very helpful to get the reply to the API call once the backend is done reconfiguring, not when the call was sent. Have you planned on adding this feature?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: API call returns recordcount = 0
Did @mcapra's post help you? Please let us know if you have any additional questions.