[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] How do I clone maintenance mode record ?
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] How do I clone maintenance mode record ?
- From: Ralph Mitchell <ralphmitchell (at) gmail.com>
- Date: Sun, 12 Jul 2009 01:32:39 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ozGOLG0LzTsbgmiaIGwdmS9617OVZiVXukXhAZf6yHs=; b=CvacILjdma6054+OGBNE+8r3q2eJZOYRKQDWKVmva+HXQQrt8uHsI+QRZlXQtPWn5O 7yXVWt1LZFLvvI6t2+cZLprsEomLPoZXx+FuEATTWcKcXx7Dirhz5Xav8bIG93+Wd7or 07RbE2/w0+qYCbkFe1A25QtXOdeatzqPdTxl0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=vO/a1H114d4ZKQvcJp/+55K1PKsewKFOpexeTlBhKEMOBUVD6go1idb/+Rojv3Xt3I CtWrRn+/oVrXqU6dGagLNMJbH4qELsz6s93K5/v7m96yGxAzEAuFwCuiAwybKAUfFvOi G9Ir6/K/Tu/RZeMp7vL6Plg2vFxpFRtN+sM6w=
- References: <BAY138-W2401EB5617EA111C9C59E09F260 (at) phx.gbl> <4A56DFE3.5050302 (at) unil.ch> <0453965AE90A41E0B160CE13AD983B74 (at) behemoth> <BAY138-W211C82D88194A260E559A59F270 (at) phx.gbl> <997a524e0907102252g2efcbccbl7726f1dc8abe37c1 (at) mail.gmail.com>
I realised earlier that the disabletime value coming from hobbitdboard is
actually a unix timestamp, but the disable command wants a duration in the
form of seconds, minutes or hours. Again, this works with Ubuntu, and
probably any other Linux, but maybe not in a different Unix. It relies on
the GNU date command, for a start... :)
========== putblues.sh ==========
#!/bin/sh
. /home/xymon/server/etc/hobbitserver.cfg
cat $1 | while read line
do
OFS="$IFS"
IFS="|"
set $line
IFS="$OFS"
if [ "$3" -eq "-1" ]; then
# found "disable until OK"
lifetime="-1"
else
now=`date +%s`
lifetime=`$EXPR $3 - $now`
if [ "$lifetime" -le "0" ]; then
# this one expired, ignore it
continue
else
lifetime="$lifetime"s
fi
fi
msg=`echo "$4" | $SED -e 's/\\\n/\n/g'`
$BB localhost "disable $1.$2 $lifetime $msg"
done
========== cut here ==========
Ralph Mitchell
On Sat, Jul 11, 2009 at 12:52 AM, Ralph Mitchell <ralphmitchell (at) gmail.com>wrote:
> On Fri, Jul 10, 2009 at 8:19 AM, T.J. Yang <tj_yang (at) hotmail.com> wrote:
>
>> In Ralph Mitchell (ralphmitchell (at) gmail.com)
>> reply email,
>> There are getblue.sh and putblue.sh to do the collecting on primary and
>> populating on DR/standby hobbit server.
>>
>> I tired it but I found the putblue.sh is not working. I still can't see
>> the same list of maintenance hosts between the twos, even the get and put
>> blue shell ran sucessfully.
>>
>> This may caused by lacking of running bbpage alert module on DR/Secondary
>> module. Is your DR hobbit server has alert module disabled and your script
>> still works ?
>>
>> Would you mind to send to the list or send it to my email account ? I like
>> to learn how you did it.
>
>
> As I said, I only tried it in Ubuntu, so I would expect it to work in any
> Linux distribution. I'm still setting up other servers in VMware for
> fooling around with this kind of thing. What OS do you have??
>
> Ralph Mitchell
>
>