Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Hello –
I have a 4.1.1 installation running on an Ubuntu 14.04 LTS server. I wanted to install pnp4nagios, and to that end I followed the procedure
at the following url:
I went through the steps outlined in the procedure, and when I ran the nagios -v nagios.cfg check, the following error message appeared on-screen:
Reading configuration data…
Read main config file okay…
Warning: Duplicate definition found for command ‘process-service-perfdata-file’ (config file ‘/usr/local/nagios/etc/objects/commands.cfg’, starting on line 212)
Error: Could not add object property in file ‘/usr/local/nagios/etc/objects/commands.cfg’ on line 213.
Error processing object config files!
This coincides where the process-service-perfdata-file entry is located.
Look through commands.cfg. You have that command defined twice. It was probably there by default, and I'm guessing the guide told you to add it, so now it is duplicated. Nagios Core doesn't like that, because it gets confused and doesn't know what command to use.
I made some progress. The duplicate definition was located in the checkcommands.cfg file.
However I have run into another problem: After the install was complete, I attempted to go to the URL: <nagios server>/pnp4nagios, but I am getting a 404 Not found error message.
I traced the problem back to the make install-webconf command. The output of that command was the following:
make install-webconf
cd ./sample-config && make install-webconf
make[1]: Entering directory '/root/downloads/pnp4nagios-0.6.10/sample-config'
/usr/bin/install -c -m 644 httpd.conf /etc/httpd/conf.d/pnp4nagios.conf
/usr/bin/install: cannot create regular file ‘/etc/httpd/conf.d/pnp4nagios.conf’: No such file or directory
Makefile:67: recipe for target 'install-webconf' failed
make[1]: *** [install-webconf] Error 1
make[1]: Leaving directory '/root/downloads/pnp4nagios-0.6.10/sample-config'
Makefile:108: recipe for target 'install-webconf' failed
make: *** [install-webconf] Error 2
The problems are the following:
1. The httpd.conf file does not exist on an Ubuntu 14.04 server
2. The directory path, /etc/httpd/conf.d is incorrect for the Apache server.
1. The httpd.conf file does not exist on an Ubuntu 14.04 server
2. The directory path, /etc/httpd/conf.d is incorrect for the Apache server.
How can I get around this?
The Makefile doesn't know how to handle Ubuntu. The difference is that Ubuntu stores it's conf.d for httpd under /etc/apache2/ - Probably the easiest solution is:
1) temporarily create /etc/httpd/conf.d
2) rerun `make install-webconf`
3) relocate the file it generates from /etc/httpd/conf.d to /etc/apache2/conf.d
4) restart httpd and you might have some success
5) don't forget to delete your temporary /etc/httpd you created
I solved the problem..."With A Little Help From My Friends"...
The solution was pretty simple: I had installed an older version of pnp4nagios, and I simply upgraded it to the latest version,
and that solved the problem.