Page 1 of 2
pnp4nagios - perfdata empty
Posted: Thu May 15, 2014 10:00 pm
by wf-lraymond
Hey all, been a happy N3 user forever and doing some consulting and migrating a whole data center over to amazon. So I am using a stock Ubuntu 14.04LTS install, have have the latest 4.06 nagios compiled, working and reporting nicely along with 2 test remote servers via NRPE. My version 3 I used pnp4nagios and did it's job so I thought that was the way to continue.
I have things compiled, the install page was all green with dependencies all good. I added the 2 template entries, added a srvpnp to the localhost load, and restarted (no errors). I saw on the service page the new little box that I remember, a mouse over showed nothing though. Clicking I got to a page;
domain.com/pnp4nagios/index.php/graph?host=localhost&srv=Current Load
The page has the error: Please check the documentation for information about the following error.
perfdata directory "/usr/local/pnp4nagios/var/perfdata/localhost" is empty. Please check your Nagios config. Read FAQ online
The FAQ and doc's only go into v2 and v3 of nagios. I looked and the correct owner does own that perfdata folder, and for testing I even did a chmod 777 on that folder.
So, the quesion comes full circle to;
1. Is pnp4nagios the easiest to setup for basic graphing of certain services.
2. If so, how can I debug this better
3. If not, what is a good way to graph some basic services in nagios4.
Thanks
Re: pnp4nagios - perfdata empty
Posted: Fri May 16, 2014 12:53 pm
by tmcdonald
I guess my first question is whether or not NPCD is running:
Re: pnp4nagios - perfdata empty
Posted: Fri May 16, 2014 12:57 pm
by slansing
Well I am not extremely well versed on PNP usage however yes, there are alternatives:
http://exchange.nagios.org/directory/Ad ... os/details
http://nagiosgraph.sourceforge.net/
I believe that the PNP version you are running would have documentation on their site, PNP4Nagios is not produced or maintained by Nagios Enterprises, it is a third party project. I don't think that upgrading to core 4 from core 3 would really have a major impact on PNP specifically as paths should still be constant between the Nagios versions in your specific case.
Are the permissions on this file/directory consistent? Is there actually a localhost file there? Are you seeing the same error for other hosts/services? Finally, is that directory consistent with what PNP4nagios shows usage for in their documentation?
Re: pnp4nagios - perfdata empty
Posted: Fri May 16, 2014 1:53 pm
by wf-lraymond
tmcdonald wrote:I guess my first question is whether or not NPCD is running:
Odd I never saw that going through the doc's, but it wasn't;
service npcd status
npcd is not running
/etc/init.d/npcd start
Starting npcd: done.
So, that process is running, but nothing in the perfdata. I compared it to my 3.x install thats running and do see permissions are the same, and the perfdata folder has all my servers, so I'm trying to see if there is a way to enable more debugging, etc.
Thanks.
Re: pnp4nagios - perfdata empty
Posted: Fri May 16, 2014 2:38 pm
by slansing
Yep, you can enable debug logging (I believe to your syslog) via the process_perfdata.cfg:
http://docs.pnp4nagios.org/pnp-0.6/verify#debug_logfile
Re: pnp4nagios - perfdata empty
Posted: Fri May 16, 2014 3:08 pm
by wf-lraymond
Thanks, the output of the perfdata.log file shows the following when I run the process_perf.pl from the cli;
Code: Select all
2014-05-16 20:02:15 [20549] [2] Default Timeout: 15 secs.
2014-05-16 20:02:15 [20549] [2] Config Timeout: 15 secs.
2014-05-16 20:02:15 [20549] [2] Actual Timeout: 15 secs.
2014-05-16 20:02:15 [20549] [1] process_perfdata.pl-0.6.21 starting in SYNC Mode
2014-05-16 20:02:15 [20549] [1] Cant find Nagios Environment. Exiting ....
Looking around I did see one variable that was not set (well was set to 0) where my working was 1 that is attributed;
enable_environment_macros=0
So I did update that to 1, and restarted all services but still see the same error. There are 2 other threads about nagios v4 and broken pnp4nagios, but still going to continue looking around/testing.
Thanks.
Re: pnp4nagios - perfdata empty
Posted: Mon May 19, 2014 2:04 pm
by slansing
Can you share these two files?:
Code: Select all
/usr/local/nagios/etc/pnp/process_perfdata.cfg
/usr/local/nagios/etc/nagios.cfg
Looks like PNP does not know where nagios is... which
hopefully should be a quick fix.
Re: pnp4nagios - perfdata empty
Posted: Tue May 20, 2014 3:02 pm
by wf-lraymond
Can you share these two files?:
CODE: SELECT ALL
/usr/local/nagios/etc/pnp/process_perfdata.cfg
/usr/local/nagios/etc/nagios.cfg
There is no /usr/local/nagios/etc/pnp folder. The install put that under /usr/local/pnp4nagios (not sure if that is why), but I will include the /usr/local/pnp4nagios/etc/process_perfdata here.
Re: pnp4nagios - perfdata empty
Posted: Tue May 20, 2014 3:25 pm
by slansing
What is the output of:
Code: Select all
cat /usr/local/nagios/etc/commands.cfg | grep 'perfdata'
Do you have:
On your hosts/services which you expect graphs for?
Were you planning on using bulk perfdata processing? If so it does not appear as though you followed the PNP documentation to properly enable this, I did notice that you have some of the proper fields (not all of them) at the base of your nagios.cfg
Re: pnp4nagios - perfdata empty
Posted: Tue May 20, 2014 4:04 pm
by wf-lraymond
Not bulk if I remember. It's a small network of only 5 or so servers, and I only want to graph server load, maybe disk/I which I had done years ago using pnp, version 3 of nagios. Server setup looks like;
Code: Select all
define service{
use generic-service,srv-pnp
hostgroup_name remote
service_description Server Load
check_command check_nrpe!check_load
max_check_attempts 3
}
define command{
command_name check_local_load
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
}
Now the above does work as I am getting data like OK - load average: 1.83, 1.69, 1.15
Other items;
Code: Select all
cat /usr/local/nagios/etc/objects/commands.cfg | grep 'perfdata'
# host_perfdata_file and service_perfdata_file options in the main config file.
# 'process-host-perfdata' command definition
command_name process-host-perfdata
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
# 'process-service-perfdata' command definition
command_name process-service-perfdata
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
command_name process-service-perfdata-for-nagiosgraph
Code: Select all
templates.cfg has;
process_perf_data 1 ; Process performance data
I know Ubuntu 14.04 made a lot of apache changes, but I'm not sure if it's just a path missing somewhere, etc.
Thanks for all the help so far.