Schedule service downtime with cmd.cgi from external host

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
barrowkwan
Posts: 2
Joined: Thu May 12, 2011 12:24 am

Schedule service downtime with cmd.cgi from external host

Post 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"
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

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

Post by tonyyarusso »

I believe you want seconds from the Unix epoch, as you get in the output of `date +%s`.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
barrowkwan
Posts: 2
Joined: Thu May 12, 2011 12:24 am

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

Post 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"
Locked