Hi,
I could schedule a downtime through http call but could not delete the scheduled downtime using http call. Upon http call, I received a response of 200, which is OK but I don't see the scheduled downtime deleted from UI, Please advise.
http://<hostname>/nagios/cgi-bin/cmd.cgi?cmd_typ=78&down_id=282&btnSubmit=Commit
Thanks
How to delete Scheduled downtime?
Re: How to delete Scheduled downtime?
The url looks correct. I assume the down_id was verified to be correct?
Enable log_external commands in nagios.cfg with the following change and restart nagios:
Now use a running tail to watch for the downtime delete:
You should see something down the lines of the following creation of downtime:
And then the deletion:
Enable log_external commands in nagios.cfg with the following change and restart nagios:
Code: Select all
log_external_commands=1Code: Select all
tail -f /usr/local/nagios/var/nagios.log | grep EXTERNALCode: Select all
[1410212421] EXTERNAL COMMAND: SCHEDULE_HOST_DOWNTIME;gent;1410212415;1410219615;1;0;7200;Nagios Administrator;testCode: Select all
[1410212437] EXTERNAL COMMAND: DEL_HOST_DOWNTIME;141Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to delete Scheduled downtime?
Thanks for your reply. I verified the down_id from UI.
Here is the request and responses for both schedule downtime and cancel downtime:
Here is the request and response from can downtime:
Looks like btnSubmit is not working.
Here is the request and responses for both schedule downtime and cancel downtime:
Code: Select all
Schedule Downtime HttpRequest:
http://test:testpwd@<hostname>/nagios/cgi-bin/cmd.cgi?cmd_typ=55&cmd_mod=2&host=testserver&com_data=TestingDowntime&trigger=0&fixed=1&hours=2&minutes=0&btnSubmit=Commit&start_time=09-08-2014 18:00:00&end_time=09-08-2014 19:00:00
<br>
HttpResponse:
<P><DIV CLASS='infoMessage'>Your command request was successfully submitted to Nagios for processing.<BR><BR>
Note: It may take a while before the command is actually processed.<BR><BR>
Data in UI
testserver 09-08-2014 18:06:12 TestAccount TestingDowntime 09-08-2014 18:00:00 09-08-2014 19:00:00 Fixed 0d 1h 0m 0s 284 N/A
Code: Select all
Cancel Downtime HttpRequest:
http://test:testpwd@<hostname>/nagios/cgi-bin/cmd.cgi?cmd_typ=78&down_id=284&btnSubmit=Commit
HttpResponse:
<P><DIV CLASS='infoMessage'>Please enter all required information before committing the command.<br>Required fields are marked in red.<br>Failure to supply all required values will result in an error.</DIV></P>
Re: How to delete Scheduled downtime?
What version of Nagiso XI are you running?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to delete Scheduled downtime?
Home Page I see - Nagios XI 2012R2.2abrist wrote:What version of Nagiso XI are you running?
and on cmg.cgi page (http://<hostname>/nagios/cgi-bin/cmd.cgi), I see the below:
External Command Interface
Last Updated: Tue Sep 9 08:08:21 PDT 2014
Nagios® Core™ 3.5.0 - http://www.nagios.org
Logged in as nolio
Also, Is there a way to cancel the downtime using hostname or service name instead of downtime id?
Re: How to delete Scheduled downtime?
ok, I will have to test with 2.2 and get back to you.
No, as you may have multiple downtimes set on the object. The id is the only way.gsrinivas wrote:Also, Is there a way to cancel the downtime using hostname or service name instead of downtime id?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.