Hi,
A co-worker worked on the multiple BBDISP ack problem i posted here in February, and i'd like to share his work :-)
Here his investigation results and the fix :
Hobbit does not allow ack's without the correct acknowledgement number as it is this acknum that is used to look up the {HOST}.{TEST} to be acknowledged. So there was no way that the simple trick of using the main/ area section in hobbitserver.cfg was going to work. A side note.... -{ACKNUM} will acknowledge all events for {HOST}
The code only ever forwards to the first IP listed in BBDISPLAYS if the messages type is not one of those as defined in lib/sendmsg.c:multircptcmds.
static char *multircptcmds[] = { "status", "combo", "meta", "data", "notify", "enable", "disable", "drop", "rename", "client", NULL };
The ordering of the parameters in hobbitcfg.conf is critical. The --area must be prior to the --env file parameter so that the correct environment is selected.
We need to use --nopin
We can keep the cookies enabled
The Fix :D
The new bb-ack.cgi now does the following:
Grab a list of all acknowledgable events from the list of Hobbit BBDISPLAY servers.
Present the normal looking "Acknowledge Alert" page, showing the list of events and entry fields to send acknowledgements.
Send the acknowledgements to the relevant BBDISPLAY servers.
Provide feedback as normal for the acknowledgements sent.
The Configuration:
- Change the CGI_ACK_OPTS setting in /opt/hobbit/server/etc/hobbitcgi.conf to:-
CGI_ACK_OPTS="--area=maint --env=/opt/hobbit/server/etc/hobbitserver.cfg --no-pin"
- Add to ~hobbit/server/etc/hobbitserver.conf
acks for others hobbit servers
maint/BBDISP="0.0.0.0" maint/BBDISPLAYS="$BBSERVERIP 10.0.0.2 10.0.0.3"
acks end
Known Issues:
Not fully tested =-o
Could be issues with performance if the BBDISPLAY list is long.
If a BBDISPLAY does not respond (IP is unbound, etc.) then there is a delay while the TCP connect timesout [order of a few seconds].
Theoretical possibility of timing issue between alerts being 'raised' and acknowledged while the alerts are being propogated between BBDISPLAYS.
CGI code is not fantastically 'safe' but I think that's constant with the rest of the code (i.e. I haven't made it any worse!) :/.
Find the new bb-ack.c in attachment. The modifications done are commented between /* Begin Changes for multiBBDISPLAYS for acks */ tag.
Henrik, if this fix is ok for you, it could be good to add it into xymon.
Regards,
Nico
On 11/02/09 20:19, "nico" <nico at crysto.org> wrote:
Hi, Sorry, i'm sending again this email because when i wrote the last, i didn't see it has been merged in another thread :-( I'd like to send ack events to multiple BBDISPLAY.
To do that, i did a change on hobbitserver.cfg with this configuration:
http://www.hswn.dk/hobbiton/2005/10/msg00203.html
- In hobbitserver.cfg on both display servers, after the BBDISPLAY setting add # For the enable/disable and acknowledge scripts. maint/BBDISP="0.0.0.0" maint/BBDISPLAYS="10.0.0.1 172.16.12.10" (replace with your display-server IP-adresses)
- In hobbitcgi.cfg, change the line for the bb-ack.cgi tool: # bb-ack.cgi options CGI_ACK_OPTS="--area=maint --env=/usr/lib/hobbit/server/etc/hobbitserver.cfg"
The first problem is that it seems to not send acks events to the multiples IP but only to local.
The second problem is that when i modified BBDISP with the IP of another hobbit server, we got an error:
2009-02-11 17:02:52 Cookie 338777 not found, dropping ack 2009-02-11 17:06:34 Cookie 338777 not found, dropping ack
The reason is that the cookie is different for the same host/test:
serverA$ ${BB} ${BBSERVERIP}:${BBPORT} "hobbitdboard color=red,yellow fields=hostname,testname,cookie" cusaa-ws02|ftp|640796
serverB$ ${BB} ${BBSERVERIP}:${BBPORT} "hobbitdboard color=red,yellow fields=hostname,testname,cookie" cusaa-ws02|ftp|338777
We tried to disable cookie by adding "--no-cookies" into CGI_ACK_OPTS variable of hobbitcgi.cfg but the problem still happens.
Is there any way to fix it please ? Thanks. Regards, nicolas