Email Notifications

Luis Fernando Lacayo lflacayo at cps.k12.il.us
Tue Nov 18 16:03:49 CET 2008


try this:
define command{
        command_name    host-notify-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios  *****\n
\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME
$!" $CONTACTEMAIL$



On Thu, 2008-11-13 at 11:12 +0000, 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

-- 
______________________________________________________

Luis Fernando Lacayo
Chicago Public Schools
Senior Unix Administrator
ITS/ UNIX Infrastructure
Office: 773-553-3835
Cell: 773-203-4493
lflacayo at cps.k12.il.us
______________________________________________________
               "In God we trust, the rest we monitor ..."


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20081118/7218afe4/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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=/
-------------- next part --------------
_______________________________________________
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