Page 1 of 1

Problem installing pnp4nagios

Posted: Thu Nov 19, 2015 4:49 pm
by kaplan71
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:

http://www.techienote.com/pnp4nagios-on-ubuntu/

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.
What did I do wrong, and how can I correct it?

Re: Problem installing pnp4nagios

Posted: Thu Nov 19, 2015 4:54 pm
by hsmith
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.

Re: Problem installing pnp4nagios

Posted: Fri Nov 20, 2015 3:39 pm
by kaplan71
Hello --

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.
How can I get around this?

Re: Problem installing pnp4nagios

Posted: Sun Nov 22, 2015 9:10 am
by jrdalrymple
kaplan71 wrote: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.

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

Re: Problem installing pnp4nagios

Posted: Mon Nov 23, 2015 10:18 am
by rkennedy
This command should work in place of the one you're trying -

Code: Select all

sudo /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-enabled/nagios.conf

Re: Problem installing pnp4nagios

Posted: Tue Nov 24, 2015 8:50 am
by kaplan71
Hello --

I have made some progress. I can get to the pnp4nagios page, but I am now encountering the following error:
PNP4Nagios Version 0.6.10
Please check the documentation for information about the following error.

Non-static method nagios_Core::SummaryLink() should not be called statically, assuming $this from incompatible context
file [line]:

application/views/graph_content.php [47]:

Re: Problem installing pnp4nagios

Posted: Tue Nov 24, 2015 1:11 pm
by kaplan71
Hello --

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.

Re: Problem installing pnp4nagios

Posted: Tue Nov 24, 2015 1:13 pm
by rkennedy
Glad to see you were able to work this out! Thanks for posting your solution, too.

I will now close this thread out, feel free to open another one in the future if you ever need assistance.