npc 2.0.0b

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
blugger
Cacti User
Posts: 50
Joined: Wed May 07, 2008 10:23 am

npc 2.0.0b

Post by blugger »

Hi!

I installed this plugin as described at http://trac2.assembla.com/npc

All but one thing looks fine.

When I click at "npc" -> "Process Information" I get a some check information.

The following two checks fail:

"Obsess Over Hosts"
"Obsess Over Services"

When I double click on "Obsess Over Hosts" for example, the browser asks me with a new window the following: "Start obsessing over hosts?"

When I click "Yes" the following message comes up in a new browser window: "Failed to open /usr/local/nagios/var/rw/"

======================================

I did everything as described in the nagios documentation:

/usr/sbin/useradd -m nagios
passwd nagios

/usr/sbin/groupadd nagios
/usr/sbin/usermod -G nagios nagios

/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd wwwrun

./configure --with-command-group=nagcmd

make all

make install
make install-init
make install-config
make install-commandmode

make install-webconf

service apache2 restart

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

chkconfig --add nagios
chkconfig nagios on

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


===================



Starting nagios gives the following logging output:


Sep 5 13:17:08 src@cacti su: (to nagios) root on /dev/pts/4
Sep 5 13:17:08 src@cacti nagios: Nagios 3.0.3 starting... (PID=21224)
Sep 5 13:17:08 src@cacti nagios: Local time is Fri Sep 05 13:17:08 CEST 2008
Sep 5 13:17:08 src@cacti nagios: LOG VERSION: 2.0
Sep 5 13:17:08 src@cacti nagios: ndomod: NDOMOD 1.4b7 (10-31-2007) Copyright (c) 2005-2007 Ethan Galstad (nagios@nagios.org)
Sep 5 13:17:08 src@cacti ndo2db: Successfully connected to MySQL database
Sep 5 13:17:08 src@cacti nagios: ndomod: Successfully connected to data sink. 0 queued items to flush.
Sep 5 13:17:08 src@cacti nagios: Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
Sep 5 13:17:08 src@cacti nagios: Finished daemonizing... (New PID=21227)
Sep 5 13:17:09 src@cacti ndo2db: Error: mysql_query() failed for 'INSERT INTO npc_configfilevariables SET instance_id='1', configfile_id='3', varname='cfg_file', varvalue='/usr/local/nagios/etc/objects/contacts\.cfg''
Sep 5 13:17:09 src@cacti ndo2db: Error: mysql_query() failed for 'INSERT INTO npc_configfilevariables SET instance_id='1', configfile_id='3', varname='cfg_file', varvalue='/usr/local/nagios/etc/objects/timeperiods\.cfg''
Sep 5 13:17:09 src@cacti ndo2db: Error: mysql_query() failed for 'INSERT INTO npc_configfilevariables SET instance_id='1', configfile_id='3', varname='cfg_file', varvalue='/usr/local/nagios/etc/objects/templates\.cfg''
Sep 5 13:17:09 src@cacti ndo2db: Error: mysql_query() failed for 'INSERT INTO npc_configfilevariables SET instance_id='1', configfile_id='3', varname='cfg_file', varvalue='/usr/local/nagios/etc/objects/localhost\.cfg''
blugger
Cacti User
Posts: 50
Joined: Wed May 07, 2008 10:23 am

wrong "rights" ???

Post by blugger »

I assume that I have the wrong rights set. Here are the rights:

cacti:/usr/local/nagios # ls -l
total 160
drwxrwxr-x 2 nagios nagios 4096 Sep 5 12:30 bin
drwxrwxr-x 3 nagios nagios 4096 Sep 5 12:33 etc
drwxrwxr-x 2 nagios nagios 4096 Sep 5 12:10 libexec
-rwxr-xr-x 1 root root 134188 Sep 5 12:30 ndomod.o
drwxrwxr-x 2 nagios nagios 4096 Sep 5 12:02 sbin
drwxrwxr-x 9 nagios nagios 4096 Sep 5 12:10 share
drwxrwxr-x 5 nagios nagios 4096 Sep 5 13:19 var


