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 the 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
- Internet access.
- Root-level access to the Nagios Core host.
Procedure
Install the prerequisites:
Example
dnf install -y httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl openssl-devel wget unzip make
[root@nagios ~]# dnf install -y httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl openssl-devel wget unzip makeCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you are using a firewall, open port
80forhttpd:Example
firewall-cmd --zone=public --add-port=80/tcp firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@nagios ~]# firewall-cmd --zone=public --add-port=80/tcp [root@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:
Example
useradd nagios passwd nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -a -G nagcmd apache
[root@nagios ~]# useradd nagios [root@nagios ~]# passwd nagios [root@nagios ~]# groupadd nagcmd [root@nagios ~]# usermod -a -G nagcmd nagios [root@nagios ~]# usermod -a -G nagcmd apacheCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the latest version of Nagios Core and Plug-ins:
Example
wget --inet4-only https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.5.tar.gz wget --inet4-only http://www.nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz tar zxf nagios-4.4.5.tar.gz tar zxf nagios-plugins-2.3.3.tar.gz cd nagios-4.4.5
[root@nagios ~]# wget --inet4-only https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.5.tar.gz [root@nagios ~]# wget --inet4-only http://www.nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz [root@nagios ~]# tar zxf nagios-4.4.5.tar.gz [root@nagios ~]# tar zxf nagios-plugins-2.3.3.tar.gz [root@nagios ~]# cd nagios-4.4.5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
./configure:Example
[root@nagios nagios-4.4.5]# ./configure --with-command-group=nagcmd
[root@nagios nagios-4.4.5]# ./configure --with-command-group=nagcmdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Compile the Nagios Core source code:
Example
[root@nagios nagios-4.4.5]# make all
[root@nagios nagios-4.4.5]# make allCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install Nagios source code:
Example
[root@nagios nagios-4.4.5]# make install [root@nagios nagios-4.4.5]# make install-init [root@nagios nagios-4.4.5]# make install-config [root@nagios nagios-4.4.5]# make install-commandmode [root@nagios nagios-4.4.5]# make install-webconf
[root@nagios nagios-4.4.5]# make install [root@nagios nagios-4.4.5]# make install-init [root@nagios nagios-4.4.5]# make install-config [root@nagios nagios-4.4.5]# make install-commandmode [root@nagios nagios-4.4.5]# make install-webconfCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the event handlers and change their ownership:
Example
[root@nagios nagios-4.4.5]# cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ [root@nagios nagios-4.4.5]# chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
[root@nagios nagios-4.4.5]# cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/ [root@nagios nagios-4.4.5]# chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlersCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the pre-flight check:
Example
[root@nagios nagios-4.4.5]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
[root@nagios nagios-4.4.5]# /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:
Example
cd ../nagios-plugins-2.3.3
[root@nagios ~]# cd ../nagios-plugins-2.3.3 [root@nagios nagios-plugins-2.3.3]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios [root@nagios nagios-plugins-2.3.3]# make [root@nagios nagios-plugins-2.3.3]# make installCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a user for the Nagios Core user interface:
Example
[root@nagios nagios-plugins-2.3.3]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
[root@nagios nagios-plugins-2.3.3]# 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 user name too.-
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 host.
Procedure
Add Nagios Core and Apache as a service:
Example
systemctl enable nagios systemctl enable httpd
[root@nagios ~]# systemctl enable nagios [root@nagios ~]# systemctl enable httpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start the Nagios Core daemon and Apache:
Example
systemctl start nagios systemctl start httpd
[root@nagios ~]# systemctl start nagios [root@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 dashboard.
Procedure
With Nagios up and running, log in to the dashboard using the credentials of the default Nagios Core user:
Syntax
http://IP_ADDRESS/nagios
http://IP_ADDRESS/nagiosCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace IP_ADDRESS with the IP address of your Nagios Core server.