Page 1 of 1

CGI commands and scripts

Posted: Tue Feb 18, 2020 6:23 am
by ibmkenexa
Hi Team,

What is CGI in Nagios XI, is it command line feature, can we use any commands to get reports. I would like to get a report of host groups and members of host groups in text or csv format. In some other question I was told by you Tech guy i.e API not support in our existing Nagios XI version 5.2.7

Please let me know how to get the required report in text, csv or other file format in other way than API. Thanks in advance.

Re: CGI commands and scripts

Posted: Tue Feb 18, 2020 8:32 am
by scottwilkerson
With that old of a version you cannot get it from Nagios XI API, but it is available from the Nagios Core JSON API

Go to the following URL (you will need to re-authenticate)

Code: Select all

http://<SERVER_IP>/nagios/cgi-bin/objectjson.cgi?query=hostgrouplist&details=true

Re: CGI commands and scripts

Posted: Wed Feb 19, 2020 4:41 am
by ibmkenexa
H scottwilkerson,

Thanks for sharing. I tried in a different ways, but not succeded, can we get all details like Hostgroup and its Hosts, Status and Services. In my screen shot group adgkapp has two hosts, each host has some (5) services, these details also want to get. It is easy to us. Please suggest.

Re: CGI commands and scripts

Posted: Wed Feb 19, 2020 7:17 am
by scottwilkerson
This is not available in a single API pull. It is definitely easier if you upgrade to the latest and can use the Nagios XI APIs though