cacti:/usr/local/nagios/var # ls -l
total 72
drwxrwxr-x 2 nagios nagios 4096 Sep 5 12:02 archives
-rw-r--r-- 1 nagios nagios 6 Sep 5 13:17 nagios.lock
-rw-r--r-- 1 nagios nagios 4697 Sep 5 13:17 nagios.log
srwxr-xr-x 1 nagios nagios 0 Sep 5 12:36 ndo.sock
-rw-rw-r-- 1 nagios nagios 0 Sep 5 13:17 ndomod.tmp
-rw-r--r-- 1 nagios nagios 12957 Sep 5 13:17 objects.cache
-rw------- 1 nagios nagios 13586 Sep 5 13:17 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 Sep 5 13:17 rw
drwxr-xr-x 3 root root 4096 Sep 5 12:02 spool
-rw-rw-r-- 1 nagios nagios 14214 Sep 5 13:19 status.dat

cacti:/usr/local/nagios/var/rw # ls -l
total 0
prw-rw---- 1 nagios nagcmd 0 Sep 5 13:17 nagios.cmd
blugger
Cacti User
Posts: 50
Joined: Wed May 07, 2008 10:23 am

.. now tried the following

Post by blugger »

http://nagios.sourceforge.net/docs/2_0/commandfile.html


I did the following:

cacti:/usr/local/nagios/var/rw # /usr/sbin/groupadd nagiocmd
groupadd: Group `nagiocmd' already exists.

cacti:/usr/local/nagios/var/rw # /usr/sbin/usermod -G nagiocmd nagios
cacti:/usr/local/nagios/var/rw # /usr/sbin/usermod -G nagiocmd nobody
cacti:/usr/local/nagios/var/rw # /usr/sbin/usermod -G nagiocmd wwwrun

cacti:/usr/local/nagios/var/rw # rm -R /usr/local/nagios/var/rw/
cacti:/usr/local/nagios/var/rw # mkdir /usr/local/nagios/var/rw
cacti:/usr/local/nagios/var/rw # chown nagios.nagiocmd /usr/local/nagios/var/rw
cacti:/usr/local/nagios/var/rw # chmod u+rwx /usr/local/nagios/var/rw
cacti:/usr/local/nagios/var/rw # chmod g+rwx /usr/local/nagios/var/rw
cacti:/usr/local/nagios/var/rw # chmod g+s /usr/local/nagios/var/rw

cacti:/usr/local/nagios/var/rw # ls -al /usr/local/nagios/var
total 80
drwxrwxr-x 5 nagios nagios 4096 Sep 5 13:34 .
drwxr-xr-x 8 root root 4096 Sep 5 12:11 ..
drwxrwxr-x 2 nagios nagios 4096 Sep 5 12:02 archives
-rw-r--r-- 1 nagios nagios 6 Sep 5 13:17 nagios.lock
-rw-r--r-- 1 nagios nagios 4840 Sep 5 13:32 nagios.log
srwxr-xr-x 1 nagios nagios 0 Sep 5 12:36 ndo.sock
-rw-rw-r-- 1 nagios nagios 0 Sep 5 13:17 ndomod.tmp
-rw-r--r-- 1 nagios nagios 12957 Sep 5 13:17 objects.cache
-rw------- 1 nagios nagios 13586 Sep 5 13:17 retention.dat
drwxrwsr-x 2 nagios nagiocmd 4096 Sep 5 13:33 rw
drwxr-xr-x 3 root root 4096 Sep 5 12:02 spool
-rw-rw-r-- 1 nagios nagios 14215 Sep 5 13:34 status.dat



==============

Since I did the commands mentioned above I get the following apache messages:

cacti:/usr/local/nagios/var/rw # service apache2 start
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Module "ruby" is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Starting httpd2 (prefork) job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
blugger
Cacti User
Posts: 50
Joined: Wed May 07, 2008 10:23 am

change ...

Post by blugger »

ok now the apache2 starts normal...

When I double click on "Obsess Over Hosts" for example, the browser asks me with a new window the following: "Start obsessing over hosts?"

When I click "Yes" the following message comes up in a new browser window: "/usr/local/nagios/var/rw must be readable and writable by the web server user"

What can I do now???
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest