nagios postfix

Niels Dettenbach nd at syndicat.com
Fri Mar 30 03:27:16 PDT 2012


Am Freitag, 30. März 2012, 08:08:10 schrieben Sie:
> As you say, cranking up large structures like postfix, procmail, etc
> just to basically send a few emails is not desirable if one can help
> it. msmtp is a splendid program (available on Mac Ports I found too)
> which is more than adequate for my needs at present.

...just in addition:

I've checked some msmtp docs 
http://msmtp.sourceforge.net/
and it will (!) fullfill your nagios regquirements (similiar to ssmtp i've worked often with too).

Nagios' Email stuff could be fitted typically in commands.cfg as i.e.:


# 'notify-host-by-email' command definition (example)
define command{
        command_name    notify-host-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 "$
        }

where "/bin/mail" should be substituted by the similiar msmtp command. 

Take a note about the "-s" switch - afair there is no such switch for defining a "Subject:" by option on msmtp - it might expect such things as part of your message "file" / pipe output generated by printf in this example)


You may do something like (not tested):

printf "%b" "Subject: This is my testsubject\n \n and this the message body\n" | /usr/bin/msmtp your_email at your_domain

As you can see it is fully on your's what type of commands and things you want to do with nagios - email is just one of many options - nagios rocks! ~ß)


hth a little...
cheers,


Niels.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120330/628e24fa/attachment.bin>


More information about the macports-users mailing list