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.
So I'm working on installing Nagios 4 on a fresh Centos 7 VM and I did all the steps as outlind in this article http://tecadmin.net/install-nagios-core ... ntos-rhel/# but I'm stuck at step 6 which is to verify Nagios install by running the command below
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Error in configuration file '/usr/local/nagios/etc/nagios.cfg' - Line 452 (Check result path '/usr/local/nagios/var/spool/checkresults' is not a valid directory)
Error processing main config file!
Anyways I know very little about CentOS but I need to resolve this issue and need advice on how to go about doing it.
i ran through a fresh install, and made the mistake of not disabling SELinux the other day. I ran into the exact same issue. Can you confirm that SELinux is running on your machine with the command getenforce?
I'm setting up a test machine to replicate this now, as well.
I ran through testing this morning, and the underlying issue is having SELinux enabled when you compile Nagios. It ends up not creating some folders / files, as well as permissions. I wrote up these instructions this morning. You will be better off to install it the proper way. While they are not official yet (still have to go through testing) they should work.
These assume a fresh install of Centos 7, minimal. I am disabling SELinux in these instructions.
SELINUX:
setenforce 0
nano /etc/selinux/config
change enforcing -> disabled, save and close.
DOWNLOAD & INSTALL NAGIOS:
cd /tmp
wget https://assets.nagios.com/downloads/nag ... 1.1.tar.gz
wget http://www.nagios-plugins.org/download/ ... 1.1.tar.gz
tar zxf nagios-4.1.1.tar.gz
tar zxf nagios-plugins-2.1.1.tar.gz
cd nagios-4.1.1
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
service httpd start
service nagios start
PLUGINS:
cd /tmp/nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make all
make install
service nagios restart
POSSIBLE ERRORS:
Can't access web page? Check firewalld and at port 80 through.
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
Still can't access web page? Check IPV6 listening in the apache configuration.
modify /etc/httpd/conf/httpd.conf
Listen 0.0.0.0:80
service httpd restart
# /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
/usr/bin/install: cannot stat ‘sample-config/httpd.conf’: No such file or directory
# service nagios start
Starting nagios (via systemctl): Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.
[FAILED]
rkennedy wrote:I ran through testing this morning, and the underlying issue is having SELinux enabled when you compile Nagios. It ends up not creating some folders / files, as well as permissions. I wrote up these instructions this morning. You will be better off to install it the proper way. While they are not official yet (still have to go through testing) they should work.
These assume a fresh install of Centos 7, minimal. I am disabling SELinux in these instructions.
SELINUX:
setenforce 0
nano /etc/selinux/config
change enforcing -> disabled, save and close.
DOWNLOAD & INSTALL NAGIOS:
cd /tmp
wget https://assets.nagios.com/downloads/nag ... 1.1.tar.gz
wget http://www.nagios-plugins.org/download/ ... 1.1.tar.gz
tar zxf nagios-4.1.1.tar.gz
tar zxf nagios-plugins-2.1.1.tar.gz
cd nagios-4.1.1
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
service httpd start
service nagios start
PLUGINS:
cd /tmp/nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make all
make install
service nagios restart
POSSIBLE ERRORS:
Can't access web page? Check firewalld and at port 80 through.
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
Still can't access web page? Check IPV6 listening in the apache configuration.
modify /etc/httpd/conf/httpd.conf
Listen 0.0.0.0:80
service httpd restart
I'll try to do a fresh install again with your instructions and see how that works for me.