Testing Hobbit alerts
list Martin Ward
Hi all,
I am looking in to setting up Hobbit alerts but I am having problems
verifying and testing the configs.
In my hobbit-alerts.cfg file I have the following entry:
HOST=tac0.lon.ws.colt.net
MAIL user-2d33a6eb6a05@xymon.invalid
Also, in my hobbitserver.cfg I have this:
MAILC="/bin/mailx" # Command used to send an
e-mail with no subject
MAIL="$MAILC -s" # Command used to send
an e-mail with a subject
So the theory goes that when an alert occurs the /bin/mailx command is
executed with various different parameters.
The problem is, when I try and test it I get the following:
hobbit at hbt0:/opt/hobbit/server/etc>hobbitd_alert --test
tac0.lon.ws.colt.net proc
00000935 2008-06-24 15:19:56 send_alert tac0.lon.ws.colt.net:proc state
Paging
00000935 2008-06-24 15:19:56 Matching host:service:page
'tac0.lon.ws.colt.net:proc:Netops' against rule line 128
00000935 2008-06-24 15:19:56 *** Match with 'HOST=tac0.lon.ws.colt.net'
***
00000935 2008-06-24 15:19:56 Matching host:service:page
'tac0.lon.ws.colt.net:proc:Netops' against rule line 128
00000935 2008-06-24 15:19:56 *** Match with 'HOST=tac0.lon.ws.colt.net'
***
00000935 2008-06-24 15:19:56 Mail alert with command '/var/mail/hobbit
"Hobbit [12345] tac0.lon.ws.colt.net:proc CRITICAL (RED)"
user-2d33a6eb6a05@xymon.invalid'
As you can see the mail alert command is completely wrong. Running this
command under different user IDs simply changes the user ID in the
"/var/mail/..." text above. I can't get Hobbit to actually run the mailx
command.
Any suggestions as to what I am missing?
|\/|artin
--
Martin Ward
Network Systems Operations Specialist
DDI: +44 (0) 20 7863 5218
Fax: +XX (X) XX XXXX XXXX
Mob: +44 (0) 7971 97 77 21
www.colt.net
Data | Voice | Managed Services
Help reduce your carbon footprint | Think before you print
COLT Telecommunications, Beaufort House, XX St Botolph Street, London,
EC3A 7QN UK
Registered in England and Wales, registered number 02452736, VAT number
GB 645 4205 50
*************************************************************************************
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way.
The contents of this message and its attachments are confidential and may also be subject to legal privilege. If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies.
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses.
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.
list Henrik Størner
On Tue, Jun 24, 2008 at 04:22:05PM +0100, Ward, Martin wrote:
Also, in my hobbitserver.cfg I have this: MAILC="/bin/mailx" MAIL="$MAILC -s"
▸
So the theory goes that when an alert occurs the /bin/mailx command is
executed with various different parameters.
The problem is, when I try and test it I get the following:
hobbit at hbt0:/opt/hobbit/server/etc>hobbitd_alert --test tac0.lon.ws.colt.net proc Always use the "bbcmd" utility to setup the environment for your tests. That's the only way you can make sure hobbitd_alert inherits the settings from your hobbitserver.cfg - if you don't use bbcmd, then it will use the built-in (compile-time) defaults. So your command should be bbcmd hobbitd_alert --test tac0.lon.ws.colt.net proc Regards, Henrik
list Martin Ward
▸
Always use the "bbcmd" utility to setup the environment for ... So your command should be bbcmd hobbitd_alert --test tac0.lon.ws.colt.net proc
Thanks Henrik, with that command I get:
00014153 2008-06-25 14:49:28 Matching host:service:page
'tac0.lon.ws.colt.net:proc:Netops' against rule line 128
00014153 2008-06-25 14:49:28 *** Match with 'HOST=tac0.lon.ws.colt.net'
***
00014153 2008-06-25 14:49:28 Matching host:service:page
'tac0.lon.ws.colt.net:proc:Netops' against rule line 128
00014153 2008-06-25 14:49:28 *** Match with 'HOST=tac0.lon.ws.colt.net'
***
00014153 2008-06-25 14:49:28 Mail alert with command '/bin/mailx -s
"Hobbit [12345] tac0.lon.ws.colt.net:proc CRITICAL (RED)"
user-2d33a6eb6a05@xymon.invalid'
And I can confirm that running the mailx command specified DOES send an
email, so the mail system itself is working correctly.
Unfortunately Hobbit itself is not generating anything. My
hobbit-alerts.cfg file looks like this:
HOST=tac0.lon.ws.colt.net
MAIL user-2d33a6eb6a05@xymon.invalid repeat=5m
So any alert should email me. I have a simple test set up so that if I
am not editing a specific file a process in not found and the "procs"
column goes red, but no emails are forthcoming. I've even tried changing
the "mailx" command to a simple script that logs whatever is output from
Hobbit to a log file, but nothing comes out. It looks like the alerting
functionality is not working or has been disabled somehow, but that
makes no sense.
Can you give me some more pointers as to where to look?
▸
|\/|
--
-----Original Message----- From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: 24 June 2008 22:39 To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] Testing Hobbit alerts On Tue, Jun 24, 2008 at 04:22:05PM +0100, Ward, Martin wrote:Also, in my hobbitserver.cfg I have this: MAILC="/bin/mailx" MAIL="$MAILC -s"So the theory goes that when an alert occurs the /bin/mailx command is > executed with various different parameters. The problem is, when I try and test it I get the following: hobbit at hbt0:/opt/hobbit/server/etc>hobbitd_alert --test tac0.lon.ws.colt.net procAlways use the "bbcmd" utility to setup the environment for your tests. That's the only way you can make sure hobbitd_alert inherits the settings from your hobbitserver.cfg - if you don't use bbcmd, then it will use the built-in (compile-time) defaults. So your command should be bbcmd hobbitd_alert --test tac0.lon.ws.colt.net proc Regards, Henrik
*************************************************************************************
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way.
The contents of this message and its attachments are confidential and may also be subject to legal privilege. If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies.
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses.
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.
list Henrik Størner
▸
On Wed, Jun 25, 2008 at 03:56:21PM +0100, Ward, Martin wrote:
Thanks Henrik, with that command I get: 00014153 2008-06-25 14:49:28 Mail alert with command '/bin/mailx -s "Hobbit [12345] tac0.lon.ws.colt.net:proc CRITICAL (RED)" user-2d33a6eb6a05@xymon.invalid' And I can confirm that running the mailx command specified DOES send an email, so the mail system itself is working correctly. Unfortunately Hobbit itself is not generating anything.
Anything logged in the page.log file ? Is hobbitd_alert running at all ? As a last resort, run hobbitd_alert with the "--debug" option and let me see what it says. Henrik
list Martin Ward
Anything logged in the page.log file ? Is hobbitd_alert running at all
? No, page.log hasn't been written to in months although the last entries in it were: 2007-09-27 22:44:29 Cannot open configuration file /opt/hobbit/server/etc/hobbit-alerts.cfg: No such file or directory 2007-09-27 22:50:38 Worker process died with exit code 0, terminating Which seems to show that while I was setting Hobbit up last year I didn't have this file. Hobbitd_alert isn't running and this is part of what is causing me issues as I can't find how it is started (this is where my ignorance shows through).
▸
As a last resort, run hobbitd_alert with the "--debug" option and let me see what it says.
2008-06-26 08:52:15 Want msg 1, startpos 0, fillpos 0, endpos -1, usedbytes=0, bufleft=266239 2008-06-26 08:53:15 No files modified, skipping reload of /opt/hobbit/server/etc/hobbit-alerts.cfg 2008-06-26 08:53:15 0 alerts to go 2008-06-26 08:53:15 Want msg 1, startpos 0, fillpos 0, endpos -1, usedbytes=0, bufleft=266239 2008-06-26 08:54:15 No files modified, skipping reload of /opt/hobbit/server/etc/hobbit-alerts.cfg 2008-06-26 08:54:15 0 alerts to go 2008-06-26 08:54:15 Bad data in channel, skipping it 2008-06-26 08:54:15 Want msg 1, startpos 0, fillpos 0, endpos -1, usedbytes=0, bufleft=266239 2008-06-26 08:55:15 No files modified, skipping reload of /opt/hobbit/server/etc/hobbit-alerts.cfg 2008-06-26 08:55:15 0 alerts to go 2008-06-26 08:55:15 Bad data in channel, skipping it 2008-06-26 08:55:15 Want msg 1, startpos 0, fillpos 0, endpos -1, usedbytes=0, bufleft=266239 2008-06-26 08:56:15 No files modified, skipping reload of /opt/hobbit/server/etc/hobbit-alerts.cfg 2008-06-26 08:56:15 0 alerts to go I started this run with the one possible alert set to green (so no alert was going to occur). At 08:54:00 I initiated the error event. This generates an extra debug entry: 2008-06-26 08:54:15 Bad data in channel, skipping it But I have no idea what this means... :-( |\/|artin
▸
*************************************************************************************
The message is intended for the named addressee only and may not be disclosed to or used by anyone else, nor may it be copied in any way.
The contents of this message and its attachments are confidential and may also be subject to legal privilege. If you are not the named addressee and/or have received this message in error, please advise us by e-mailing user-61c7f445d564@xymon.invalid and delete the message and any attachments without retaining any copies.
Internet communications are not secure and COLT does not accept responsibility for this message, its contents nor responsibility for any viruses.
No contracts can be created or varied on behalf of COLT Telecommunications, its subsidiaries or affiliates ("COLT") and any other party by email Communications unless expressly agreed in writing with such other party.
Please note that incoming emails will be automatically scanned to eliminate potential viruses and unsolicited promotional emails. For more information refer to www.colt.net or contact us on +44(0)20 7390 3900.