[Core 4.0.8] - RHEL 6.

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.
shadowwisps
Posts: 15
Joined: Wed Apr 22, 2015 4:05 am

[Core 4.0.8] - RHEL 6.

Post by shadowwisps »

Hi,

After a clean install, I am having issues with the Nagios GUI.
It reports that Nagios isn't running, which i'm assuming is a privilege issue with the lock file, but can't find anything wrong.
Process is definitely up and running
All the menu sections show "Error: Could not read object configuration data!"

Nothing interesting in the nagios.log, and I can find nothing interesting in the nagios.debug when it set it running.
Obviously the config check is all good.


Have checked all the obvious and some tweaks I have found around the forum, but to no avail so far.
Any help would be greatly appreciated!
Thanks :)

Code: Select all

[PROD][root@eqdg3pperf005 etc]# service nagios status
nagios (pid 15905) is running..
nagios   15905  0.0  0.1  36964  4204 ?        Ss   11:00   0:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios   15907  0.0  0.0  10016   956 ?        S    11:00   0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios   15908  0.0  0.0  10016   948 ?        S    11:00   0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios   15909  0.0  0.0  10016   952 ?        S    11:00   0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios   15910  0.0  0.0  10016   952 ?        S    11:00   0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
nagios   15911  0.0  0.0  36448  1052 ?        S    11:00   0:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
and then all the check scripts..

[PROD][root@eqdg3pperf005 etc]# ll /usr/local/nagios/
total 36
drwxr-xr-x   9 root   root   4096 Apr 22 09:53 .
drwxr-xr-x. 13 root   root   4096 Apr 22 09:49 ..
drwxrwxr-x   2 nagios nagios 4096 Apr 22 09:49 bin
drwxrwxr-x   3 nagios nagios 4096 Apr 22 10:59 etc
drwxr-xr-x   2 root   root   4096 Apr 22 09:53 include
drwxrwxr-x   3 nagios nagios 4096 Apr 22 09:53 libexec
drwxrwxr-x   2 nagios nagios 4096 Apr 22 09:49 sbin
drwxrwxr-x  11 nagios nagios 4096 Apr 22 09:53 share
drwxrwxr-x   5 nagios nagios 4096 Apr 22 11:11 var
[PROD][root@eqdg3pperf005 nagios]# ll /usr/local/nagios/etc/
total 76
drwxrwxr-x 3 nagios nagios  4096 Apr 22 10:59 .
drwxr-xr-x 9 root   root    4096 Apr 22 09:53 ..
-rw-rw-r-- 1 nagios nagios 12015 Apr 22 09:50 cgi.cfg
-rw-r--r-- 1 root   root      26 Apr 22 09:51 htpasswd.users
-rw-rw-r-- 1 nagios nagios 44727 Apr 22 10:59 nagios.cfg
drwxrwxr-x 2 nagios nagios  4096 Apr 22 10:51 objects
-rw-rw-r-- 1 nagios nagios  1312 Apr 22 09:50 resource.cfg
[PROD][root@eqdg3pperf005 nagios]# ll /usr/local/nagios/var/
total 2864
drwxrwxr-x 5 nagios nagios    4096 Apr 22 11:13 .
drwxr-xr-x 9 root   root      4096 Apr 22 09:53 ..
drwxrwxr-x 2 nagios nagios    4096 Apr 22 09:49 archives
-rw-r--r-- 1 nagios nagios      34 Apr 22 11:00 nagios.configtest
-rw-r--r-- 1 nagios nagios  475850 Apr 22 10:59 nagios.debug
-rw-r--r-- 1 nagios nagios 1000072 Apr 22 10:59 nagios.debug.old
-rw-r--r-- 1 nagios nagios       6 Apr 22 11:00 nagios.lock
-rw-r--r-- 1 nagios nagios   81692 Apr 22 11:00 nagios.log
-rw-r--r-- 1 nagios nagios  256263 Apr 22 11:00 objects.cache
-rw-r--r-- 1 nagios nagios  256263 Apr 22 11:00 objects.precache
-rw------- 1 nagios nagios  409449 Apr 22 11:00 retention.dat
drwxrwsr-x 2 nagios nagcmd    4096 Apr 22 11:00 rw
drwxr-xr-x 3 root   root      4096 Apr 22 09:49 spool
-rw-rw-r-- 1 nagios nagios  409520 Apr 22 11:13 status.dat
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: [Core 4.0.8] - RHEL 6.

Post by jolson »

Any chance that SELinux is running on your box?

Code: Select all

sestatus
If so, turn it off and see whether that makes a difference. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
shadowwisps
Posts: 15
Joined: Wed Apr 22, 2015 4:05 am

Re: [Core 4.0.8] - RHEL 6.

Post by shadowwisps »

Hi,

Thanks for that, I forgot to mention but I already checked that too.. its not running.

Cheers
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: [Core 4.0.8] - RHEL 6.

Post by jolson »

It sounds like the issue is on the Web GUI side of things - are there any httpd errors?

Code: Select all

tail -n20 /var/log/httpd/error_log
Would you mind posting your groups file?

Code: Select all

cat /etc/group
Best,


Jesse
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: [Core 4.0.8] - RHEL 6.

Post by Box293 »

How did you install core? Did you follow any guides?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
shadowwisps
Posts: 15
Joined: Wed Apr 22, 2015 4:05 am

Re: [Core 4.0.8] - RHEL 6.

Post by shadowwisps »

jolson wrote:It sounds like the issue is on the Web GUI side of things - are there any httpd errors?

Code: Select all

tail -n20 /var/log/httpd/error_log
This looks like the right place to look, ima going to investigate here.
After a restart:

