Email Notifications
Richard Savage
richard at newnet.co.uk
Thu Nov 13 12:19:35 CET 2008
Yes
Just change the email commands so they look something like this:
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotificatio$... | /usr/bin/esmtp - C ~/esmtprc me at outsideemailaddress - f me at internalemailaddress -s "** $NOTIFICATIONTYPE$ Host...
All this command is doing is printing out the relevant data and pipeing it to the esmtp program. I have left the -s in at the end, but not sure if esmtp uses this as an option. use man esmtp to look at the manual.
The way i tested notofications, was to take a host you are monitring and add a temporay firewall rule on that box. Nagios will then see it as down and should send a notification.
Hope this helps
Rich
kellyjackie at eircom.net wrote:
>
> I am dissapointed with the way in which my questions have been recieved here. It seems like only experts are welcome. How is anybody supposed to learn. There was once a day when you all were beginning too.I have heard so much about the linux community but im not experiencing that at all.
>
> So after almost unsubscribing from this mailing list Im going to give it another chance.
> Heres my question:
>
> I have set up Nagios 3 monitoring some machines and their services. I am now trying to set up email notifications.
> I have installed the following on the linux box:
> eSMTP- run
> procmail
> I can send emails with the following line:
> echo "test" | /usr/bin/esmtp - C ~/esmtprc me at outsideemailaddress - f me at internalemailaddress
> This sends me an email from our mail server. However when i try:
> mailx -s tacos myemail at email.com
> this just hangs.
>
> The commands.cfg files contains:
> # 'notify-host-by-email' command definition
> define command{
> command_name notify-host-by-email
> command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotificatio$... | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host...
> }
>
> # 'notify-service-by-email' command definition
> define command{
> command_name notify-service-by-email
> command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotificatio$... | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host
> }
>
>
> Can i make modifications to these commands to use esmtp and not mailx or any suggestions to getting mailx working with eSMTP.
> Also how can you force nagios to send email notifications for testing.
>
> Thanks for any advice
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list