Page 1 of 1

Nagios event creation from API rest

Posted: Sat Nov 04, 2017 6:53 am
by nagit
Hi all,

Would it be possible to create event using the REST API ?
Something like:
curl -XPOST "http://localhost/nagiosxi/api/v1/config ... T&pretty=1" -d "host_name=testapihost&address=127.0.0.1&check_command=check_ping\!3000,80%\!5000,100%&status_info=ping_is_down&status=critical&last_check_time=now"

And the same apply it the check is back up OK, get a acknowledgement of the event in NAgios:
curl -XPOST "http://localhost/nagiosxi/api/v1/config ... T&pretty=1" -d "host_name=testapihost&address=127.0.0.1&check_command=check_ping\!3000,80%\!5000,100%&status_info=ping_is_up&status=OK&last_check_time=now"

Thanks,

Rgds,

Re: Nagios event creation from API rest

Posted: Mon Nov 06, 2017 12:25 pm
by kyang
Hello @nagit,

Are you trying to create a new host/service that specifies the status and info for ping as down and then acknowledge it?

Or are you trying to update a host/service you currently have and change its status info and state and then acknowledge it?

Can you explain your situation a bit more?

Have you taken a look at the REST API help documentation?

Nagios XI home --> help --> REST API docs