alert using global variable instead of command configured in xymonserver.cfg
list Japheth Cleaver
On Thu, October 29, 2015 8:22 am, Jesse Johnson wrote:
After upgrade to 4.3.21 the global mail variable is being used instead of the custom command configured inside of xymonserver.cfg from xymoneserver.cfg: # For the xymond_alert module MAIL="sendmail -f XYMON -s" # Command used to send an e-mail with a subject MAILC="sendmail -f XYMON " # Command used to send an e-mail with no subject from xymond_alert: xymon at zeus:/usr/local/xymon/server/bin$ ./xymond_alert --test 111-KMC454E conn
*snip*
00003362 2015-10-29 08:54:14 Mail alert with command '/var/mail/xymon "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-042ba090d3c9@xymon.invalid' xymon at zeus:/usr/local/xymon/server/bin$ After setting Global MAIL variable manually: xymon at zeus:/usr/local/xymon/server/bin$ MAIL="sendmail -f XYMON" xymon at zeus:/usr/local/xymon/server/bin$ ./xymond_alert --test 111-KMC454E conn
*snip*
00003489 2015-10-29 08:56:51 Mail alert with command 'sendmail -f XYMON "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-042ba090d3c9@xymon.invalid' xymon at zeus:/usr/local/xymon/server/bin$
Hi Jesse, Are you running xymond_alert in a shell that's already loaded the xymonserver.cfg environment? Typically xymond_alert (and xymond_anything) are run via xymonlaunch, which loads those configs into the environment before executing. Without it, it's simply looking in your shell's normal $MAIL variable (which on some systems is just the directory...) For testing like this, use: xymoncmd --env=(/path/to/)xymonserver.cfg ./xymond_alert --test 111-KMC454E conn If your xymonserver.cfg file is in a "standard" location, you may not need to specify the --env by hand. HTH, -jc
list Jesse Johnson
▸
After upgrade to 4.3.21 the global mail variable is being used instead of the custom command configured inside of xymonserver.cfg from xymoneserver.cfg: # For the xymond_alert module MAIL="sendmail -f XYMON -s" # Command used to send an e-mail with a subject MAILC="sendmail -f XYMON " # Command used to send an e-mail with no subject from xymond_alert: xymon at zeus:/usr/local/xymon/server/bin$ ./xymond_alert --test 111-KMC454E conn
00003362 2015-10-29 08:54:14 send_alert 111-KMC454E:conn state Paging
00003362 2015-10-29 08:54:14 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 120
00003362 2015-10-29 08:54:14 Failed 'HOST=050-CannonMFP TIME=*:0600:2200' (hostname not in include list)
00003362 2015-10-29 08:54:14 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 123
00003362 2015-10-29 08:54:14 *** Match with 'HOST=* TIME=*:0600:2200' ***
00003362 2015-10-29 08:54:14 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 124
00003362 2015-10-29 08:54:14 Failed 'IGNORE HOST=Zeus' (hostname not in include list)
00003362 2015-10-29 08:54:14 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 125
00003362 2015-10-29 08:54:14 Failed 'IGNORE HOST=050-CannonMFP' (hostname not in include list)
00003362 2015-10-29 08:54:14 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 126
00003362 2015-10-29 08:54:14 *** Match with 'MAIL user-73f1d8fe2bac@xymon.invalid REPEAT=480M RECOVERED' ***
00003362 2015-10-29 08:54:14 Mail alert with command '/var/mail/xymon "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-73f1d8fe2bac@xymon.invalid'
00003362 2015-10-29 08:54:14 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 127
00003362 2015-10-29 08:54:14 *** Match with 'MAIL user-042ba090d3c9@xymon.invalid REPEAT=480M RECOVERED' ***
▸
00003362 2015-10-29 08:54:14 Mail alert with command '/var/mail/xymon "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-042ba090d3c9@xymon.invalid'
xymon at zeus:/usr/local/xymon/server/bin$
After setting Global MAIL variable manually:
xymon at zeus:/usr/local/xymon/server/bin$ MAIL="sendmail -f XYMON"
xymon at zeus:/usr/local/xymon/server/bin$ ./xymond_alert --test 111-KMC454E conn
00003489 2015-10-29 08:56:51 send_alert 111-KMC454E:conn state Paging
00003489 2015-10-29 08:56:51 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 120
00003489 2015-10-29 08:56:51 Failed 'HOST=050-CannonMFP TIME=*:0600:2200' (hostname not in include list)
00003489 2015-10-29 08:56:51 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 123
00003489 2015-10-29 08:56:51 *** Match with 'HOST=* TIME=*:0600:2200' ***
00003489 2015-10-29 08:56:51 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 124
00003489 2015-10-29 08:56:51 Failed 'IGNORE HOST=Zeus' (hostname not in include list)
00003489 2015-10-29 08:56:51 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 125
00003489 2015-10-29 08:56:51 Failed 'IGNORE HOST=050-CannonMFP' (hostname not in include list)
00003489 2015-10-29 08:56:51 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 126
00003489 2015-10-29 08:56:51 *** Match with 'MAIL user-73f1d8fe2bac@xymon.invalid REPEAT=480M RECOVERED' ***
00003489 2015-10-29 08:56:51 Mail alert with command 'sendmail -f XYMON "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-73f1d8fe2bac@xymon.invalid'
00003489 2015-10-29 08:56:51 Matching host:service:dgroup:page '111-KMC454E:conn:printers:111LV' against rule line 127
00003489 2015-10-29 08:56:51 *** Match with 'MAIL user-042ba090d3c9@xymon.invalid REPEAT=480M RECOVERED' ***
▸
00003489 2015-10-29 08:56:51 Mail alert with command 'sendmail -f XYMON "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-042ba090d3c9@xymon.invalid'
xymon at zeus:/usr/local/xymon/server/bin$
list Jesse Johnson
OK, That makes more sense. The test does show the correct command now. Now on to finding the next piece of the puzzle. Thanks,
▸
----- Original Message -----
From: "J.C. Cleaver" <user-87556346d4af@xymon.invalid>
To: "Jesse Johnson" <user-95f49c60e910@xymon.invalid>
Cc: "xymon" <xymon at xymon.com>
Sent: Thursday, October 29, 2015 9:16:30 AM
Subject: Re: [Xymon] alert using global variable instead of command configured in xymonserver.cfg
On Thu, October 29, 2015 8:22 am, Jesse Johnson wrote:After upgrade to 4.3.21 the global mail variable is being used instead of the custom command configured inside of xymonserver.cfg from xymoneserver.cfg: # For the xymond_alert module MAIL="sendmail -f XYMON -s" # Command used to send an e-mail with a subject MAILC="sendmail -f XYMON " # Command used to send an e-mail with no subject from xymond_alert: xymon at zeus:/usr/local/xymon/server/bin$ ./xymond_alert --test 111-KMC454E conn
*snip*
00003362 2015-10-29 08:54:14 Mail alert with command '/var/mail/xymon "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-042ba090d3c9@xymon.invalid' xymon at zeus:/usr/local/xymon/server/bin$ After setting Global MAIL variable manually: xymon at zeus:/usr/local/xymon/server/bin$ MAIL="sendmail -f XYMON" xymon at zeus:/usr/local/xymon/server/bin$ ./xymond_alert --test 111-KMC454E conn
*snip*
00003489 2015-10-29 08:56:51 Mail alert with command 'sendmail -f XYMON "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" user-042ba090d3c9@xymon.invalid' xymon at zeus:/usr/local/xymon/server/bin$
Hi Jesse, Are you running xymond_alert in a shell that's already loaded the xymonserver.cfg environment? Typically xymond_alert (and xymond_anything) are run via xymonlaunch, which loads those configs into the environment before executing. Without it, it's simply looking in your shell's normal $MAIL variable (which on some systems is just the directory...) For testing like this, use: xymoncmd --env=(/path/to/)xymonserver.cfg ./xymond_alert --test 111-KMC454E conn If your xymonserver.cfg file is in a "standard" location, you may not need to specify the --env by hand. HTH, -jc