Hello all,

I’m having trouble with the check_smtp plugin. My mail server waits for 70 seconds before sending a reply to ehlo. This if for antispam purposes.

Now when I run the command manually it works:

[root@nagios objects]# /usr/lib/nagios/plugins/check_smtp -H mail -f nagios -t 90
SMTP OK - 70.414 sec. response time|time=70.414097s;;;0.000000

But when I use it in my services.cfg object file it doesn’t work. Here’s what I have:

define service{
       use                             basic-service
       name                            smtp-service
       notification_options            c,r,u,w
       check_command                   check_smtp! -t 90 -f nagios
       register                        0

define service{
       use                             smtp-service
       service_description             SMTP
       contact_groups                  admins
       host_name                       mail        

This fails every time, because it will only wait 60.5 seconds. It will not wait the full 90 seconds no matter what I try, any advice?


This can be configured in the main Nagios.cfg. Unfortunately this is only a global option that will effect all of your host and service checks. I’d advise against checking services that are known to take longer then 3 seconds to check, as a check command like this one will skew all of Nagio’s reports.

In your case what I would do is attach a ‘hook’ into one of the other checks for this host, something that Nagios will run at roughly the same period that you would want this test to run… else you could just you cron. This hook should daemonize(see an application called daemon) it’s self and then run your check, place the result into a passive service check sent to Nagios.


So how do you implement a passive service check?