Problem installing pnp4nagios

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.
Locked
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Problem installing pnp4nagios

Post 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?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Problem installing pnp4nagios

Post 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.
Former Nagios Employee.
me.
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Problem installing pnp4nagios

Post 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?
jrdalrymple
Posts: 16
Joined: Fri Nov 13, 2015 4:49 pm

Re: Problem installing pnp4nagios

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Problem installing pnp4nagios

Post 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
Former Nagios Employee
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Problem installing pnp4nagios

Post 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]:
kaplan71
Posts: 21
Joined: Tue Oct 25, 2011 9:59 am

Re: Problem installing pnp4nagios

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Problem installing pnp4nagios

Post 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.
Former Nagios Employee
Locked