Code: Select all

[Thu Apr 23 09:17:24 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Thu Apr 23 09:20:10 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Thu Apr 23 09:22:29 2015] [error] [client 10.30.87.200] File does not exist: /usr/local/nagios/share/index.html
[Thu Apr 23 09:22:29 2015] [error] [client 10.30.87.200] File does not exist: /var/www/html/favicon.ico
Before a restart:

Code: Select all

[Thu Apr 23 08:50:11 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Thu Apr 23 08:55:11 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Thu Apr 23 09:00:11 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Thu Apr 23 09:05:10 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
jolson wrote: Would you mind posting your groups file?

Code: Select all

cat /etc/group
Nope:

Code: Select all

root:x:0:
bin:x:1:bin,daemon
daemon:x:2:bin,daemon
sys:x:3:bin
adm:x:4:daemon
tty:x:5:
disk:x:6:
lp:x:7:daemon
mem:x:8:
kmem:x:9:
wheel:x:10:
mail:x:12:mail,postfix
man:x:15:
games:x:20:
gopher:x:30:
video:x:39:
dip:x:40:
ftp:x:50:
lock:x:54:
audio:x:63:
nobody:x:99:
users:x:100:
dbus:x:81:
utmp:x:22:
utempter:x:35:
floppy:x:19:
vcsa:x:69:
abrt:x:173:
cdrom:x:11:
tape:x:33:
dialout:x:18:
haldaemon:x:68:haldaemon
ntp:x:38:
saslauth:x:76:
postdrop:x:90:
postfix:x:89:
sshd:x:74:
tcpdump:x:72:
stapusr:x:156:
stapsys:x:157:
stapdev:x:158:
slocate:x:21:
rpc:x:32:
rpcuser:x:29:
nfsnobody:x:65534:
screen:x:84:
nagcmd:x:54755:nagios
shadowwisps
Posts: 15
Joined: Wed Apr 22, 2015 4:05 am

Re: [Core 4.0.8] - RHEL 6.

Post by shadowwisps »

Box293 wrote:How did you install core? Did you follow any guides?
Yes, followed http://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: [Core 4.0.8] - RHEL 6.

Post by jolson »

Code: Select all

root:x:0:
bin:x:1:bin,daemon
daemon:x:2:bin,daemon
sys:x:3:bin
adm:x:4:daemon
tty:x:5:
disk:x:6:
lp:x:7:daemon
mem:x:8:
kmem:x:9:
wheel:x:10:
mail:x:12:mail,postfix
man:x:15:
games:x:20:
gopher:x:30:
video:x:39:
dip:x:40:
ftp:x:50:
lock:x:54:
audio:x:63:
nobody:x:99:
users:x:100:
dbus:x:81:
utmp:x:22:
utempter:x:35:
floppy:x:19:
vcsa:x:69:
abrt:x:173:
cdrom:x:11:
tape:x:33:
dialout:x:18:
haldaemon:x:68:haldaemon
ntp:x:38:
saslauth:x:76:
postdrop:x:90:
postfix:x:89:
sshd:x:74:
tcpdump:x:72:
stapusr:x:156:
stapsys:x:157:
stapdev:x:158:
slocate:x:21:
rpc:x:32:
rpcuser:x:29:
nfsnobody:x:65534:
screen:x:84:
nagcmd:x:54755:nagios
You don't have an apache group or a nagios group. That strikes me as very odd.

The apache user will need to be part of the 'nagcmd' group:

Code: Select all

usermod -G nagcmd -a apache
After this, restart nagios and httpd:

Code: Select all

service nagios restart && service httpd restart
Check your error log at this point. Are there still http errors? Are the symptoms the same? If so, I think this has something to do with the missing 'nagios' and 'apache' groups.

Could you please post your /etc/passwd file if this doesn't resolve your error?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
shadowwisps
Posts: 15
Joined: Wed Apr 22, 2015 4:05 am

Re: [Core 4.0.8] - RHEL 6.

Post by shadowwisps »

Hi,

Thanks for that.
Both nagios and apache are defined in a central directory which is used amongst other things by this server. The only privileges carried are to do with authentication and network shares, neither of which are relevant here.

I had already checked permissions on the /usr/local/nagios/ directory and it was all set to global read and global execute for the sbin and share subdirs.
Just in case, I have still updated both the ownership (nagios:nagiocmd) and the group, but no change there.

Code: Select all

[PROD][root@eqdg3pperf005 nagios]# lid -g nagcmd
 nagios
 apache
I am still getting the http errors.. !

Code: Select all

[Fri Apr 24 09:18:34 2015] [notice] caught SIGTERM, shutting down
[Fri Apr 24 09:18:34 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Apr 24 09:18:34 2015] [notice] Digest: generating secret for digest authentication ...
[Fri Apr 24 09:18:34 2015] [notice] Digest: done
[Fri Apr 24 09:18:34 2015] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Fri Apr 24 09:20:00 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
[Fri Apr 24 09:25:00 2015] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: [Core 4.0.8] - RHEL 6.

Post by jolson »

Regarding 'Directory index forbidden by Options directive:
Either the main httpd.conf or the .htaccess file in this directory or a nearby parent directory probably includes:
Options -Indexes
Your host may have to set it to +Indexes if you don't have access in .htaccess
Both nagios and apache are defined in a central directory which is used amongst other things by this server. The only privileges carried are to do with authentication and network shares, neither of which are relevant here.
Can you please expand on what you mean here? I still do not understand why the 'nagios' group and the 'apache' group do not exist. When nagios is compiled, the flag --with-nagios-group=nagios is implied, which leads me to believe that problems could exist if the nagios group does not.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked