Search found 4 matches

by dev.mellano
Sun Feb 05, 2017 1:59 am
Forum: Open Source Nagios Projects
Topic: What is the date format in the Nagios API?
Replies: 3
Views: 1612

Re: What is the date format in the Nagios API?

Suppose I need to get all the service list in critical status starting from 1/1/2017, I call the following API, am I right?
/nagios/cgi-bin/statusjson.cgi?query=servicelist&details=true&dateformat=l&servicestatus=critical&servicetimefield=lasttimecritical&starttime=1483228800
by dev.mellano
Tue Jan 31, 2017 6:38 am
Forum: Open Source Nagios Projects
Topic: What is the date format in the Nagios API?
Replies: 3
Views: 1612

What is the date format in the Nagios API?

I am using Nagios API to get the critical servicelist, but I need to start date and end date for the the lastupdate field. what is the date format that I need to use it there? I tried the long one, but it seems it is not working.
by dev.mellano
Thu Jan 19, 2017 4:16 am
Forum: Open Source Nagios Projects
Topic: How can I call API using PHP?
Replies: 2
Views: 1391

Re: How can I call API using PHP?

I tried the following code, and it is working fine with me, thank u :) <?php $url= "https://username:password@servername/nagios/cgi-bin/statusjson.cgi?query=servicelist&servicestatus=critical&servicetimefield=lastupdate&starttime=01-19-2017"; $arrContextOptions=array( "ssl...
by dev.mellano
Wed Jan 18, 2017 6:58 am
Forum: Open Source Nagios Projects
Topic: How can I call API using PHP?
Replies: 2
Views: 1391

How can I call API using PHP?

Dear All, I wanna call API to get all the critical alerts by API. Here is what I have tried: $user = 'myusername'; $pass = 'mypassword'; $url = "https://myserver/nagios/cgi-bin/statusjson.cgi?query=servicelist&details=true&servicestatus=critical"; $body = array('username' => $user,...