Xymon Mailing List Archive search

not receiving alerts

list Jeremy Laidman
Tue, 12 Nov 2013 14:47:51 +1100
Message-Id: <user-d0a0accf82bf@xymon.invalid>

On 12 November 2013 00:56, Kris Springer <user-c2caa0a7a8d5@xymon.invalid> wrote:
When I run that command as user xymon, it attempts then hangs.
root at ip:~# su xymon
Good.

xymon at ip:/home/ubuntu$ su xymon -c xymoncmd echo "mail test" | $MAIL
"Xyon [12345] VM-Firesall:proc CRITICAL (RED)" user-800263fcb636@xymon.invalid
No, this won't do the same thing as I said.  The "$MAIL" variable will be
expanded by the shell of the xymon user, which won't have run xymoncmd yet,
and so $MAIL probably will be defined as /var/mail/xymon - the path to the
xymon user's mailbox file, /var/mail/xymon (which doesn't exist because the
xymon user has never received mail).

(Also, you have already run "su xymon" so no need to do it a second time.)

Instead, you should run xymoncmd, and then at a command prompt (once $MAIL
is defined) run the subsequent command.  You could even do "echo $MAIL" in
the middle, to be sure, like so:

$ su xymon
$ echo $MAIL
/var/mail/xymon
$ xymoncmd
$ echo $MAIL
/usr/bin/mail
$ echo "mail test" | $MAIL "what ever you want here"
user-800263fcb636@xymon.invalid

Cheers
Jeremy