Xymon Mailing List Archive search

acks & maint.pl aren't working

10 messages in this thread

list Tom Georgoulias · Mon, 11 Apr 2005 10:13:53 -0400 ·
Upgraded to 4.0.2 this morning and while most everything went smoothly, a couple of things did not.  Not sure if these two are related just yet.

ack:

Cannot acknowledge an alert using the cookie from either the subject line of the email alert or the command line (~/server/bin/bb 127.0.0.1 "hobbitdboard host=secret.nandomedia.com test=conn fields=hostname,testname,cookie").

Strangely enough, it seems teh cookies are still being regenerated frequently, instead of remaining valid for 24 hours (like I thought the latest patch did).

[bb at radm202p ext]$ ~/server/bin/bb 127.0.0.1 "hobbitdboard host=secret.nandomedia.com test=conn fields=hostname,testname,cookie"
secret.nandomedia.com|conn|402332
[bb at radm202p ext]$ ~/server/bin/bb 127.0.0.1 "hobbitdack 402332 30 using command line ack for 402332"
[bb at radm202p ext]$ tail ~/data/acks/acklog
[bb at radm202p ext]$ tail ~/log/hobbitd.log
2005-04-11 09:05:24 How did this happen? clients=0, s.sem_op=0
2005-04-11 09:05:34 Setup complete
2005-04-11 09:08:28 How did this happen? clients=0, s.sem_op=0
2005-04-11 09:08:38 Setup complete
2005-04-11 09:40:34 Cookie 87973 not found, dropping ack
2005-04-11 09:41:38 Cookie 587666 not found, dropping ack
2005-04-11 09:54:35 Cookie 587666 not found, dropping ack
2005-04-11 09:55:45 Cookie 873795 not found, dropping ack
2005-04-11 09:56:33 Cookie 873795 not found, dropping ack
2005-04-11 10:06:29 Cookie 402332 not found, dropping ack
[bb at radm202p ext]$

Trying to disable the same system via the disable CGI didn't work either.  The script stops at "Processing" and the system is not disabled.

This is what I see in /var/log/httpd/error_log

