simulate complete email
Olaf Hoyer
ohoyer at gaff.hhhr.ision.net
Mon Jul 28 16:41:02 CEST 2003
On Mon, 28 Jul 2003, Sam Stickland wrote:
> Can't you set up an email address on a machine, with /dev/null in the
> aliases file?
>
> ----- Original Message -----
> From: "J.M.Roth" <jmroth at iip.lu>
> To: <nagios-users at lists.sourceforge.net>
> Sent: Monday, July 28, 2003 12:41 AM
> Subject: [Nagios-users] simulate complete email
>
>
> > Hi there,
> > I'd like to simulate a complete email to a "devnull" address.
> > There doesn't seem to be a command to do it.
> > I just wanna make sure that although the smtp service might be up the
> > delivery could still fail after the DATA command, and in fact I'd like
> > to check its return value.
> > I was expecting to maybe use -e -s -e etc. in sequence with check_smtp
> > but it doesn't seem to be the case.
> > Any idea?
> > Greets,
> > -jm
Hi!
Well, I assume that you would like to:
a) Check for the string "Message accepted for delivery"
b) inject a message, and have a script run at the other end checking if
the message arrives, and when no message has arriven within a reasonable
time, then yell...
a) simply let your plugin connect, send your message after DATA, and
parse for Message accepted for delivery.
Mail adress should be bit-bucket at hosttocheck.domain, this is normally
forwarded in the aliases file to /dev/null
(Check your aliases file, there shall be such an account)
Or, if there are no local users defined at the Mailhub, simply let it
relay it to another host where such an account is specified
(virtusertable)
b) This is more tricky.
I did not have done it yet, I played with the following thoughts:
Two checks are needed:
Check1:
Inject message into MTA.
In the message body, write the timestamp of injection.
Parse for Message accepted for delivery.
Check2:
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.
This machine should run nsca for remote alarming, so that upon alarm an
alert is submitted to the nagios master host.
You don't need to run nagios on that host itself for distributed
monitoring, you simply trigger the send_nsca script via the above
check-script that is run via cron.
Just my 0.02 EUR
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