Question about JSON Query Generator :
Can you use JSON Query Generator API writable as in Nagios XI?
Can we use JSON Query Generator to delete objects?
JSON Query Generator
Re: JSON Query Generator
Yes, the JSON CGIs work just as well in Nagios Core as they do in Nagios XI. This is assuming your Nagios Core version includes the JSON CGIs, which it should if you're using a recent version.sandeepatil wrote:Can you use JSON Query Generator API writable as in Nagios XI?
No, you can't "write" anything with the JSON CGIs. That's exclusively a Nagios XI REST API thing.
Nope. The JSON CGIs are exclusively for "reading" Nagios Core data.sandeepatil wrote:Can we use JSON Query Generator to delete objects?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: JSON Query Generator
Thanks for sharing details.
You know other way to delete host, like XI API. (curl -XDELETE).
If have any reference customization detail nagios core / file level to get done expected output, please share.
You know other way to delete host, like XI API. (curl -XDELETE).
If have any reference customization detail nagios core / file level to get done expected output, please share.
Re: JSON Query Generator
There's a bunch of external commands you can leverage to programatically take actions in Nagios Core:
https://old.nagios.org/developerinfo/ex ... ndlist.php
But those don't have anything to do with configuration management.
You'd need to first install some sort of configuration management utility on top of Nagios Core to even begin to get that sort of functionality. There's nothing native to Nagios Core that allows you to manage configuration files. Nagios Core just reads a configuration file and loads the object into it's configuration set.
There's a few open source configuration management utilities out there. To name a few:
https://sourceforge.net/projects/nagiosql/
https://twiki.cern.ch/twiki/bin/view/LCG/NagConf
https://sourceforge.net/projects/lilac--reloaded/
I don't know if any of them provide the same sort of functionality offered by the Nagios XI REST API.
This is also the sort of problem you could solve with system configuration management and automation utilities like Ansible, Chef, Puppet, Salt, etc.
https://old.nagios.org/developerinfo/ex ... ndlist.php
But those don't have anything to do with configuration management.
You'd need to first install some sort of configuration management utility on top of Nagios Core to even begin to get that sort of functionality. There's nothing native to Nagios Core that allows you to manage configuration files. Nagios Core just reads a configuration file and loads the object into it's configuration set.
There's a few open source configuration management utilities out there. To name a few:
https://sourceforge.net/projects/nagiosql/
https://twiki.cern.ch/twiki/bin/view/LCG/NagConf
https://sourceforge.net/projects/lilac--reloaded/
I don't know if any of them provide the same sort of functionality offered by the Nagios XI REST API.
This is also the sort of problem you could solve with system configuration management and automation utilities like Ansible, Chef, Puppet, Salt, etc.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: JSON Query Generator
Will check with shared details.
I know GET function of JSON Query Generator, can you share example POST and HEAD. I tried but not succeeded.
I know GET function of JSON Query Generator, can you share example POST and HEAD. I tried but not succeeded.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: JSON Query Generator
One thing I will add is while there are commands as pointed out to delete hosts/services, this does NOT delete them from your configuration files and hence that will still have to happen.
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: JSON Query Generator
Using nrdp, we can shutdown the nagios server using external command.
Please find attached file.
http://<server_name>/nrdp.
Want to know, with same way can we delete the service from Nagios config file.
Please find attached file.
http://<server_name>/nrdp.
Want to know, with same way can we delete the service from Nagios config file.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: JSON Query Generator
This is not possible in Nagios Core, only Nagios XIsandeepatil wrote:Want to know, with same way can we delete the service from Nagios config file.
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: JSON Query Generator
Thanks, for sharing info. Please close this thread.