Page 1 of 1

check_pop on nagios monitor server and NRPE host

Posted: Wed Jun 12, 2019 2:57 pm
by gmills
Hello, I'm new to Nagios, however, I've been able to get much much accomplished. I have been stumped on the monitoring of POP3S mail server using Nagios Core 4.3.2.
On Nagios Monitor Server ---
commands.cfg
# 'check_pop' command definition
define command{
command_name check_pop
command_line $USER1$/check_pop -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$ -d $ARG4$ -t $ARG5$ -S
}

localhost.cfg
define service{
use local-service ; Name of service template to use
host_name localhost
service_description POP3s
check_command check_pop!3.159.212.217!995!15!30!10!60!
notifications_enabled 0
}
services.cfg
define service{
use generic-service
host_name alphprdfuse1i
service_description POP3s
check_command check_nrpe!check_pop
}

ON NRPE Server
nrpe.cfg
command[check_pop]=/usr/local/nagios/libexec/check_pop -H 3.159.212.217 -p 995 -w 5 -c 10 -d 10 -t 15 -S


ERRORS
on NRPE server
CHECK_NRPE STATE CRITICAL: Socket timeout after 10 seconds.
on Nagios local system monitor
check_pop: Port must be a positive integer

I'm thinking on the NRPE server it is using the server address instead of the exchange server address. And on the Nagios host monitor server it is my command definition check_pop!3.159.212.217!995!15!30!10!60!

HOWEVER,
ON BOTH SERVERS WHEN I EXECUTE THIS STATEMENT IT WORKS
/usr/local/nagios/libexec/check_pop -H 3.159.212.217 -p 995 -w 15 -c 30 -d 10 -t 60 -S

POP OK - 0.082 second response time on 3.159.212.217 port 995 [+OK The Microsoft Exchange POP3 service is ready.]|time=0.081917s;15.000000;30.000000;0.000000;60.000000

WHAT am I doing wrong and do not understand? thank you so much!

I have tried this on the NRPE server
./check_nrpe -H localhost -c check_pop -H 3.159.212.217 -p 995 -w 15 -c 30 -d 10 -t 60 -S

returned this... so does this mean I have to have an nagios nrpe daemon running the exchange server?
if yes, how can I get around this?

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here. Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin. This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.

Re: check_pop on nagios monitor server and NRPE host

Posted: Wed Jun 12, 2019 5:00 pm
by scottwilkerson
Lets start with the NRPE connection
the command you would run is

Code: Select all

./check_nrpe -H IP_OF_NRPE_SERVER -c check_pop
For the local XI server you have the command defined as this, but you are putting the IP address in $ARG1$

Code: Select all

define command{
command_name check_pop
command_line $USER1$/check_pop -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$ -d $ARG4$ -t $ARG5$ -S
}
If you are going to do that, you need to change the command to the following

Code: Select all

define command{
command_name check_pop
command_line $USER1$/check_pop -H $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$ -d $ARG5$ -t $ARG6$ -S
}
and then restart nagios

Re: check_pop on nagios monitor server and NRPE host

Posted: Thu Jun 13, 2019 8:57 am
by gmills
this works and thank you very much! I get it now, thanks!!!

I also, just created a hosts.cfg definition for the POP3 server.

have a great day! 8-)

Re: check_pop on nagios monitor server and NRPE host

Posted: Thu Jun 13, 2019 11:56 am
by scottwilkerson
gmills wrote:this works and thank you very much! I get it now, thanks!!!

I also, just created a hosts.cfg definition for the POP3 server.

have a great day! 8-)
Great!

Locking thread