Chapter 2. Nagios Core installation and configuration
As a storage administrator, you can install Nagios Core by downloading the Nagios Core source code; then, configuring, making and installing it on the node that will run Nagios Core instance.
2.1. Installing and configuring the Nagios Core server from source Copy linkLink copied to clipboard!
There is not a Red Hat Enterprise Linux package for the Nagios Core software, so the Nagios Core software must be compiled from source.
Prerequisites
- Access to OpenSSL.
- Internet access.
Procedure
Install the prerequisites:
yum install -y httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl openssl-devel wget unzip
[user@nagios]# yum install -y httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl openssl-devel wget unzipCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open port
80forhttpd:firewall-cmd --zone=public --add-port=80/tcp firewall-cmd --zone=public --add-port=80/tcp --permanent
[user@nagios]# firewall-cmd --zone=public --add-port=80/tcp [user@nagios]# firewall-cmd --zone=public --add-port=80/tcp --permanentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a user and group for Nagios Core:
useradd nagios passwd nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -a -G nagcmd apache
[user@nagios]# useradd nagios [user@nagios]# passwd nagios [user@nagios]# groupadd nagcmd [user@nagios]# usermod -a -G nagcmd nagios [user@nagios]# usermod -a -G nagcmd apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the latest version of Nagios Core and Plug-ins:
wget --inet4-only https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.1.tar.gz wget --inet4-only http://www.nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz tar zxf nagios-4.3.1.tar.gz tar zxf nagios-plugins-2.2.1.tar.gz cd nagios-4.3.1
[user@nagios]# wget --inet4-only https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.1.tar.gz [user@nagios]# wget --inet4-only http://www.nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz [user@nagios]# tar zxf nagios-4.3.1.tar.gz [user@nagios]# tar zxf nagios-plugins-2.2.1.tar.gz [user@nagios]# cd nagios-4.3.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
./configure:./configure --with-command-group=nagcmd
[user@nagios]# ./configure --with-command-group=nagcmdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Compile the Nagios Core source code:
make all
[user@nagios]# make allCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install Nagios source code:
make install make install-init make install-config make install-commandmode make install-webconf
[user@nagios]# make install [user@nagios]# make install-init [user@nagios]# make install-config [user@nagios]# make install-commandmode [user@nagios]# make install-webconfCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the event handlers and change their ownership:
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
[user@nagios]# cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ [user@nagios]# chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlersCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the pre-flight check:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
[user@nagios]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make and install the Nagios Core plug-ins:
cd ../nagios-plugins-2.2.1 ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install
[user@nagios]# cd ../nagios-plugins-2.2.1 [user@nagios]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios [user@nagios]# make [user@nagios]# make installCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a user for the Nagios Core user interface:
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
[user@nagios]$ sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadminCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantIf adding a user other than
nagiosadmin, ensure the/usr/local/nagios/etc/cgi.cfgfile gets updated with the username too.Also modify the
/usr/local/nagios/etc/objects/contacts.cfgfile with the user name, full name and email address as needed.
2.2. Starting the Nagios Core service Copy linkLink copied to clipboard!
Start the Nagios Core service to monitor the Red Hat Ceph Storage cluster health.
Prerequisites
- Root-level access to the Nagios Core service.
Procedure
Add Nagios Core as a service and enable it:
chkconfig --add nagios chkconfig --level 35 nagios on
[user@nagios]# chkconfig --add nagios [user@nagios]# chkconfig --level 35 nagios onCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the Nagios Core daemon and Apache:
systemctl start nagios systemctl enable httpd systemctl start httpd
[user@nagios]# systemctl start nagios [user@nagios]# systemctl enable httpd [user@nagios]# systemctl start httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Logging into the Nagios Core server Copy linkLink copied to clipboard!
Log in to the Nagios Core server to view the health status of the Red Hat Ceph Storage cluster.
Prerequisites
- User name and password for the Nagios web interface.
Procedure
With Nagios up and running, log in to the web user interface:
http://IP_ADDRESS/nagios
http://IP_ADDRESS/nagiosCopy to Clipboard Copied! Toggle word wrap Toggle overflow Nagios Core will prompt for a user name and password.
- Input the login and password of the default Nagios Core user.