Page 1 of 1
about nagiosxi rest api
Posted: Thu May 31, 2018 8:30 pm
by Olin
hi ,
i want to use nagiosxi rest api to set Schedule downtime or Disable notifications enable notifications or acknowledged or noacknowledged?
can you give me some advises?
thank you !
Re: about nagiosxi rest api
Posted: Fri Jun 01, 2018 1:18 pm
by cdienger
While these are not available, the eventual goal is to be able to do pretty much anything via the API and the 5.5 release will contain some big improvements.
Re: about nagiosxi rest api
Posted: Fri Jun 01, 2018 1:33 pm
by tgriep
You can use the External Commands CGI to and uses curl commands of bash scripts to achieve what you want.
I have a few examples of the curl commands you can look at for examples.
This works for scheduling downtime for a host.
Code: Select all
curl -d "cmd_typ=55&cmd_mod=2&host=localhost&com_data=TestingDowntime&trigger=0&start_time=06-30-2016 18:30:00&end_time=06-30-2016 18:40:00&fixed=1&childoptions=0&btnSubmit=Commit" "http://192.168.112.130/nagios/cgi-bin/cmd.cgi" -u "nagiosadmin:nagiosadmin"
This for scheduling downtime for host and all of the services
Code: Select all
curl -d "cmd_typ=86&cmd_mod=2&host=localhost&com_data=TestingDowntime&trigger=0&start_time=02-08-2018 18:30:00&end_time=02-08-2018 18:40:00&fixed=1&childoptions=0&btnSubmit=Commit" "https://192.168.112.129/nagios/cgi-bin/cmd.cgi" -u "nagiosadmin:nagiosadmin" -k
For bash script examples and a list of external commands, take a look at this link.
https://old.nagios.org/developerinfo/ex ... ndlist.php
Re: about nagiosxi rest api
Posted: Wed Jun 20, 2018 8:26 pm
by Olin
thanks
@tgriep and
@cdienger
And what time is the 5.5 release ?
Re: about nagiosxi rest api
Posted: Thu Jun 21, 2018 8:37 am
by scottwilkerson
It is soon, can't give an exact date as it is in final testing.