Page 1 of 1

pnp4nagios offline status not work

Posted: Thu Sep 05, 2013 2:03 pm
by byrollo
Hi to all, I'm going crazy to configure pnp4nagio (last version) under CentOS.
Even if Nagio working fine and register all Ping Packets Lost, pnp4nagio show in the graphics timeline always Uptime status
This is the Nagio Right status
Right Host Status - Nagios
Right Host Status - Nagios
This is the pnp4nagios Wrong status
Wrong Host Status - Pnp4nagios
Wrong Host Status - Pnp4nagios
As you can see in the second img, there are no critical status nor discontinued interval in the offline host status time
these are my configuration:

/usr/local/nagios/etc/nagios.cfg

Code: Select all

	
process_performance_data=1

service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
/usr/local/nagios/etc/objects

Code: Select all

define host {
	   name       host-pnp
	   action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
	   register   0
}

define command{
	   command_name    process-host-perfdata-file
	   command_line    /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/host-perfdata
}

define host{
	use		generic-server
	host_name	clientt1
	alias		clientt1
	address		x.y.z.k
	}

define host{
	name			generic-host
	use			host-pnp
	notifications_enabled	1
	event_handler_enabled	1
	flap_detection_enabled	1
	failure_prediction_enabled	1
	process_perf_data		1
	retain_status_information	1
	retain_nonstatus_information	1
	notification_period		24x7
	register			0
	}

define host{
	name			generic-server
	use			generic-host
	check_period		24x7
	check_interval		5
	retry_interval		1
	max_check_attempts		10
	check_command		check-host-alive
	notification_period		24x7
	notification_interval		30
	notification_options		d,u,r
	register			0
	}
define command{
	command_name	check-host-alive
	command_line	$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
	}
Please help me to track downtime in the chart, thanks in advance.

Re: pnp4nagios offline status not work

Posted: Fri Sep 06, 2013 1:42 pm
by abrist
Can I see the actual check config for the host (ping, keep-alive, etc)?

There is a good chance that the host ping check is checking a different box.

Re: pnp4nagios offline status not work

Posted: Mon Sep 09, 2013 6:50 am
by byrollo
abrist wrote:Can I see the actual check config for the host (ping, keep-alive, etc)?

There is a good chance that the host ping check is checking a different box.
Hi, thansks for you support. I have edit the main topic information and add additional configuration code.
I'm not nagios expert, please tell me if new input can help you to support my troubleshooting or where get additional info.
Thanks alot!

Re: pnp4nagios offline status not work

Posted: Mon Sep 09, 2013 11:07 am
by slansing
It looks like you have no check_command defined for your host "clientt1" I would base it off of the generic-server host you have defined and add the additional configuration options such as check periods, intervals, attempts, etc as they are all required. I also hope that that the above you showed is not all in one file as you need to have your commands in the commands.cfg file, your hosts in hosts.cfg or their own host config file, etc. Have you tried to run a config verification against your configurations?

Re: pnp4nagios offline status not work

Posted: Mon Sep 09, 2013 1:27 pm
by byrollo
slansing wrote:It looks like you have no check_command defined for your host "clientt1" I would base it off of the generic-server host you have defined and add the additional configuration options such as check periods, intervals, attempts, etc as they are all required. I also hope that that the above you showed is not all in one file as you need to have your commands in the commands.cfg file, your hosts in hosts.cfg or their own host config file, etc. Have you tried to run a config verification against your configurations?
i missing to mention that nagios work fine as you can see in the picture above, host clientt1 status, refer real phisical host status.
The only issues was pnp4nagios that don't show host "down" status in the timeline.
All configuration file was stored in different file according to you suggestion.
can you help me?

Re: pnp4nagios offline status not work

Posted: Mon Sep 09, 2013 2:39 pm
by abrist
If the ping times are showing up, but the host is reported as down, then it must be one of a few different things:

1. The host check ip is wrong and the check is checking a different box.
2. The ping check is wrong and it is checking a different box.
3. The host check is checking something other than ping, like http etc.

Re: pnp4nagios offline status not work

Posted: Tue Sep 10, 2013 2:15 am
by byrollo
abrist wrote:If the ping times are showing up, but the host is reported as down, then it must be one of a few different things:

1. The host check ip is wrong and the check is checking a different box.
2. The ping check is wrong and it is checking a different box.
3. The host check is checking something other than ping, like http etc.
As you can see in the code line, "host command" is check-host-alive that and it work fine in Nagios.
I suspect the the wrong configuration is pnp4nagios, but i'm not able to correct.
pnp4nagios use "action_url" /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ defined in host-pnp statement, to open graphics chart, but it only show uptime status, and nothing else. (see difference in the two above pictures).
I'd like that pnp4nagios show UP status ad also DOWN, as Nagios do (see first picture).
Thanks!

Re: pnp4nagios offline status not work

Posted: Tue Sep 10, 2013 10:58 am
by abrist
There should be a gap in the host alive graph as it is just an icmp ping check, if the host was unreachable (down), you would see a gap in the graph. pnp4nagios will not show "IP" or "DOWN", but will instead display the performance data for a check, and in this case, it is an icmp ping.

I do want to point out that your server was down until about 16:50, at which time the ping graph has a gap as well. Have you tried altering the timeframe for the pnp4nagios graph to verify if the gaps in perf data correspond to the uptime graph?

Re: pnp4nagios offline status not work

Posted: Thu Jan 02, 2014 12:01 pm
by sw1
I had this same problem.

In the end I discovered it is because the check_ping plugin does not give useful output if the host is down. It does this:

Code: Select all

[sw@nagios01 plugins]$ ./check_ping -H notos $ -w 1000.0,60% -c 4000.0,100% -p 5
CRITICAL - Host Unreachable (notos)
I assume as there are no useful statistics, there is nothing for pnp4nagios to store, so stores nothing. When the host comes back up again, the statistics are again printed (like below), and are stored. When the graph is rendered, it joins up the two most recently stored samples, and because there are no 'down' samples in-between, it looks like it has never gone down! It breaks the Packets Lost graph too.

Code: Select all

[sw@nagios01 plugins]$ ./check_ping -H notos $ -w 1000.0,60% -c 4000.0,100% -p 5
PING OK - Packet loss = 0%, RTA = 0.35 ms|rta=0.351000ms;1000.000000;4000.000000;0.000000 pl=0%;60;100;0

The check_icmp plugin seems to have no such problem. So to get round the problem, I changed my Nagios config from this:

Code: Select all

define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 1000.0,60% -c 4000.0,100% -p 5
        }
to this:

Code: Select all

define command{
        command_name    check-host-alive
        command_line    $USER1$/check_icmp $HOSTADDRESS$
        }
I have not tested this extensively, but this seems to cause no problem, and it certainly makes the pnp4nagios graphs work as they should.


For what it's worth, I installed Nagios and pnp4nagios from the EPEL repository, and check_ping is the default config. So anyone installing via EPEL (Which is the easiest way to install Nagios+pnp4nagios it on Redhat / CentOS), will have this problem.

Re: pnp4nagios offline status not work

Posted: Thu Jan 02, 2014 12:43 pm
by abrist
sw1 wrote:check-host-alive
The check is best used for the reason mentioned by sw1 above - it will not skew the perf data for the host check like ping/icmp will . . . .