Nagios 1.2 Process Perf. Data doesn't work!


#1

I am having a heck of a time getting performance graphs in Nagios. I first tried nagios_grapher which I couldn’t get to work. Now I am trying nagiostat. However I think I have found the reason I cannot get either of them to work. Nagios isn’t doing any processing of Performance data.

I have set the nagios.cfg file to have process_performance_data=1 and service_perfdata_command=process-service-perfdata. Then I set up a command in misccommands.cfg with the following

define command { command_name process-service-perfdata command_line /usr/share/nagios/nagiostat/nagiostat -p "$LASTCHECK $|!!|$HOSTNAME$|!!|$SERVICEDESC$|!!|$SERVICESTATE$|!!|$OUTPUT$|!!|$PERFDATA$" }

However nagiostat never seems to recieve any performance data. So I changed the command_line to

/usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$STATETYPE$\t$EXECUTIONTIME$\t$OUTPUT$\t$PERFDATA$" >> /usr/local/nagios/var/service-perfdata.out

And I still get bupkis. It looks like Nagios just isn’t processing performance data. So I recompiled nagios making sure to include --with-default-perfdata. But I still get nothing. :x

This is seriously starting to bug the heck out of me. Can anyone tell me where I am going wrong:?:?


#2

A couple of things come to mind:

  1. Are you sure that the plugins you’re using return performance data? It’s not just automatic. When you run the plugin from a command line, it should return something like this:

PING OK - Packet loss = 0%, RTA = 0.02 ms|pl=0%,rta=0.02

Note the “|pl=0%,rta=0.02”. That is the performance data. If your plugins don’t return a string with a “|” in it, followed by some values, then there is no performance data to log.

  1. Make sure your individual service checks are set to store performance data. This may require turning off state retaining, at least once, since it’s one of thos fields that doesn’t update from the config when nagios is reloaded.

#3

I am just trying to use the stock ./check_ping command. I don’t see as where it returns the pipe or any trailing information. Is there some way that I can make it do this? I don’t see anything about it in the documentation.

–Thanks for replying!


#4

On second thought, NSClient is returning extra information and as far as I can tell Nagios should be processing that as well. I am trying to pass the information to nagiosgraph, it is only set to look for ping.

However as far as I can tell when I set the process command to do a printf to a file, or even an echo to a file, it should have done it for the data NSClient is returning.


#5

check_ping, last I looked, doesn’t return perf data. This is not a problem since your nagiostat.conf file can be configed to utilitze the OUTPUT or perf data.

Double check your configs for typos, and go through all the readme’s again. Rest assured, that the problem is not with nagios nor nagiostat, but with your config.

Permissions on your nagiostat directory are ???
ls -la whatever/nagiostat/