Email Notifications

Andreas Ericsson ae at op5.se
Thu Nov 13 13:28:24 CET 2008


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.
> 

Basically, your less-than-overenthusiastic welcome has more to do
with how you asked your questions than us. You're unfortunately at
a level far below that which I would expect from anyone trying to
compile and configure something like Nagios, so the remaining options
are either to hold your hand for several weeks while you stumble on
hurdles that noone else thinks of, because they're totally obvious
to people with a bit of know-how (not a fun scenario), or I can
direct you to some professional help, where you can ask as many
questions as you want without wasting anyones spare time.

> 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 }
> 

That's not what you posted earlier. This might work, assuming you've
configured eSMTP properly. I'm not familiar with eSMTP, so I can't
help you there.

> 
> Can i make modifications to these commands to use esmtp and not mailx
> or any suggestions to getting mailx working with eSMTP.

Yes you can. You'll have to browse the manuals for eSMTP to understand
how you can make that happen though (that's something the community
won't ever do for you).

> Also how can
> you force nagios to send email notifications for testing.
> 

Easy way; Configure a service that you know will fail. Disable state
retention and restart Nagios when you want to test again.

Hard way; Submit a passive check result for a service, flipping its
state so that you *should* get a notification each time. You'll have
to read the Nagios manual to figure out how the various notification
options, timeperiods and other configuration options work together to
send the actual notifications though.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
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