Hello,
We need to access the back end. I have been looking at services provided by the Backend API URL plugin, but we need more finely-grained queries than appear to be provided.
For example, we need to be able to query the current host status, returning only those with a certain command:
http://nagiosxi/nagiosxi/backend/?cmd=g ... _host_ping[/b]
Does this plugin offer a way to do that that I may have missed? Failing that, what is the best away to achieve this functionality?
Thanks,
Dhruva
Back End Queries: Best Practices
Re: Back End Queries: Best Practices
Currently we don't have a feature like this built into the API of XI. I know some users have actually written their own, but if that's not an option you can post it as a feature request on tracker.nagios.com.
Re: Back End Queries: Best Practices
Hello,
I would also need to make more fine-grained queries to the back-end. Say we're monitoring 50,000 servers and I need the status of only a single one at a time. Getting the humongous xml would not be the best way I guess...
Thank you!
I would also need to make more fine-grained queries to the back-end. Say we're monitoring 50,000 servers and I need the status of only a single one at a time. Getting the humongous xml would not be the best way I guess...
What would be the way (flow) to write such functionality?I know some users have actually written their own...
Thank you!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Back End Queries: Best Practices
In the newest version of the backend API (with XI 2011R2.1) you can add filters to the URL string on some calls.
For example, on a gethost status call, you can add &host_id=12345 to the url and only get info on that item.
you can also use &host_name=MYHOST
For example, this
will only give you the status of a host with a host_name
For example, on a gethost status call, you can add &host_id=12345 to the url and only get info on that item.
you can also use &host_name=MYHOST
For example, this
Code: Select all
https://192.168.5.69/nagiosxi/backend/?cmd=gethoststatus&username=nagiosadmin&ticket=XXXXXXXX&host_name=localhostRe: Back End Queries: Best Practices
That's great! Thanks for the info!
But where can I see the API's documentation with a list of possible queries?
The API Component I installed a couple of days ago by default does not offer such info in its settings.
Cheers!
Code: Select all
For example, on a gethost status call, you can add &host_id=12345 to the url and only get info on that item.
you can also use &host_name=MYHOSTThe API Component I installed a couple of days ago by default does not offer such info in its settings.
Cheers!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Back End Queries: Best Practices
Unfortunately, we don't have documentation on this yet, it is currently an undocumented/unadvertised feature but it is on the TODO list.