I am using the Nagios Core 4.4.3 on Cent OS 7.
I am planning to integrate the Nagios with Service Now using a Tool.
For the Integration i need the APIs to query the data.
I know that there is Backend API for the Nagios XI, can i use the same for the Nagios Core?
If No is there any other way to query the Nagios core data.
API for Querying the Data
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: API for Querying the Data
Nagios Core has a read-only API available at the following endpoint on your Core install
Code: Select all
/nagios/jsonquery.html
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: API for Querying the Data
Thanks Scott,
I will need to give the team a URL along with the credentials to query the data from the Nagios.
Can you suggest how can i do it?
I will need to give the team a URL along with the credentials to query the data from the Nagios.
Can you suggest how can i do it?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: API for Querying the Data
If you go to
make selections
run the query, then it will display the url for the specific query you want to run.
As for credentials, this will be credentials for a user with access to the nagios interface.
Code: Select all
http://YOUR_HOST/nagios/jsonquery.html
run the query, then it will display the url for the specific query you want to run.
As for credentials, this will be credentials for a user with access to the nagios interface.
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: API for Querying the Data
Thanks Scott
My requirement is to get the list of the services whose status is Critical along with their current Values.
When used the URL and selected the options as follows:
CGI: Status Jason CGI
Query: Servicelist
Show Details: true
Service Status: Critical
It is giving the following URL:
http://xxx.xxx.xxx.xxx/nagios/cgi-bin/s ... tails=true
Also in the result it is giving the status of all the services weather it is critical or not. From the URl also it is also clear that it is giving the result/status of all the services.
Due to this it is taking long time to complete.
My requirement is to get the list of the services whose status is Critical along with their current Values.
When used the URL and selected the options as follows:
CGI: Status Jason CGI
Query: Servicelist
Show Details: true
Service Status: Critical
It is giving the following URL:
http://xxx.xxx.xxx.xxx/nagios/cgi-bin/s ... tails=true
Also in the result it is giving the status of all the services weather it is critical or not. From the URl also it is also clear that it is giving the result/status of all the services.
Due to this it is taking long time to complete.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: API for Querying the Data
You can add the following to the URL
Code: Select all
&servicestatus=critical