Page 1 of 1

Schedule service downtime with cmd.cgi from external host

Posted: Thu May 12, 2011 12:39 am
by barrowkwan
Hi,
I am trying to schedule service downtime from external using cmd.cgi but it kept complaint about "Start or end time not valid". I have been trying different format but no luck. What is a valid start_time and end_time format? ( my nagios.cfg has date_format as "us" )

here is the curl command I used but none of them work

curl -d "cmd_typ=56&cmd_mod=2&start_time=05&#4512&#452011&#3200&#5800&#5800&stop_time=05&#4512&#452011&#3201&#5800&#5800&host=myhost01&com_data=blahblah&service=check_total_procs&fixed=1&childoptions=0&btnSubmit=Commit" "http://localhost/nagios/cgi-bin/cmd.cgi"

curl -d "cmd_typ=56&cmd_mod=2&start_time=05-12-2011 00:00:00&stop_time=05-12-2011 02:00:00&host=myhost01&com_data=blahblah&service=check_total_procs&fixed=1&childoptions=0&btnSubmit=Commit" "http://localhost/nagios/cgi-bin/cmd.cgi"

curl -d "cmd_typ=56&cmd_mod=2&start_time=2011-05-12 00:00:00&stop_time=2011-05-12 02:00:00&host=myhost01&com_data=blahblah&service=check_total_procs&fixed=1&childoptions=0&btnSubmit=Commit" "http://localhost/nagios/cgi-bin/cmd.cgi"

Re: Schedule service downtime with cmd.cgi from external hos

Posted: Thu May 12, 2011 9:29 am
by tonyyarusso
I believe you want seconds from the Unix epoch, as you get in the output of `date +%s`.

Re: Schedule service downtime with cmd.cgi from external hos

Posted: Thu May 12, 2011 10:43 am
by barrowkwan
I tried that too but same result.

curl -d "cmd_typ=56&cmd_mod=2&host=myhost01&service=check_total_procs&com_data=blahblah&trigger=0&start_time=1305417600&stop_time=1305424800&fixed=1&btnSubmit=Commit" "http://localhost/nagios/cgi-bin/cmd.cgi"