Monitoring network connectivity from host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kiddbios
Posts: 54
Joined: Wed Feb 01, 2012 12:57 pm

Monitoring network connectivity from host

Post by kiddbios »

Hello,

Is there a way to monitor network connectivity from a host to a particular address? For instance, we have customers that utilize IPSEC tunnels between their locations. When these tunnels go down we don't currently have any way of knowing other the customer contacting us.

Best regards,

Brad
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring network connectivity from host

Post by scottwilkerson »

check_ping comes to mind.

Are the host's running NRPE or NSClient++?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kiddbios
Posts: 54
Joined: Wed Feb 01, 2012 12:57 pm

Re: Monitoring network connectivity from host

Post by kiddbios »

NSClient++
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring network connectivity from host

Post by scottwilkerson »

A quick search found this, which should do the trick
http://exchange.nagios.org/directory/Pl ... 29/details
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kiddbios
Posts: 54
Joined: Wed Feb 01, 2012 12:57 pm

Re: Monitoring network connectivity from host

Post by kiddbios »

Scott,

Thank you very much for the information. I finally had some time to attempt to implement this. The only issue is that there is no checkcommands.cfg on the Nagios XI box and no nrpe.cfg file on the Windows box. Should I be using the check_nt command instead? Do I need to manually create the files it is referencing?

Thanks,

Brad
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring network connectivity from host

Post by scottwilkerson »

You are right the directions are a little wonky.

You would need to make the file ping_remote.cmd from the file attached.

Then you would have to add it to the NSC.ini file on the windows machine.

Additionally, you would need to enable NRPE in the nsc.ini
http://library.nagios.com/library/produ ... h-nsclient
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kiddbios
Posts: 54
Joined: Wed Feb 01, 2012 12:57 pm

Re: Monitoring network connectivity from host

Post by kiddbios »

I found this site: http://www.renzokuken.org/post/42312127 ... te-windows, which explains how to setup what I'm trying to accomplish in non-XI Nagios. For Nagios XI, the gist of it is that you need to enable NRPE when you install NSClient++ (or uncomment it later) and then configure the [NRPE] section of your nsc.ini file on your Windows box to accept WMI and NRPE connections. At the bottom of this post is what my [NRPE] section looks like. You need to be sure to have WMI enabled on your Windows host (this is enabled in the Add/Remove programs - Add/Remove Windows components on Windows 2003 and should be enabled by default on 2008). From there you need to go into the Nagios XI core config manager, click on commands and add a new command. Name the command in the "command*" section (it can be anything you like). In the command line type:

$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckWMIValue -a 'Query=SELECT StatusCode FROM Win32_PingStatus WHERE Address="$ARG1$"' MaxCrit=1 Check:Status:=StatusCode

***note*** Sometimes copying and pasting into the command line will cause characters like " and ' to be turned into ? or other characters. If your command is failing, please double check that it is exactly as above.

For the command type select "check command" from the drop down. Mark it as active by clicking in the box and then select Save. Apply the configuration changes.

From here, in the CCM, create a new service by going to Services on the left hand side. In the Hosts section, select the host you want to monitor from. In the $ARG1$ field, enter the IP address you want to monitor. Setup your alert settings, mark the service as active, save and apply your configuration. If everything is properly configured you will now be notified when your host loses connectivity to the IP address you specified in $ARG1$. This is especially useful for monitoring connectivity between sites linked together via VPN tunnels.





[NRPE]
;# NRPE PORT NUMBER
; This is the port the NRPEListener.dll will listen to.
;port=5666
;
;# COMMAND TIMEOUT
; This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off.
;command_timeout=60
;
;# COMMAND ARGUMENT PROCESSING
; This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed.
allow_arguments=1
;
;# COMMAND ALLOW NASTY META CHARS
; This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'"\[]{}) characters in ;arguments.
allow_nasty_meta_chars=1
;
;# USE SSL SOCKET
; This option controls if SSL should be used on the socket.
;use_ssl=1
;
;# BIND TO ADDRESS
; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname.
; Leaving this blank will bind to all avalible IP adresses.
; bind_to_address=
;
;# ALLOWED HOST ADDRESSES
; This is a comma-delimited list of IP address of hosts that are allowed to talk to NRPE deamon.
; If you leave this blank the global version will be used instead.
;allowed_hosts=
;
;# SCRIPT DIRECTORY
; All files in this directory will become check commands.
; *WARNING* This is undoubtedly dangerous so use with care!
;script_dir=scripts\
;
;# SOCKET TIMEOUT
; Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out.
;socket_timeout=30
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring network connectivity from host

Post by scottwilkerson »

This look like another way to do it. Either will require NRPE to be enabled because check_nt cannot execute additional scripts.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Monitoring network connectivity from host

Post by yancy »

The linux NRPE equivalent of the above windows script would be check_ping.

You first need to install NRPE and plugins on the host machine, described here:
http://library.nagios.com/library/produ ... inux-agent

then add your check_ping command to nrpe.cfg on the client.
Locked