Dear Expert
To check any Host Status / Service Status , we can check in the script via SNMPGET/SNMPWALK, however we want to use NagiosXI status in our script. Can you please provide any link/document giving in detail.
Regards
how to fetch NagiosXI Host and Service Status in user script
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: how to fetch NagiosXI Host and Service Status in user sc
Are you talking about the status of Nagios XI itself?
If so you can use the API available from XI > Help
For example this should show XI status:
[url]http://<Your%20XI%20System>/nagiosxi/api/v1/system/status?apikey=0on2obamni8i6f3ub8klccmgtank4r64js6a7dtrs5d2idtqjhdsr3cmc38dregf&pretty=1[/url]
If so you can use the API available from XI > Help
For example this should show XI status:
[url]http://<Your%20XI%20System>/nagiosxi/api/v1/system/status?apikey=0on2obamni8i6f3ub8klccmgtank4r64js6a7dtrs5d2idtqjhdsr3cmc38dregf&pretty=1[/url]
Previous Nagios employee
Re: how to fetch NagiosXI Host and Service Status in user sc
To add to what @avandemore mentioned -
I believe what you're looking for can be achieved with the API. Take a look at the Help -> Objects Reference page, this outlines how to use the API to poll for information. The status_text variable is displayed as well here.
On my system, for hosts, I would use this -
Or, for services -
I believe what you're looking for can be achieved with the API. Take a look at the Help -> Objects Reference page, this outlines how to use the API to poll for information. The status_text variable is displayed as well here.
On my system, for hosts, I would use this -
Code: Select all
curl -XGET "http://192.168.3.115/nagiosxi/api/v1/objects/hoststatus?apikey=32klfcka&pretty=1"
Code: Select all
curl -XGET "http://192.168.3.115/nagiosxi/api/v1/objects/servicestatus?apikey=32klfcka&pretty=1"
Former Nagios Employee