Jump to content

Nagios on RHEL 7


Cowboy Denny
 Share

Recommended Posts

Here are my notes when I deployed Nagios on a RHEL 7 box

SELinux has to be disabled or in permissive mode. Steps to do this are as follows.

sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config 
setenforce 0

Install the Pre-Req's

yum install -y gcc glibc glibc-common wget unzip httpd php gd gd-devel perl postfix
yum install openssl-devel

Download Nagios

cd /tmp
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.7.tar.gz
tar xzf nagioscore.tar.gz

Compile files to install

cd /tmp/nagioscore-nagios-4.4.7/
./configure
make all

Create User and Group

make install-groups-users
usermod -a -G nagios apache

Install Binaries

make install

Install Service / Daemon

make install-daemoninit
systemctl enable httpd.service

Install Command Mode

make install-commandmode

Install Sample Config Files

make install-config

Install Apache Files

make install-webconf

Configure Firewall

firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-port=80/tcp --permanent

Create nagios admin account

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

When adding additional users in the future, you need to remove -c from the above command otherwise it will replace the existing nagiosadmin user (and any other users you may have added).

Start Apache Web Service

systemctl start httpd.service

Start Nagios Service / Damon

systemctl start nagios.service

Test Nagios

http://<IPaddress OR FQDN>/nagios

Install Necessary Plugins

yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils epel-release
yum install -y perl-Net-SNMP

if the above doesn't work try this on the RHEL 7 instance

cd /tmp
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ihv epel-release-latest-7.noarch.rpm
subscription-manager repos --enable=rhel-7-server-optional-rpms
yum install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils
yum install -y perl-Net-SNMP

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...