I'm trying to get notifications working - but I'm having some problems.
Here is the command I've set to run
echo WARNING on %dev_name% - %ip%. %test_name% returned %test_result%. | /bin/mail -s WARNING email@example.com
When I run that as user netmrg on the server that we're running netmrg on, it works fine and I get an email as expected, with no substitution.
However, when this command runs from witin NetMRG, I only get an email with subject "WARNING" and no content.
Do I need to do something with the pipe character? or is there something else I'm missing.
I would try putting quotes around your message and see if that helps. If not, running the gatherer from the command line (with -m or -a) which should help give you a better picture of what's going on.
It can be two things quotes as Balleman said or echo not being run. Try this
/bin/echo 'WARNING on %dev_name% - %ip%. %test_name% returned %test_result%.' | /bin/mail -s WARNING firstname.lastname@example.org
I had the same problem until I added the full path to echo as well
/bin/echo "WARNING on %dev_name% - %ip%. %event_name% returned %current_value%." | mail -s NetMRG_ALERT
worked ( put the email as the parameter )
echo "WARNING on %dev_name% - %ip%. %event_name% returned %current_value%." | mail -s NetMRG_ALERT
just sends an empty email
For tests and notifications, the gatherer will assume that the program it is trying to run is in the NetMRG libexec location unless the command starts with '/'.