alert using global variable instead of command configured in xymonserver.cfg
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 jesse.johnson at chl.cc REPEAT=480M RECOVERED' *** 00003362 2015-10-29 08:54:14 Mail alert with command '/var/mail/xymon "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" jesse.johnson at chl.cc' 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 peter.becker at chl.cc REPEAT=480M RECOVERED' *** 00003362 2015-10-29 08:54:14 Mail alert with command '/var/mail/xymon "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" peter.becker at chl.cc' 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 jesse.johnson at chl.cc REPEAT=480M RECOVERED' *** 00003489 2015-10-29 08:56:51 Mail alert with command 'sendmail -f XYMON "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" jesse.johnson at chl.cc' 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 peter.becker at chl.cc REPEAT=480M RECOVERED' *** 00003489 2015-10-29 08:56:51 Mail alert with command 'sendmail -f XYMON "Xymon [12345] 111-KMC454E:conn CRITICAL (RED)" peter.becker at chl.cc' xymon at zeus:/usr/local/xymon/server/bin$
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)" peter.becker at chl.cc' 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)" peter.becker at chl.cc' 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
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" <cleaver at terabithia.org> To: "Jesse Johnson" <jesse at techknowcs.com> 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)" peter.becker at chl.cc' 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)" peter.becker at chl.cc' 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
participants (2)
-
cleaver@terabithia.org
-
jesse@techknowcs.com