Re: Email notifications
Stanley Hopcroft <[email protected]> Fri, 27 Dec 2002 12:46:49 +1100
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Sir, I am writing to thank you for your letter and say, On Thu, Dec 26, 2002 at 11:47:59AM -0500, [email protected] wrote: > Hello all, > After checking the log files of my Netsaint I found several messages that > concerned me. The following errors are of concern: > > [1040911666] Warning: Attempting to execute the command "/bin/echo -e > '***** NetSaint 0.0.6 *****\n\nNotification Type: PROBLEM\n\nService: > ping\nHost: 90905-100228\nAddress: 148.70.80.0\nState: > CRITICAL\n\nDate/Time: Thu Dec 26 09:07:46 EST 2002\n\nAdditional > Info:\n\nCRITICAL - Plugin timed out after 15 seconds' | -s '** PROBLEM > alert - 90905-100228/ping is CRITICAL **' [email protected]" that it looks as if the 'notify-by-email' command is missing the path of the program that delivers mail (between the pipe symbol and '-s'). Here is mine command[notify-by-email]=/usr/bin/printf '%s\n%s\n%s\n%s\n%s' '***** NetSaint 0.0.7 ***** $SERVICESTATE$ alert/notification' 'Date/Time: $DATETIME$', 'Service: $SERVICEDESC $' 'Host: $HOSTNAME$ Address: $HOSTADDRESS$', 'Additional Info: $OUTPUT$' | /usr/bin/mail -s '** $NOTIFICATIONTYPE$ alert - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **' $ CONTACTEMAIL$ In this case my MUA is /usr/bin/mail. Check your hosts.cfg. If it has a MUA (/usr/bin/mail /usr/bin/mailx) in the 'notify-by-email' command, then is the path correct ? Is there actually a mail program in that location ? You may have to look at the sample hosts.cfg that comes with Netsaint. These should have correct notify commands that you shouldn't need to touch. (BTW, why are you using 0.0.6 ? 0.0.7 is the latest - and Mr Galstads code only improves - of the end of the Netsaint line. Nagios is where all the action is. 0.0.7 replaces /bin/echo by /usr/bin/printf. This shouldn't matter to much as long as your echo actually works. Try this from the CLI echo -e 'blah' Do you actually see blah ? If so, all you have to do is work out where your mail program is located (which mail, whereis mail, find /usr -name 'mail' etc). ) > resulted > in a return code of 127. Make sure the script or binary you are trying to > execute actually exists... > > Warning: Attempting to execute the command "/bin/echo -e '***** NetSaint > 0.0.6 *****\n\nNotification Type: RECOVERY\n\nService: ping\nHost: > 90905-100228\nAddress: 148.70.80.0\nState: OK\n\nDate/Time: Thu Dec 26 > 09:12:36 EST 2002\n\nAdditional Info:\n\nPING OK - Packet loss = 0%, RTA = > 881.95 ms' | -s '** RECOVERY alert - 90905-100228/ping is OK **' > [email protected]" resulted in a return code of 127. Make sure the > script or binary you are trying to execute actually exists... > > Can anyone help me with this. I have had Netsaint running for several > weeks and have never figured out how to actually get the email > notifications to work. Does anyone have suggestions? > > Any help would be greatly appreciated. > HTH, > Mike Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf