Today I set up a new XYMon monitor VM. The old one used PostFix, but I set up SSMTP.

I can e-mail myself fine from the CLI like such.

echo "Hello, World" | mail -s "My email check" my@email.com

But I can't seem to get XYMon to notify me via E-Mail.

I have done a few tests, I'm suspecting this is related to SSMTP more the XYMon as its fairly simple to set up.

/usr/lib/xymon/server/bin/xymond_alert --test testsite.com http

Results in this line : (Among many others, but this is the important one)

 Mail alert with command '/var/mail/root "Xymon [12345] testsite.com:http CRITICAL (RED)" accountusername@businessdomain.com'

There are a few things wrong with this, first there is no /var/mail/root that I can find, also, accountusername@businessdomain.com is the username I authenticate with and configure SSMTP with, but not the e-mail I actually want this notification sent to.

My SSMTP Configs :


My Alerts in XYMon :



# For the xymond_alert module
MAILC="mail"                            # Command used to send an e-mail with no subject
MAIL="$MAILC -s"                                # Command used to send an e-mail with a subject

root@monitor:/etc/xymon# echo $MAIL
  • Did you define the MAIL setting in xymonserver.cfg ? If not then it may default to the $MAIL environment variable, which could easily be /var/mail/root for the root user since that is the default mailbox for root's email. xymon.sourceforge.net/xymon/help/manpages/man5/… Jul 20 '16 at 20:52
  • Perhaps I need to export the variable? or change it system wide? Jul 20 '16 at 21:15
  • Just try unset MAIL... Jul 20 '16 at 21:16
  • That worked! - Should I Change question to be specific to XYMon? Or leave as is? You can write an answer and I'd accept Jul 21 '16 at 2:15

The problem you're having is in how XYmon determines what mailer to use. It can use the MAIL setting or it can use the $MAIL variable.

Now the default $MAIL setting for root is /var/mail/root and so it will try and execute that as if it was a command.

You can fix this by unsetting the environment variable

unset MAIL

This will ensure XYmon just uses its configuration and isn't overridden by the environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.