I have configured nagiosgrapher correctly, as far as I can tell, but the logs continue to report a lack of data. For example, for load, in /var/log/nagiosgrapher/ngraph.log
:
2012-08-02 22:30:16 PIPE: myhost CPU Load OK - load average: 0.00, 0.00, 0.00 load1=0.000;15.000;30.000;0; load5=0.000;10.000;25.000;0; load15=0.000;5.000;20.000;0;
2012-08-02 22:30:16 VALUES: [myhost][CPU Load]:No matching output values found...
I have configured Nagios and Nagiosgrapher on Debian systems before and have never run into an issue like this, and thus far have been unable to solve it.
The systems are using only default plugins. The relevant /etc/nagios3/nagios.cfg
values are:
process_performance_data=1
and
service_perfdata_command=ngraph-process-service-perfdata-pipe
I have tried restarting both Nagios and Nagiosgrapher in varying order, which was something I found on Google searches, but that didn't seem to have an effect.
Is there any idea of what I might be doing wrong or where to look? All other Nagios functionality seems to be behaving normally on both local and remote hosts.
The fact that the log is showing that PIPE line means that you have configured Nagios to send the data to Nagiosgrapher correctly.
The "No mathcing output values found" line means that the regexp in the "CPU Load" ngraph definition didn't match anything in the data that it got ("OK - load average: 0.00, 0.00, 0.00 load1=0.000;15.000;30.000;0; load5=0.000;10.000;25.000;0; load15=0.000;5.000;20.000;0;").
You should have a config file (perhaps "check_load.ncfg") that defines the ngraph for services containing the name "load". Check in the ngraph.d folder, or whever you put your configuration snippets for Nagiosgrapher, and then make sure the "graph_log_regex" or "graph_perf_regex" entries makes sense.
Going to answer my own question here in detail since this drove me nuts for awhile, and hopefully it will help somebody else down the road looking for the same. Thanks to Keith's answer, though, which started me on the right path here.
To debug this, I edited the /etc/nagiosgrapher/ngraph.ncfg file and set the log to the most verbose setting possible:
I then restarted nagiosgrapher via
/etc/init.d/nagiosgrapher restart
and started to watch the log at the location above.There are three things that happened here, all of which contributed to my problem:
Problem 1
For whatever reason, the Debian distribution of nagiosgrapher no longer installs the check_disk.ncfg and check_load.ncfg graph definitions. I always assume that I have done something wrong when things don't work, but in this case, they just aren't there -- BUT, they are in the distribution and on the system. You just need to copy them:
It is possible this is just a problem with the package install script, but I have not verified this, and your mileage may vary. This worked for me though.
Problem 2
I had renamed the
service-description
from "Current Load" to "CPU Load" in the/etc/nagios3/conf.d/services_nagios2.cfg
file where I defined it, which seemed innocent at the time. However, the nagiosgrapher package ships with a plugin calledcheck_hardware
which has a block defined as "CPU", and apparently, nagiosgrapher looks at that service description, parses it on whitespace, and then checks for matching blocks, in this case checking both "CPU" and "Load". Further, any time one of those blocks fails to match, the entire write fails, resulting in the message I got in my question above.Problem 3
Similar to Problem 2, I had added monitoring for MySQL partitions and set the
service-description
to "Disk Space: MySQL". Again, sine nagiosgrapher was parsing on whitespace, it saw both "Disk" and "MySQL" and was triggering the MySQL graph plugin, which of course failed on the disk output. Changing the service-description fixed this.Once the above changes were made, do the following:
This will begin generating the graph data correctly. Once this has been running for awhile and each graph has been generated at least once (you can verify in the logs or by looking directly in the
/var/lib/nagiosgrapher/rrd/
directory), then restart Nagios:At this point, everything should be working fine.
For what it's worth, these are the packages I have installed that led me to this problem and solution: