LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Any Nagios Gurus? (https://www.linuxquestions.org/questions/linux-software-2/any-nagios-gurus-820989/)

Spuddy 07-20-2010 12:03 PM

Quote:

Originally Posted by rfelsburg (Post 4039663)
Check /var/log/messages not /var/log/nagios3/nagios.log

It's a system error, not a nagios error.

My apologies.

Code:

Jul 18 06:25:01 ODB2 kernel: imklog 3.18.6, log source = /proc/kmsg started.
Jul 18 06:25:01 ODB2 rsyslogd: [origin software="rsyslogd" swVersion="3.18.6" x-pid="3125" x-info="http://www.rsyslog.com"] restart
Jul 19 06:25:01 ODB2 kernel: imklog 3.18.6, log source = /proc/kmsg started.
Jul 19 06:25:01 ODB2 rsyslogd: [origin software="rsyslogd" swVersion="3.18.6" x-pid="3125" x-info="http://www.rsyslog.com"] restart
Jul 20 06:25:01 ODB2 kernel: imklog 3.18.6, log source = /proc/kmsg started.
Jul 20 06:25:01 ODB2 rsyslogd: [origin software="rsyslogd" swVersion="3.18.6" x-pid="3125" x-info="http://www.rsyslog.com"] restart
Jul 20 12:29:20 ODB2 nagios3: Nagios 3.2.1 starting... (PID=8326)
Jul 20 12:29:20 ODB2 nagios3: Local time is Tue Jul 20 12:29:20 BST 2010
Jul 20 12:29:20 ODB2 nagios3: LOG VERSION: 2.0
Jul 20 12:29:20 ODB2 nagios3: Finished daemonizing... (New PID=8327)
Jul 20 13:13:59 ODB2 nagios3: Caught SIGTERM, shutting down...
Jul 20 13:13:59 ODB2 nagios3: Successfully shutdown... (PID=8327)
Jul 20 17:37:22 ODB2 nagios: Nagios 3.2.1 starting... (PID=29880)
Jul 20 17:37:22 ODB2 nagios: Local time is Tue Jul 20 17:37:22 BST 2010
Jul 20 17:37:22 ODB2 nagios: LOG VERSION: 2.0
Jul 20 17:37:22 ODB2 nagios: Failed to obtain lock on file /usr/local/nagios/var/nagios.lock: Permission denied
Jul 20 17:37:22 ODB2 nagios: Bailing out due to errors encountered while attempting to daemonize... (PID=29880)
Jul 20 17:37:40 ODB2 nagios: Nagios 3.2.1 starting... (PID=29893)
Jul 20 17:37:40 ODB2 nagios: Local time is Tue Jul 20 17:37:40 BST 2010
Jul 20 17:37:40 ODB2 nagios: LOG VERSION: 2.0
Jul 20 17:37:40 ODB2 nagios: Failed to obtain lock on file /usr/local/nagios/var/nagios.lock: Permission denied
Jul 20 17:37:40 ODB2 nagios: Bailing out due to errors encountered while attempting to daemonize... (PID=29893)
Jul 20 17:38:04 ODB2 nagios: Nagios 3.2.1 starting... (PID=29908)
Jul 20 17:38:04 ODB2 nagios: Local time is Tue Jul 20 17:38:04 BST 2010
Jul 20 17:38:04 ODB2 nagios: LOG VERSION: 2.0
Jul 20 17:38:04 ODB2 nagios: Failed to obtain lock on file /usr/local/nagios/var/nagios.lock: Permission denied
Jul 20 17:38:04 ODB2 nagios: Bailing out due to errors encountered while attempting to daemonize... (PID=29908)


rfelsburg 07-20-2010 12:11 PM

lets start with the lock file error and go from there.

Type
Code:

ls -lad /usr/local/nagios/var
and post the output

Spuddy 07-20-2010 02:54 PM

Code:

drwxrwsr-x 5 nagios nagios 4096 2010-07-20 17:38 /usr/local/nagios/var
Thanks!

rfelsburg 07-20-2010 04:58 PM

Does that mean you got it working?

Spuddy 07-20-2010 04:59 PM

sorry, no it doesn't. Just posted the output and thanked you for your help.

rfelsburg 07-20-2010 05:02 PM

Gotcha,

Can you run this:

Code:

ls -la /usr/local/nagios/var/nagios.lock
Also, what distro are you running, fedora, centOS, ubuntu...

Spuddy 07-21-2010 02:49 AM

Quote:

Originally Posted by rfelsburg (Post 4039997)
Gotcha,

Can you run this:

Code:

ls -la /usr/local/nagios/var/nagios.lock
Also, what distro are you running, fedora, centOS, ubuntu...

Code:

-rw-r--r-- 1 root nagios 0 2010-07-20 17:38 /usr/local/nagios/var/nagios.lock
It is Debian Squeeze. Thanks.

centosboy 07-21-2010 02:50 AM

the system is debian. this was said in the first post

send the output from

Code:

ls -la /usr/local/nagios/var/

Spuddy 07-21-2010 02:54 AM

Quote:

Originally Posted by centosboy (Post 4040368)
the system is debian. this was said in the first post

send the output from

Code:

ls -la /usr/local/nagios/var/

Code:

ODB2:/var/log# ls -la /usr/local/nagios/var/
total 40
drwxrwsr-x  5 nagios nagios  4096 2010-07-20 17:38 .
drwxr-sr-x 12 nagios nagios  4096 2010-07-20 14:09 ..
drwxrwsr-x  2 nagios nagios  4096 2010-07-20 12:57 archives
-rw-r--r--  1 root  nagios    0 2010-07-20 17:38 nagios.lock
-rw-r--r--  1 nagios nagios  984 2010-07-20 17:38 nagios.log
-rw-r--r--  1 nagios nagios 12943 2010-07-20 17:38 objects.cache
drwxrwsr-x  2 nagios nagios  4096 2010-07-20 12:57 rw
drwxr-sr-x  3 root  nagios  4096 2010-07-20 12:57 spool

Thanks for your help guys.

Spuddy 07-21-2010 03:09 AM

Some further information.

Code:

ODB2:/# /etc/init.d/nagios start
Starting nagios:Unknown id: nagiosadmin
chown: invalid user: `nagiosadmin:nagios'
 done.
ODB2:/# /etc/init.d/nagios ?
Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig}
ODB2:/# /etc/init.d/nagios status
nagios is not running
ODB2:/#


sem007 07-21-2010 04:06 AM

Have you change any user or group before this?
Which user and group you had create at installation time ?

centosboy 07-21-2010 05:28 AM

nagios lock file was created with root ownership, but this was yesterday evening...

Code:

-rw-r--r--  1 root  nagios    0 2010-07-20 17:38 nagios.lock

--

Code:

chown nagios /usr/local/nagios/var/nagios.lock

then restart nagios

Spuddy 07-21-2010 05:30 AM

Quote:

Originally Posted by centosboy (Post 4040499)
nagios lock file was created with root ownership, but this was yesterday evening...

Code:

-rw-r--r--  1 root  nagios    0 2010-07-20 17:38 nagios.lock

--

Code:

chown nagios /usr/local/nagios/var/nagios.lock

then restart nagios

Code:

ODB2:/# chown nagios /usr/local/nagios/var/nagios.lock
ODB2:/# /etc/init.d/nagios ?
Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig}
ODB2:/# /etc/init.d/nagios restart
Running configuration check...done.
Stopping nagios: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
done.
Starting nagios:Unknown id: nagiosadmin
chown: invalid user: `nagiosadmin:nagios'
 done.

Bizarre considering I log into Nagios HTTP page using nagiosadmin.

centosboy 07-21-2010 05:40 AM

Quote:

Originally Posted by Spuddy (Post 4040501)
Code:

ODB2:/# chown nagios /usr/local/nagios/var/nagios.lock
ODB2:/# /etc/init.d/nagios ?
Usage: nagios {start|stop|restart|reload|force-reload|status|checkconfig}
ODB2:/# /etc/init.d/nagios restart
Running configuration check...done.
Stopping nagios: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
done.
Starting nagios:Unknown id: nagiosadmin
chown: invalid user: `nagiosadmin:nagios'
 done.

Bizarre considering I log into Nagios HTTP page using nagiosadmin.

no, not bizarre actually.
htaccess (which is controlling web authentication) doesnt user /etc/passwd to authenticate but
the nagiosadmin user appears to exist in the htpasswd file, but not in the /etc/passwd or /etc/group or /etc/shadow files. Maybe you could confirm this..??

It appears you may have missed a step or 2 when going throught the initial build...?

angel115 07-21-2010 06:12 AM

Hi Spuddy,

I would sugest that you check that you've created the nagios user and group
as following the output of your command ls -la /usr/local/nagios/var/
nagios should run under nagios user and nagios group.


if you did edit your nagios.cfg
Code:

vi /usr/local/nagios/etc/nagios.cfg
and change the nagios_user and nagios_group to nagios
Code:

nagios_user=nagios
nagios_group=nagios

save it and try to restart nagios again.


All times are GMT -5. The time now is 10:32 AM.