Skip to main content

Nagios Core – Installing on Centos 7/8 -100% Working.

Disable SELinux.

Prior to starting our install, we need to disable SELinux.

#setenforce 0

 Modify

 #vim /etc/selinux/config and change enforcing to disabled.

Install Prerequisites.

We now need to install the programs that Core will need in order to function / install properly.

#yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl-devel wget unzip -y

Now, let's create a user and group for Nagios to use.

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

Download and Install Nagios This is where we will download the required .tar.gz files for Nagios and Nagios Plugins.

#cd /tmp
#wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz wget #http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz

Now that the files are extracted, let's start compiling Nagios!

#./configure --with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconf

Creating a password for nagiosadmin.We now need to create a password for the nagiosadmin user. This will be used to login to your core web GUI.

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

Install Nagios Plugins Now that Nagios is installed, we need to install the plugins so that it can utilize them for checks. 

#cd /tmp/nagios-plugins-2.1.1
#./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
#make all
#make install

Start Nagios If everything worked correctly prior to this, you will be able to start your Nagios Core service. 

#service httpd start
#service nagios start

You should now be able to access your machine by navigating to http://nagiosip/nagios/ - if this does not work then please try these two troubleshooting steps.





Comments

Popular posts from this blog

Terraform Commands

  Terraform Cheat Sheet terraform version $ terraform version Terraform v1.0.1 on darwin_amd64 terraform init $ terraform init Ask for input if necessary. If false, will error if input was required. $ terraform init -input=false You can also change the backend details using  -backend-config  option.,  reconfigure  will reconfigure the backend, ignoring any saved configuration . $ terraform init -backend-config=PATH/TO/CONFIGURATION_FILE -reconfigure