check_tcp from monitored to ancillary device
Posted: Wed Apr 10, 2019 4:36 pm
I'm trying to setup this scenario...
NAGIOS Server (Version 3.2.3) on CENTOS 5.5
NSClient++ (Version 0.4.0.172) on Windows Server
create a service monitor that has the Windows Server report it's ability to connect to a third device.
I've done this...
On the NAGIOS Server
define command {
command_name check_remote_tcp
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c chk_remote_tcp -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
}
define service{
use generic-service ; Name of service template to use
host_name WINDOWS_SERVER
service_description remote_ping
normal_check_interval 5
retry_check_interval 5
notification_interval 15
check_command check_remote_tcp!REMOTE_DEVICE!80!100!1000
contact_groups testing
}
On the Windows Server in nsclient.ini I've added the following in the [/settings/external scripts/scripts] section
chk_remote_tcp=C:\PROGRA~2\NSCLIE~1\scripts\check_tcp.exe -H $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$
and acquired the check_tcp.exe executable and placed it in the scripts folder
when I run the check command manually on the NAGIOS Server like this
..../libexec/check_nrpe -H WINDOWS_SERVER -p 5666 -c chk_remote_tcp -a REMOTE_DEVICE 80 100 1000
I get the output
TCP OK - 0.085 second response time on port 80 |'time'=0.085077s
But in the NAGIOS Web interface I get this result
Current Status: CRITICAL (for 0d 3h 48m 38s) (Has been acknowledged)
Status Information: (Return code of 127 is out of bounds - plugin may be missing)
Performance Data:
Current Attempt: 3/3 (HARD state)
Last Check Time: 04-10-2019 14:26:15
Check Type: ACTIVE
Check Latency / Duration: 0.005 / 0.008 seconds
Next Scheduled Check: 04-10-2019 14:31:15
Last State Change: 04-10-2019 10:42:37
Last Notification: 04-10-2019 13:56:21 (notification 20)
Is This Service Flapping? NO (0.00% state change)
In Scheduled Downtime? NO
Last Update: 04-10-2019 14:31:11 ( 0d 0h 0m 4s ago)
I cannot figure out what I'm doing wrong??? any help would be appreciated.
thank you
NAGIOS Server (Version 3.2.3) on CENTOS 5.5
NSClient++ (Version 0.4.0.172) on Windows Server
create a service monitor that has the Windows Server report it's ability to connect to a third device.
I've done this...
On the NAGIOS Server
define command {
command_name check_remote_tcp
command_line check_nrpe -H $HOSTADDRESS$ -p 5666 -c chk_remote_tcp -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
}
define service{
use generic-service ; Name of service template to use
host_name WINDOWS_SERVER
service_description remote_ping
normal_check_interval 5
retry_check_interval 5
notification_interval 15
check_command check_remote_tcp!REMOTE_DEVICE!80!100!1000
contact_groups testing
}
On the Windows Server in nsclient.ini I've added the following in the [/settings/external scripts/scripts] section
chk_remote_tcp=C:\PROGRA~2\NSCLIE~1\scripts\check_tcp.exe -H $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$
and acquired the check_tcp.exe executable and placed it in the scripts folder
when I run the check command manually on the NAGIOS Server like this
..../libexec/check_nrpe -H WINDOWS_SERVER -p 5666 -c chk_remote_tcp -a REMOTE_DEVICE 80 100 1000
I get the output
TCP OK - 0.085 second response time on port 80 |'time'=0.085077s
But in the NAGIOS Web interface I get this result
Current Status: CRITICAL (for 0d 3h 48m 38s) (Has been acknowledged)
Status Information: (Return code of 127 is out of bounds - plugin may be missing)
Performance Data:
Current Attempt: 3/3 (HARD state)
Last Check Time: 04-10-2019 14:26:15
Check Type: ACTIVE
Check Latency / Duration: 0.005 / 0.008 seconds
Next Scheduled Check: 04-10-2019 14:31:15
Last State Change: 04-10-2019 10:42:37
Last Notification: 04-10-2019 13:56:21 (notification 20)
Is This Service Flapping? NO (0.00% state change)
In Scheduled Downtime? NO
Last Update: 04-10-2019 14:31:11 ( 0d 0h 0m 4s ago)
I cannot figure out what I'm doing wrong??? any help would be appreciated.
thank you