[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: Fri, 10 Jul 2009 01:00:38 -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=mxihfRz+F6X6Wh8k9l/Fj0eNg0kGV7mlUk1p0ekkzU8=; b=MLyrrXsVvOuWmdLXvmAjFv2MMJkM+OxkusATj4ymDg7YIkK0MLi8bI+x0szKP6MFZb ZKtgxBoOiOi0DxpfQjJ72I6PVkshYlKk/H3i+VsPPGYAqgSxylFYQ+794mNz/TCX680u 3pdYS2HpX8QspysXeBq3E12t6J8mXCDCZILeg=
- 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=jrPYQt+aXjttnOx/j8JT9YkQO+vwTe4+sLl6VfP1ZvaBMp36kwJW7WqRLXdqo2uQgi 1uil4GuPJ+/nNbnMY5JucgMCGJq4U+CLCYQHwAPtPclMDzBIrq22V31SAmU3Ad/2xvdh 4riTqu/RfTgDyKraUwiCSEn1QC52ikeiIcswM=
- References: <4A56247F.9000501 (at) doublesparks.net> <2685F464D7BC7C4DA88845C97AEB5F5330F1F6330C (at) qtomaexmbm22.AD.QINTRA.COM> <BAY138-W28399F066943754FA7DAEB9F260 (at) phx.gbl>
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 =====
1) on the primary, whenever the other files are copied, run this and copy
the file:
server/ext/getblues.sh > server/tmp/blues.out
2) 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.
>
> 1. maintenance records are not failed over yet.thus hobbit2 send out false
> alerts.
> 2. 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.
>