Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_remote (ping_remote)
105340
File | Description |
---|---|
ping_remote.cmd.txt | ping_remote.cmd file |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
You may wish to monitor the status of a tunnel via NRPE_NT's cmd facility when your NAGIOS server is also remote from the server.
Steps to implement this in NAGIOS:
1) Duplicate the nrpe_nt_check_cmd in checkcommands.cfg and change the syntax to nrpe_nt_check_remote.
2) Add this line to your nrpe.cfg file on your Windows server:
commandnrpe_nt_check_remote=c:nrpe_ntping_remote.cmd 192.168.2.1 # where 192.168.2.1 is the gateway to the remote LAN.
3) Create a ping_remote.cmd file in the nrpe_nt folder:
@ECHO OFF
PING -n 1 %1 > NUL
IF NOT ERRORLEVEL 1 GOTO REMOTE_FOUND
PING -n 1 -w 3000 %1 > NUL
IF ERRORLEVEL 1 GOTO REMOTE_DOWN
ECHO REMOTE CONNECTION TO %1 IS SLOW
EXIT 1
:REMOTE_DOWN
ECHO REMOTE CONNECTION TO %1 IS DOWN
EXIT 2
:REMOTE_FOUND
ECHO REMOTE CONNECTION TO %1 IS UP
EXIT 0
REM OK = 0;
REM WARNING = 1;
REM CRITICAL = 2;
REM UNKNOWN = 3;
Steps to implement this in NAGIOS:
1) Duplicate the nrpe_nt_check_cmd in checkcommands.cfg and change the syntax to nrpe_nt_check_remote.
2) Add this line to your nrpe.cfg file on your Windows server:
commandnrpe_nt_check_remote=c:nrpe_ntping_remote.cmd 192.168.2.1 # where 192.168.2.1 is the gateway to the remote LAN.
3) Create a ping_remote.cmd file in the nrpe_nt folder:
@ECHO OFF
PING -n 1 %1 > NUL
IF NOT ERRORLEVEL 1 GOTO REMOTE_FOUND
PING -n 1 -w 3000 %1 > NUL
IF ERRORLEVEL 1 GOTO REMOTE_DOWN
ECHO REMOTE CONNECTION TO %1 IS SLOW
EXIT 1
:REMOTE_DOWN
ECHO REMOTE CONNECTION TO %1 IS DOWN
EXIT 2
:REMOTE_FOUND
ECHO REMOTE CONNECTION TO %1 IS UP
EXIT 0
REM OK = 0;
REM WARNING = 1;
REM CRITICAL = 2;
REM UNKNOWN = 3;
Reviews (0)
Be the first to review this listing!