How do I clone maintenance mode record ?
I am rsyncing configuration files from hobbit1( primary) to hobbit2 (standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2 server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside "data/disabled" ?
T.J. Yang
Insert movie times and more without leaving Hotmail®. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutori...
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2 (standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2 server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside "data/disabled" ?
I recall, from a code browse some time ago, that the alerts module used the acknowledge.log in deciding whether alerts had been sent -- you may need to copy that over. I thought it odd, having that in the logs/ directory but used as a data file - but you might look at that. -Alan
I have a separate hobbit-alerts.cfg file for the secondary. It simply monitors the primary, and if the primary goes down, runs a script to copy the primaries -alerts file into place. Then it has a recovery script to turn itself back off.
The primary rdists the pertinent files over nightly.
Paul Root IM/MNS Infrastructure
-----Original Message-----
From: Alan Sparks [mailto:asparks at doublesparks.net]
Sent: Thursday, July 09, 2009 12:10 PM
To: hobbit at hswn.dk
Subject: Re: [hobbit] How do I clone maintenance mode record ?
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2 (standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2 server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside "data/disabled" ?
I recall, from a code browse some time ago, that the alerts module used the acknowledge.log in deciding whether alerts had been sent -- you may need to copy that over. I thought it odd, having that in the logs/ directory but used as a data file - but you might look at that. -Alan
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
From: Paul.Root at qwest.com To: hobbit at hswn.dk Date: Thu, 9 Jul 2009 13:22:13 -0500 Subject: RE: [hobbit] How do I clone maintenance mode record ?
I have a separate hobbit-alerts.cfg file for the secondary. It simply monitors the primary, and if the primary goes down, runs a script to copy the primaries -alerts file into place. Then it has a recovery script to turn itself back off.
we use cron job to pull selected bb-host*,hobbit-alert*,hobbit-data and others from hobbit1 to hobbit2 using rsync. and with hobbit server side module to check health of hobbit1, if hobbit1 is bad hobbit2 will enable its bbpage worker module to assume the failed hobbit1 alert service.
Two issues remains.
- maintenance records are not failed over yet.thus hobbit2 send out false alerts.
- rrd files on hobbit1 need to be patched with rrd data from hobbit2 for hobbit1's down period.
tj
The primary rdists the pertinent files over nightly.
Paul Root IM/MNS Infrastructure -----Original Message----- From: Alan Sparks [mailto:asparks at doublesparks.net] Sent: Thursday, July 09, 2009 12:10 PM To: hobbit at hswn.dk Subject: Re: [hobbit] How do I clone maintenance mode record ?
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2 (standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2 server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside "data/disabled" ?
I recall, from a code browse some time ago, that the alerts module used the acknowledge.log in deciding whether alerts had been sent -- you may need to copy that over. I thought it odd, having that in the logs/ directory but used as a data file - but you might look at that. -Alan
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
Lauren found her dream laptop. Find the PC that’s right for you. http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
I think maybe the server keeps the disabled status in memory, so simply copying files just isn't going to do it. This should do the trick: ===== server/ext/getblues.sh ===== #!/bin/bash
. /home/xymon/server/etc/hobbitserver.cfg
$BB localhost "hobbitdboard color=blue
fields=hostname,testname,disabletime,dismsg" | $SED -e 's/\\/\\\\/g' ===== end of file =====
===== server/ext/putblues.sh ===== #!/bin/bash
. /home/xymon/server/etc/hobbitserver.cfg
cat $1 | while read line
do
OFS="$IFS"
IFS="|"
set $line
IFS="$OFS"
x=`echo "$4" | $SED -e 's/\\\n/\n/g'`
$BB localhost "disable $1.$2 $3 $x"
done
===== end of file =====
on the primary, whenever the other files are copied, run this and copy the file:
server/ext/getblues.sh > server/tmp/blues.out
whenever the secondary needs to take over, have it run the other script:
server/etc/putblues.sh server/tmp/blues.out
That should load up the disabled status messages into the secondary.
NB: I've only tested this on a single server, making a slight change to the messages in the blues.out file before reloading it. The change loads up just fine, so it would *probably* work on a different server. YMMV :)
Ralph Mitchell
On Thu, Jul 9, 2009 at 1:34 PM, T.J. Yang <tj_yang at hotmail.com> wrote:
From: Paul.Root at qwest.com To: hobbit at hswn.dk Date: Thu, 9 Jul 2009 13:22:13 -0500 Subject: RE: [hobbit] How do I clone maintenance mode record ?
I have a separate hobbit-alerts.cfg file for the secondary. It simply monitors the primary, and if the primary goes down, runs a script to copy the primaries -alerts file into place. Then it has a recovery script to turn itself back off.
we use cron job to pull selected bb-host*,hobbit-alert*,hobbit-data and others from hobbit1 to hobbit2 using rsync. and with hobbit server side module to check health of hobbit1, if hobbit1 is bad hobbit2 will enable its bbpage worker module to assume the failed hobbit1 alert service.
Two issues remains.
- maintenance records are not failed over yet.thus hobbit2 send out false alerts.
- rrd files on hobbit1 need to be patched with rrd data from hobbit2 for hobbit1's down period.
tj
The primary rdists the pertinent files over nightly.
Paul Root IM/MNS Infrastructure -----Original Message----- From: Alan Sparks [mailto:asparks at doublesparks.net] Sent: Thursday, July 09, 2009 12:10 PM To: hobbit at hswn.dk Subject: Re: [hobbit] How do I clone maintenance mode record ?
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2
(standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will
generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2
server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside
"data/disabled" ?
I recall, from a code browse some time ago, that the alerts module used the acknowledge.log in deciding whether alerts had been sent -- you may need to copy that over. I thought it odd, having that in the logs/ directory but used as a data file - but you might look at that.
Date: Thu, 9 Jul 2009 11:10:23 -0600 From: asparks at doublesparks.net To: hobbit at hswn.dk Subject: Re: [hobbit] How do I clone maintenance mode record ?
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2 (standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2 server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside "data/disabled" ?
I recall, from a code browse some time ago, that the alerts module used the acknowledge.log in deciding whether alerts had been sent -- you may need to copy that over. I thought it odd, having that in the logs/ directory but used as a data file - but you might look at that.
Code tracing,
F1: hobbit-enadis.sh -> F2: hobbit-enadis.c
Turns out hobbit-enadis.c is just an front end to issue "bb disable/enabled ..." command.
so the question is now turn into how hobbit daemon perform disabling and writing logs.
F1: http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/branches/4.2.0/web/hob... F2: http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/branches/4.2.0/web/hob...
tj
-Alan
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutoria...
Xymon does not use "data/disabled" dir.
From hobbitlaunch.cfg:
"bbenadis" updates the files used to indicate that a host or test has
been enabled or disabled.
Unless you are running server side scripts that look at these files,
you do not need this.
All Xymon status are available by querying the hobbitdboard. See the man page of bb(1)
Dominique
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2 (standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2 server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside "data/disabled" ?
T.J. Yang
Insert movie times and more without leaving Hotmail®. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutori... To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
I have a script that sync enabled and disabled between a primary and DR hobbit server if you are interested.
-----Original Message----- From: Dominique Frise [mailto:dominique.frise at unil.ch] Sent: Friday, 10 July 2009 4:30 PM To: hobbit at hswn.dk Subject: Re: [hobbit] How do I clone maintenance mode record ?
Xymon does not use "data/disabled" dir.
From hobbitlaunch.cfg:
"bbenadis" updates the files used to indicate that a host or test has
been enabled or disabled.
Unless you are running server side scripts that look at these files,
you do not need this.
All Xymon status are available by querying the hobbitdboard. See the man page of bb(1)
Dominique
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2
(standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will
generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2
server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside
"data/disabled" ?
T.J. Yang
Insert movie times and more without leaving HotmailR.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutori al_QuickAdd_062009
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
From: davidp at electronf.com To: hobbit at hswn.dk Date: Fri, 10 Jul 2009 18:58:37 +1000 Subject: RE: [hobbit] How do I clone maintenance mode record ?
I have a script that sync enabled and disabled between a primary and DR hobbit server if you are interested.
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.
tj
-----Original Message----- From: Dominique Frise [mailto:dominique.frise at unil.ch] Sent: Friday, 10 July 2009 4:30 PM To: hobbit at hswn.dk Subject: Re: [hobbit] How do I clone maintenance mode record ?
Xymon does not use "data/disabled" dir.
From hobbitlaunch.cfg:
"bbenadis" updates the files used to indicate that a host or test has
been enabled or disabled.
Unless you are running server side scripts that look at these files,
you do not need this.
All Xymon status are available by querying the hobbitdboard. See the man page of bb(1)
Dominique
T.J. Yang wrote:
I am rsyncing configuration files from hobbit1( primary) to hobbit2
(standby) server.
But without maintenance mode records of hobbit1 copy over, hobbit2 will
generate alerts for hosts that had been put into maintenance mode already.
Currently I tried to rsync "data/disabled" directory and restart hobbit2
server but the maintenace web page still show less hosts on hobbit2.
Anyone know where is the maintenance records store at beside
"data/disabled" ?
T.J. Yang
Insert movie times and more without leaving HotmailR.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutori al_QuickAdd_062009
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
Insert movie times and more without leaving Hotmail®. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutori...
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
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
participants (6)
-
asparks@doublesparks.net
-
davidp@electronf.com
-
dominique.frise@unil.ch
-
Paul.Root@qwest.com
-
ralphmitchell@gmail.com
-
tj_yang@hotmail.com