Page 1 of 2

Nagios Core Error

Posted: Tue Jun 23, 2015 7:01 am
by venkatklr
Hi Friends,

I have installed Nagios core on CentOS 7 and web page is opening with error "Nagios core not running"and also when I click on Hosts, getting "Error: Could not read object configuration data!" Can some one help me how to fix it.

Thanks,
Venkat

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 9:21 am
by jdalrymple
When you installed, did you disable selinux as a first step?

Post the output of the following 2 commands:

Code: Select all

[jdalrymple@localhost ~]$ ls -l /usr/local/nagios/var
[jdalrymple@localhost ~]$ ls -l /usr/local/nagios/var/rw

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 9:27 am
by venkatklr
I have installed it today.

Please refer the attachment.

Please reach me @ *** DO NOT POST PERSONAL EMAIL ADDRESSES *** for more information.

Thank you for support.

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 9:42 am
by jolson
It looks like you're missing the 'rw' directory. Unless I'm missing something, this is likely an indication of an improper installation. You will need to disable SELinux and reinstall for a quick resolution.

Please ensure that SELinux is disabled on the target system:

Code: Select all

sestatus
Install all pre-requisite packages:

Code: Select all

yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp unzip automake

Download Nagios Core and Nagios Plugins Tarballs

Code: Select all

cd /tmp
wget https://github.com/NagiosEnterprises/nagioscore/archive/master.tar.gz -O nagioscore.tar.gz
wget https://github.com/nagios-plugins/nagios-plugins/archive/master.tar.gz -O nagiosplugins.tar.gz

Add Nagios User and Group

Code: Select all

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Nagios Core Installation

Code: Select all

tar xzf nagioscore.tar.gz
tar xzf nagiosplugins.tar.gz
Change to the Nagios Core directory:

Code: Select all

cd nagioscore-master
Run the configure command to get the source code ready for compilation:

Code: Select all

./configure --with-command-group=nagcmd
Compile and install:

Code: Select all

make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
Complete the installation:

Code: Select all

cp -R contrib/eventhandlers /usr/local/nagios/libexec
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
Run the Nagios verification command to ensure the install completed properly, and start Nagios:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start

Create a Default User for Web Access

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
systemctl start httpd

Nagios Plugin Installation

Code: Select all

cd /tmp/nagios-plugins-master/
./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Nagios Service Setup

Code: Select all

chkconfig --add nagios
chkconfig --level 35 nagios on
systemctl enable httpd

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 9:46 am
by venkatklr
I don't have much knowledge on Linux, please tell me how to disable it and please send me installation steps in doc format Please.

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 9:58 am
by jolson
To disable SELinux, type the following command as root on the CLI:

Code: Select all

sed -i s/SELINUX=enforcing/SELINUX=disabled/ /etc/sysconfig/selinux && sed -i s/SELINUX=permissive/SELINUX=disabled/ /etc/sysconfig/selinux
After the above command has been typed, reboot your server. Once the server has been rebooted, simply follow the above instructions line-by-line and that's all you will need to do to have a fully functional core install.

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 10:52 am
by venkatklr
Thanks for the info. I will follow these steps and let you know if I face any issue.

Thanks,
Venkat

Re: Nagios Core Error

Posted: Tue Jun 23, 2015 10:56 am
by jolson
Let us know what you find out. Thanks Venkat.

Re: Nagios Core Error

Posted: Wed Jun 24, 2015 1:19 am
by venkatklr
It is working now. I really appreciate for your time and support to resolve this issue. Now I want to know how to add host in Nagios to monitor, kindly share if any documents available or steps to get this done.

Thanks,
Venkat

Re: Nagios Core Error

Posted: Wed Jun 24, 2015 1:41 am
by Box293
This links to a guide that should help:

http://nagios.sourceforge.net/docs/nagi ... ndows.html