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

Problem with ICMP plugin

Post by reincarne »

Hi everyone,
I assume that the ICMP plugin is a built in plugin and I might get help here.
My problem is that I'm using to check a connection from once server to another via specific port, but when the VPN is down and the connection is lost, the plugin throws an error "Service check timeout" or "Socket timeout" (don't remember exactly) instead of something logical. I cannot edit this plugin as its a binary plugin.

Did someone face such problem?
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Problem with ICMP plugin

Post by questrad »

Can you please be more clear.
As I understand, you using check_icmp plugin to check connection from server (same network where is Nagios) where check_icmp is executed to another server (located on your endpoint VPN side) and when VPN is goes down you get error, such "Service check timeout" or "Socket timeout"?
Or the server where you executing check_icmp is located some where else and your nagios server has connectivity to that server via your VPN connection?

Looking on your error messages, looks like you server where you executing check_icmp is located outside of your Nagios server network, you connecting to that server via VPN - so the behavior of Nagios is correct, because it has lost NRPE (if you use NRPE) cannot connect to remote server to execute check_icmp.

If you want to check your VPN connection, I think you need to executed PING to the server where is located under that VPN, so the Nagios check_icmp will return correct information, such:

Code: Select all

[root@localhost scripts]# /usr/local/nagios/libexec/check_icmp -H example2.com
CRITICAL - example2.com: rta nan, lost 100%|rta=0.000ms;200.000;500.000;0; pl=100%;40;80;; rtmax=0.000ms;;;; rtmin=0.000ms;;;;
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Re: Problem with ICMP plugin

Post by reincarne »

You are correct about everything you mentioned, so nothing to correct from my side.

I didn't know that check_icmp can be used for simple ping - I was sure you must provide Port.
What will be the difference in this case? It will lose the connection tothe nrpe too.
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Re: Problem with ICMP plugin

Post by reincarne »

Ohh, I completely posted the incorrect plugin name.
The plugin that I'm using is check_tcp
This check cannot ping without a port number as long as I know.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with ICMP plugin

Post by jdalrymple »

It's difficult to tell what you're actually trying to do. If you're trying to check a generic TCP service on a remote host wouldn't it be desirable to get the results you're getting when your VPN connection is unavailable? If you're seeking to make the check only active while the VPN connection is alive I suggest using a service dependancy combined with check_icmp.

http://nagios.sourceforge.net/docs/3_0/ ... ncies.html

If I didn't describe the exact results you are trying to achieve could you please clarify for us?
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Problem with ICMP plugin

Post by questrad »

reincarne wrote:You are correct about everything you mentioned, so nothing to correct from my side.

I didn't know that check_icmp can be used for simple ping - I was sure you must provide Port.
What will be the difference in this case? It will lose the connection tothe nrpe too.

Yes, if VPN is donw it will lost NRPE connectivity as well.

You network diagram is following:
Nagios <-> VPN <-> OtherServer (check_tcp) -> OtherServer1 ?

The question is what you want to check?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Problem with ICMP plugin

Post by lmiltchev »

reincarne, did jdalrymple and questrad answer your question?
Be sure to check out our Knowledgebase for helpful articles and solutions!
reincarne
Posts: 146
Joined: Wed Jun 26, 2013 4:39 am

Re: Problem with ICMP plugin

Post by reincarne »

questrad wrote:
reincarne wrote:You are correct about everything you mentioned, so nothing to correct from my side.

I didn't know that check_icmp can be used for simple ping - I was sure you must provide Port.
What will be the difference in this case? It will lose the connection tothe nrpe too.

Yes, if VPN is donw it will lost NRPE connectivity as well.

You network diagram is following:
Nagios <-> VPN <-> OtherServer (check_tcp) -> OtherServer1 ?

The question is what you want to check?
Well, I want to check if the VPN tunnel is up by simply checking the connection from host 1 in region 1 to host 2 in region 2.
I assume the best way would be a simple ping check here, from host 1 to host 2, but I didn't find such plugin.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Problem with ICMP plugin

Post by questrad »

Where is the Nagios located?
In region 1 or 2 or outside?

Please describe your network.
You can use check_icmp plugin as well, but at first you need to understood how Nagios is working.
If you executing icmp plugin using NCPA or NRPE agents on host 1 in region 1 to check host 2 in region 2 and Nagios server is outside and connected to host 1 via VPN - if VPN is down you will get timeout.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Problem with ICMP plugin

Post by jdalrymple »

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.
Locked