Nagios REST API issue
Posted: Mon Dec 10, 2018 5:10 am
Hello,
I am trying to utilize the REST API to get usage stats.
I have run into a problem specifically for the statushistory call, whenever I try the example from the objects reference page with only a starttime parameter I get an empty json as response (No errors or any wearnings). The result is supposed to be the data until now.
Now, if I add an endtime parameter with a date prior to 4-12-2018 18:21:00 (EET - I add it as the equivalent of that datetime in seconds) I get a response with the data as expected. I pretty sure the first time I tried the /nagiosxi/help/api-object-reference.php#building-queries examples I could sometimes get the result with just the starttime parameter. Wierdest thing is, I think the date I mentioned might be the first time I used the examples.
The hostavailability call works fine - I am guessing other REST components work fine as well.
Any ideas why this could be happening or actions I can do to overcome this issue will be appreciated. I am actually accessing the API with Python, but have tested with my browser, and my code, and curl and the result is the same.
My clients expect a weekly report so I am in need to get a workaround as sooner as possible.
George Panou
Algosystems SA
I am trying to utilize the REST API to get usage stats.
I have run into a problem specifically for the statushistory call, whenever I try the example from the objects reference page with only a starttime parameter I get an empty json as response (No errors or any wearnings). The result is supposed to be the data until now.
Now, if I add an endtime parameter with a date prior to 4-12-2018 18:21:00 (EET - I add it as the equivalent of that datetime in seconds) I get a response with the data as expected. I pretty sure the first time I tried the /nagiosxi/help/api-object-reference.php#building-queries examples I could sometimes get the result with just the starttime parameter. Wierdest thing is, I think the date I mentioned might be the first time I used the examples.
The hostavailability call works fine - I am guessing other REST components work fine as well.
Any ideas why this could be happening or actions I can do to overcome this issue will be appreciated. I am actually accessing the API with Python, but have tested with my browser, and my code, and curl and the result is the same.
My clients expect a weekly report so I am in need to get a workaround as sooner as possible.
George Panou
Algosystems SA