Checking remote servers & tunnels

Brian J. Dent bjd at compudentsystems.com
Sun Nov 20 22:52:30 CET 2005


Nagios Users,

 

I've been using NAGIOS for several years to monitor my client's networks and
Windows servers.  Many of these clients have IPSec tunnels to their remote
offices.  I've always been able to monitor the remote locations but never
the status of the tunnel.  Since my NAGIOS server is remote to their
location, it's like coming in from the outside and making a left turn to
check if the tunnel is up or down.  

 

Reading through some code snippets gave me this idea using the NRPE_NT
plug-in.  Obviously there are permutations but the basics work.

 

1) Duplicate the nrpe_nt_check_cmd in checkcommands.cfg and change the
suffix to _remote.

 

2) Add this line to your nrpe.cfg file:

command[nrpe_nt_check_remote]=c:\nrpe_nt\ping_remote.cmd 192.168.2.10 #
where 192.168.2.10 is the remote server

 

3) Create a ping_remote.cmd file in the nrpe_nt folder:

@ECHO OFF

PING -n 1 %1 | FIND "TTL=" > NUL

 

IF ERRORLEVEL 0 GOTO REMOTE_FOUND

PING -n 1 -w 3000 %1 | FIND "TTL=" > 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;

 

Regards,
bjd
 
~Brian J. Dent



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051120/2a4fbaed/attachment.html>


More information about the Users mailing list