Schedule service downtime with cmd.cgi from external host

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Schedule service downtime with cmd.cgi from external host

Postby barrowkwan » Thu May 12, 2011 12:39 am

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"
barrowkwan
 
Posts: 2
Joined: Thu May 12, 2011 12:24 am

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

Postby tonyyarusso » Thu May 12, 2011 9:29 am

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

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

Postby barrowkwan » Thu May 12, 2011 10:43 am

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"
barrowkwan
 
Posts: 2
Joined: Thu May 12, 2011 12:24 am


Return to Nagios Core

Who is online

Users browsing this forum: Google [Bot] and 12 guests