simulate complete email

Olaf Hoyer ohoyer at gaff.hhhr.ision.net
Mon Jul 28 18:05:21 CEST 2003


On 28 Jul 2003, Jason Martens wrote:

>
> > Let a script run periodically (perhaps via cron) on a remote machine.
> > remotemachine gets the email, and parses the message for the timestamp,
> > and validates against machine time.
> > When the delta is too big, give warning.
> > When within a certain time (say, 5 minutes) no email arrives at all,
> > give critical.
>
> You can use sendmail to run a script if an e-mail is sent to a certain
> user by putting the following in the alias file:
>
> username :| /path/to/script

Ahh well, forgot about that feature...

Will fit nicely, but I would not trigger some direct action via
sendmail.


>
> perhaps you could have the script submit the check result. So it would
> look like this:
> Nagios check_smtp sends an e-mail to mailcheck at hostname, the receiving
> host receives the e-mail and submits a success message to nagios, or
> perhaps to the check_smtp command somehow? If there is no response
> within the predetermined time (1min maybe) a critical response is
> logged. Does that make sense?


Yes, but how do you realize the critical event? You would still need
some eventhandler to do this, that runs regularly.

I suggest the following approach:

Mail is sent via whether plugin from within nagios, or from a cronjob on
the nagios box whatsoever. Just make sure that we expect an email to be
delivered.

sendmail gets the mail, and upon arrival the script writes a value
(perhaps the body of the mail with a timestamp) in a
simple plain text file.

a cron job triggers a script any minute or so, that has a look at this
file. If the timestamp within this file is ok and is max. 1min away from
the system time, submit an OK result to the nagios master, when any
other condition hits, submit a critical.

Conditions might be:

No file present (perhaps no mail injected due to failure of injection),
or SMTP down, or value in file too old because of delayed delivery.

Olaf

-- 
Olaf Hoyer        ohoyer at gaff.hhhr.ision.net
Fuerchterliche Erlebniss geben zu raten,
ob der, welcher sie erlebt, nicht etwas Fuerchterliches ist.
(Nietzsche, Jenseits von Gut und Boese)




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
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