Problem with ICMP plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Re: Problem with ICMP plugin

Post by reincarne »

Replying with a delay - but indeed the reason was that I lose connection to the nrpe on the other side.
The pathetic thing is that I didn't find a normal ping plugin which is able to simple ping from one host to another to check connectivity.
The built-in ping plugin check ping locally to see if the machine is up.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with ICMP plugin

Post by jdalrymple »

I'm still confused. That is exactly what check_ping and check_icmp do:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_ping -h
check_ping v2.0.3 (nagios-plugins 2.0.3)
Copyright (c) 1999 Ethan Galstad <[email protected]>
Copyright (c) 2000-2014 Nagios Plugin Development Team
        <[email protected]>

Use ping to check connection statistics for a remote host.
In this context "remote host" simply means NOT localhost, although it can certainly check that too:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_ping -H 127.0.0.1 -w 100,10% -c 150,20%
PING OK - Packet loss = 0%, RTA = 0.04 ms|rta=0.037000ms;100.000000;150.000000;0.000000 pl=0%;10;20;0
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Problem with ICMP plugin

Post by questrad »

@reincarne

Can you please show as your host network diagram.
It looks like you don't get the clear picture how the Nagios is working.

You have:
Nagios server - NS
Server 1 - S1
Server 2 - S2

What you want to check?
You want check connectivity from S1 to S2 with executing from NS server using nrpe the check_icmp (ping) plugin on S1?

If so - then in case you lost connectivity from NS to S1, but S1 can connect to S2 - you will be notified that S2 is not accessible, which is already not true.

You need to get out what you exactly want to do and trying to implement it in correct way with understanding how Nagios is working.

Your Nagios server must be placed in network relation so that he can access to all server.
And if any connection, VPN, are down he needs to notify you about VPN connection issue alert, not server is down alert, because in your case if VPN down does not mean server is down.
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Problem with ICMP plugin

Post by cmerchant »

OP, Can you give us an update to questrad's question. Thanks.
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Re: Problem with ICMP plugin

Post by reincarne »

jdalrymple wrote:I'm still a bit confused reincarne - as questrad indicated check_icmp should do what you would expect:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_icmp -H 192.168.254.1
CRITICAL - 192.168.254.1: rta nan, lost 100%|rta=0.000ms;200.000;500.000;0; pl=100%;40;80;; rtmax=0.000ms;;;; rtmin=0.000ms;;;;
Can you post the output of something similar to a network you know you cannot reach (purposefully make it fail) so we can make sure that your check results are consistent with ours? It sounds like that may be the problem.
When there is a response issue, this is the output:
[04-09-2015 22:23:39] SERVICE ALERT: HOST;check_VPN_to_SVN;CRITICAL;SOFT;1;TCP CRITICAL - 2.355 second response time on port 8080

When the VPN is down:
[03-17-2015 09:54:07] SERVICE ALERT: HOST;check_VPN_to_SVN;CRITICAL;HARD;2;CRITICAL - Socket timeout after 10 seconds
[03-17-2015 09:42:43] SERVICE ALERT: HOST;check_VPN_to_SVN;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds

When VPN is up:
Status Information: TCP OK - 0.159 second response time on port 3690

The service check goes like this:
nrpe_check_tcp!HOSTNAME!PORT!05!2

And thats the command:
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_tcp -a $ARG1$ $ARG2$ $ARG3$ $ARG4$

Nagios is located in Site 1, the SVN on site 2 - I check the connectivity from Site 1 to Site 2.
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Re: Problem with ICMP plugin

Post by reincarne »

P.S:
Nagios Server and SV1 are located on the same site. SV2 (SVN) is located on site 2.
So yes, I execute the plugin located on SV1 from Nagios which should check connectivity to SV2.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Problem with ICMP plugin

Post by jolson »

It doesn't look like you're using check_icmp - it looks like you're using check_tcp.
$USER1$/check_nrpe -t 60 -H $HOSTADDRESS$ -c check_tcp -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
This is not checking for a VPN, but rather for an open TCP port - the error "Socket timeout after 10 seconds" makes perfect sense in this case.

You may want to use something more suitable for checking VPN connectivity - I found some example plugins on the exchange:
http://exchange.nagios.org/directory/Pl ... pn/details
http://exchange.nagios.org/directory/Pl ... N-Software

Does any of the above work for you? I'm afraid that check_tcp may not do what you want it to.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked