check_smtp send message

Marc Powell marc at ena.com
Fri Aug 19 00:31:29 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of David Gentry
> Sent: Thursday, August 18, 2005 4:55 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] check_smtp send message
> 
> Does anyone know if you can pass arguments to the check_smtp plugin,
>  and have it send a test email? I tried using the -C command, but
>  it doesnt work. I want to pass helo,mail from:(user),rcpt
to:(usr),data
>  (message),.

I was intrigued by this. Normally I would recommend using
check_email_loop.pl in the plugins contrib. folder but I thought I would
see if it could actually be done through check_smtp alone. This is what
I came up with that appears to work for my installation of sendmail --

./check_smtp -H my.mail.server -f marc at ena.com -C 'rcpt to:
marc at ena.com' -R 'Recipient ok' -C 'data' -R '354 Enter mail' -C '.' -R
'Message accepted for delivery'

SMTP OK - 0.210 sec. response time|time=0.210084s;;;0.000000

-C sends a command and -R looks for the response. The -R's are substring
searches so just a part of the expected response is ok.

The only drawback that I can see is that you can't actually send any
information for the data part of the transaction (your <message>
section). The plugin expects a response from the mail server for every
-C command whether you specify a -R to actually test it or not. When
sending the data part, there is no output from the mail server until you
send the '.'.

It's sooooo close but not quite there.

HTH,

Marc


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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