Command-line scheduled disable
list Frédéric Mangeant
Hi Henrik would it possible to schedule a disable using the command-line ? Something like $BB $BBDISP "disable $MACHINE.$TEST $DURATION $START_OF_DISABLE" Thanks in advance. Regards, -- Frédéric Mangeant Steria EDC Sophia-Antipolis
list Allan Spencer
▸
Frédéric Mangeant wrote:
Hi Henrik would it possible to schedule a disable using the command-line ? Something like $BB $BBDISP "disable $MACHINE.$TEST $DURATION $START_OF_DISABLE" Thanks in advance. Regards,
If its on a schedule why dont you use the DOWNTIME flags in the hosts file ? Can't remember if this stops it from alerting though but ive covered it anyway by putting in a time for a box for example that restarts every sunday at 10am the line reads like host=xyz.host.com mail=user-a58b67019283@xymon.invalid time=*:1045:1000 so it will alert at all times between 1045 and 1000 which is kinda wacked but its the only way I figured out how to stop it :) HTH Allan
list Henrik Størner
▸
On Thu, Nov 24, 2005 at 02:48:44PM +0100, Frédéric Mangeant wrote:
would it possible to schedule a disable using the command-line ? Something like $BB $BBDISP "disable $MACHINE.$TEST $DURATION $START_OF_DISABLE"
There's a generic "schedule" command in the Hobbit protocol to do that. You can put a "schedule TIMESTAMP" in front of any command and Hobbit will execute that command at the requested time. TIMESTAMP is a Unix epoch time (seconds since Jan 1 1970). So your command would be: STARTTIME=`date +%s --date="$START_OF_DISABLE"` $BB $BBDISP "schedule $STARTTIME disable $MACHINE.$TEST $DURATION" That is in fact how the scheduled enable/disable works when you use it via the Web GUI. Henrik
list Alon Ofek
I wondered if there is a way to schedule, for example, that a monitor will go disable last Sunday in every month. My DB that is going down for cold backup and sometimes I forget to schedule the monitor disable so I have the support waking me up in the middle of the night :=) Thanks, Alon
▸
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Friday, November 25, 2005 12:34 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Command-line scheduled disable
On Thu, Nov 24, 2005 at 02:48:44PM +0100, Frédéric Mangeant wrote:would it possible to schedule a disable using the command-line ? Something like $BB $BBDISP "disable $MACHINE.$TEST $DURATION $START_OF_DISABLE"
There's a generic "schedule" command in the Hobbit protocol to do that. You can put a "schedule TIMESTAMP" in front of any command and Hobbit will execute that command at the requested time. TIMESTAMP is a Unix epoch time (seconds since Jan 1 1970). So your command would be: STARTTIME=`date +%s --date="$START_OF_DISABLE"` $BB $BBDISP "schedule $STARTTIME disable $MACHINE.$TEST $DURATION" That is in fact how the scheduled enable/disable works when you use it via the Web GUI. Henrik
The information contained in this message is proprietary of Bezeq International,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated recipient(s)
of the message. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, use, distribution or copying of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.
Thank you.
list Charles Jones
Henrik, Speaking of this, I'm using the DOWNTIME feature in bb-hosts to schedule certain hosts to be in maint mode during certain times. One problem though is there is no way to put a reason so that when people click on it in the GUI they can see that it is a scheduled disable. Also DOWNTIME disabled the entire host, it would be nice to be able to specify by service. What would be really cool would be: DOWNTIME=service:day:startime:endtime:reason Then you could have a host with for example: somehost.com 1.2.3.4 # ssh cpu disk msgs DOWNTIME=http,msgs:*:0600:0800:"Scheduled Apache Maintenance" Currently we can "sort of" get this functionality with the IGNORE option, but when using IGNORE although alerts are not sent out, the host/service still turns red on the display which might worry someone looking at it (Maybe IGNORE should be called NOALERT) Just some ideas :-) -Charles
▸
-----Original Message----- From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Friday, November 25, 2005 12:34 AM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Command-line scheduled disable There's a generic "schedule" command in the Hobbit protocol to do that. You can put a "schedule TIMESTAMP" in front of any command and Hobbit will execute that command at the requested time. TIMESTAMP is a Unix epoch time (seconds since Jan 1 1970). So your command would be: STARTTIME=`date +%s --date="$START_OF_DISABLE"` $BB $BBDISP "schedule $STARTTIME disable $MACHINE.$TEST $DURATION" That is in fact how the scheduled enable/disable works when you use it via the Web GUI.