I am trying to set up a new check in Nagios 3.5.0, making sure that my mail server is contactable on port 25 over the internet.
I am using the check_smtp command. When I run this command from the command line I get this:
[root@cwp-nagios-03 libexec]# ./check_smtp -H mail.****.com
SMTP OK - 0.068 sec. response time|time=0.068033s;;;0.000000
This looks like everything working correctly, so I added a new service definition:
define service{
use generic-service
host_name CL_WEB_CHECKS_DR
service_description Mail Server
check_command check_smtp!mail.***.com
}
When this command is run by Nagios, I get the following result instead:
Status Information: Connection refused
SMTP CRITICAL - 0.001 sec. response time
Performance Data: time=0.001362s;;;0.000000
I am a bit lost as to why this is happening, so any help would be great!
Also, I am sure you will want to see it, so here is the command definition for check_smtp:
# 'check_smtp' command definition
define command{
command_name check_smtp
command_line $USER1$/check_smtp -H $HOSTADDRESS$
}
You have a mismatch between your command definition and your service definition.
To resolve, do either of the following. Not both.
$HOSTADDRESS$
to$ARG1$
.host_address
for your host.