[Mon Apr 11 09:59:25 2005] [error] [client 10.1.1.20] [Mon Apr 11 09:59:25 2005] maint.pl: Use of uninitialized value in pattern match (m//) at /home/bb/cgi-secure/maint.pl line 222.
list Tom Georgoulias · Mon, 11 Apr 2005 13:26:40 -0400 ·
quoted from Tom Georgoulias
Tom Georgoulias wrote:
Upgraded to 4.0.2 this morning and while most everything went smoothly, a couple of things did not.  Not sure if these two are related just yet.

ack:

Cannot acknowledge an alert using the cookie from either the subject line of the email alert or the command line (~/server/bin/bb 127.0.0.1 "hobbitdboard host=secret.nandomedia.com test=conn fields=hostname,testname,cookie").
I reverted back to 4.0 plus some patches and acknowledgements are working again.  I'm going to have to stay there until I get a handle on why 4.0.2 didn't work.

I'm still having problems with maint.pl, so I'm thinking that this could be a problem with my webserver.  I'm still checking that angle.

Tom
list David Stuffle · Mon, 11 Apr 2005 14:53:21 -0500 ·
quoted from Tom Georgoulias
Tom Georgoulias wrote:
Upgraded to 4.0.2 this morning and while most everything
went smoothly, a couple of things did not.  Not sure if
these two are 
related just yet.

ack:

Cannot acknowledge an alert using the cookie from either
the subject line of the email alert or the command line
(~/server/bin/bb 127.0.0.1 "hobbitdboard
host=secret.nandomedia.com test=conn
fields=hostname,testname,cookie"). 

Strangely enough, it seems teh cookies are still being
regenerated frequently, instead of remaining valid for 24
hours (like I 
thought the
latest patch did).

[bb at radm202p ext]$ ~/server/bin/bb 127.0.0.1 "hobbitdboard
host=secret.nandomedia.com test=conn
fields=hostname,testname,cookie"
secret.nandomedia.com|conn|402332 [bb at radm202p ext]$
~/server/bin/bb 127.0.0.1 "hobbitdack 402332 30 using
command line ack for 402332"
[bb at radm202p ext]$ tail ~/data/acks/acklog
[bb at radm202p ext]$ tail ~/log/hobbitd.log
2005-04-11 09:05:24 How did this happen? clients=0,
s.sem_op=0 2005-04-11 09:05:34 Setup complete 2005-04-11
09:08:28 How did this happen? clients=0, s.sem_op=0
2005-04-11 09:08:38 Setup complete 2005-04-11 09:40:34
Cookie 87973 not found, dropping ack 2005-04-11 09:41:38
Cookie 587666 not found, dropping ack 2005-04-11 09:54:35
Cookie 587666 not found, dropping ack 2005-04-11 09:55:45
Cookie 873795 not found, dropping ack 2005-04-11 09:56:33
Cookie 873795 not found, dropping ack 2005-04-11 10:06:29
Cookie 402332 not found, dropping ack [bb at radm202p ext]$

Trying to disable the same system via the disable CGI
didn't work either.  The script stops at "Processing" and
the system is 
not disabled.

This is what I see in /var/log/httpd/error_log

[Mon Apr 11 09:59:25 2005] [error] [client 10.1.1.20]
[Mon Apr 11 09:59:25 2005] maint.pl: Use of uninitialized
value in pattern match (m//) at
/home/bb/cgi-secure/maint.pl line 222. 

My acks aren't working either.  Not through ack menu pick or email reply's.
I'm getting the same "maint.pl: Use of uninitialized value..." error, but
the times don't correspond with my ack attempts.  I do see the acks getting
logged in the procmail.log file, but they're not ack'ing.  This was
happening before and after the 4.0.2 upgrade.

~~~~~~~~~~~~~~
David Stuffle
Delta Faucet Company


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage caused
by any virus transmitted by this email.
list Tom Georgoulias · Mon, 11 Apr 2005 16:14:05 -0400 ·
quoted from Tom Georgoulias
Tom Georgoulias wrote:
I reverted back to 4.0 plus some patches and acknowledgements are working again.  I'm going to have to stay there until I get a handle on why 4.0.2 didn't work.
Can someone confirm that acknowledgements are working for them in 4.0.2?   It'd make me feel better if I knew it was something definitely on my end, or a problem that other shares.  Misery loves company.  :)
I'm still having problems with maint.pl, so I'm thinking that this could be a problem with my webserver.  I'm still checking that angle.
I still don't have this fixed and I'm in need of some guidance or a push in a new direction.  My brain is slowing down.

In my apache logs, I see all sorts of message like these 3:

xgetenv: Cannot find value for variable BBGENOPTS

Use of uninitialized value in pattern match (m//) at /home/bb/cgi-secure/maint.pl line 217., referer: http://secret.nandomedia.com/hobbit-seccgi/maint.pl

maint.pl: Use of uninitialized value in pattern match (m//) at /home/bb/cgi-secure/maint.pl line 217., referer: http://secret.nandomedia.com/hobbit-seccgi/bb-ack.sh

In hobbitserver.cfg, BBGENOPTS is defined as
hobbitserver.cfg:BBGENOPTS="--recentgifs --subpagecolumns=2"

Any ideas?  I tried turing on debugging in maint.pl and checking out line 217 (or 222, which comes up sometimes in error_log), but I don't know enough about perl to really do anything useful with what I've found on the maint.pl webpage in debugging mode.

Tom
list Henrik Størner · Mon, 11 Apr 2005 22:25:35 +0200 ·
quoted from Tom Georgoulias
On Mon, Apr 11, 2005 at 04:14:05PM -0400, Tom Georgoulias wrote:
Tom Georgoulias wrote:
I reverted back to 4.0 plus some patches and acknowledgements are >working again.  I'm going to have to stay there until I get a handle on >why 4.0.2 didn't work.
Can someone confirm that acknowledgements are working for them in 4.0.2?  It'd make me feel better if I knew it was something definitely on my end, or a problem that other shares.  Misery loves company.  :)
Ack's are not working in 4.0.2. Sometimes it's amazing how much can go
wrong in a one-line fix ... when I did the "make cookies valid for 24
hours" for 4.0.2, I forgot to include the current time in that, so
cookies are actually set to expire on Jan 2nd 1970 - a loong time
ago... (about when I started in kindergarten, actually).

Patch attached. Sorry.


Regards,
Henrik
-------------- next part --------------
--- hobbitd/hobbitd.c	2005/04/10 16:37:00	1.138
+++ hobbitd/hobbitd.c	2005/04/11 20:19:26
@@ -923,7 +923,7 @@
 			 * That's for 4.1 - for now, we'll just give it a long enough  			 * lifetime so that cookies will be valid.
 			 */
-			log->cookieexpires = 86400; /* Valid for 1 day */
+			log->cookieexpires = now + 86400; /* Valid for 1 day */
 		}
 	}
 	else {
list Henrik Størner · Mon, 11 Apr 2005 22:42:26 +0200 ·
quoted from David Stuffle
On Mon, Apr 11, 2005 at 02:53:21PM -0500, Stuffle, David wrote:
My acks aren't working either.  Not through ack menu pick or email reply's.
Ack's are broken in 4.0.2 - see patch I sent out a few minutes ago.
(Or: http://www.hswn.dk/hobbitsw/hobbit-4.0.2-acknowledge.patch)
quoted from David Stuffle

I'm getting the same "maint.pl: Use of uninitialized value..." error, but
the times don't correspond with my ack attempts.
No, that's from the enable/disable script. I'm getting pretty fed up
with maint.pl and Perl - it's on the "must rewrite" list now.


Henrik
list Tom Georgoulias · Mon, 11 Apr 2005 17:03:22 -0400 ·
Henrik Stoerner wrote:
Ack's are not working in 4.0.2. 
Patch attached. Sorry.
No problem, thanks for the patch.  I can report that it does, indeed, work.

Tom
list Tom Georgoulias · Tue, 12 Apr 2005 13:45:42 -0400 ·
quoted from Henrik Størner
Henrik Stoerner wrote:
I'm getting pretty fed up
with maint.pl and Perl - it's on the "must rewrite" list now.
Would it be a safe assumption at this point to consider the DOWNTIME tag 
in bb-hosts to be the preferred workaround for disabling hosts, instead 
of using maint.pl?


Tom
list Tom Georgoulias · Tue, 12 Apr 2005 14:59:06 -0400 ·
quoted from Henrik Størner
Henrik Stoerner wrote:
I'm getting the same "maint.pl: Use of uninitialized value..." error, but
the times don't correspond with my ack attempts.

No, that's from the enable/disable script. I'm getting pretty fed up
with maint.pl and Perl - it's on the "must rewrite" list now.
I think I have a fix now, thanks to a more perl knowledgable co-worker.   Try replacing the regular expressions for lines 217 and 222 in maint.pl with these:

if ($bbpagepath =~ /^([-_\/\@.]|\w)+$/)

if ($hostcookie =~ /^([-_\/\@.]|\w)+$/)

maint.pl is working for me now, but I haven't tested it extensively.

Tom
list Henrik Størner · Tue, 12 Apr 2005 22:10:59 +0200 ·
quoted from Tom Georgoulias
On Tue, Apr 12, 2005 at 02:59:06PM -0400, Tom Georgoulias wrote:
Henrik Stoerner wrote:
I'm getting the same "maint.pl: Use of uninitialized value..." error, but
the times don't correspond with my ack attempts.

No, that's from the enable/disable script. I'm getting pretty fed up
with maint.pl and Perl - it's on the "must rewrite" list now.
I think I have a fix now, thanks to a more perl knowledgable co-worker. 
 Try replacing the regular expressions for lines 217 and 222 in 
maint.pl with these:

if ($bbpagepath =~ /^([-_\/\@.]|\w)+$/)

if ($hostcookie =~ /^([-_\/\@.]|\w)+$/)
I must admit that I don't quite grasp the deeper logic behind this,
but if you say it works, then fine with me.

Still, I do prefer to use code that I understand. So rewriting
maint.pl is still on my agenda - first step was to implement a
mechanism to schedule future enable/disable tasks in the Hobbit
daemon, instead of having to use cron from a CGI script (that part of
maint.pl has always worried me from a security perspective, and it's
an area that is mildly incompatible between Unix systems). That is
working now, so next step is to setup the webpage layout to use.

(For the curious among you: I've implemented a new "schedule" command
in the Hobbit protocol, so you can do things like

    bb 127.0.0.1 "schedule `date +%s --date='tomorrow 13:30'` disable www.foo.com.http 1h Network upgrade"

But it isn't limited to just enable/disable, you can put any Hobbit
command there - e.g. a command to drop a host at a certain time).


Henrik