This will ensure that all the settings made to nagios configuration file are correct & if there is any issue with file, it will report that as well. Last step is now to verify Nagios configuration file against a sample configuration file ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Installation of nagios plugins is also complete. configure -with-nagios-user=nagios -with-nagios-group=nagios So open the directory with nagios plugin files & then we will compile & install the plugins ~]# cd nagios-plugins-2.2.1/ We have now completed installation for nagios core but we need to install plugins as without them we can’t monitor the resources. ~]# systemctl restart httpd Step:7 Installing the Nagios Plugins Next, restart apache server for changes to take effect. To configure an email, open ~]# vi /usr/local/nagios/etc/objects/contacts.cfg By configuring an email to receive alerts on nagios, you will remain informed of all the server activities 24/7. Though this is an optional step but consider doing it. nagios-4.3.2]# Step:6 Configuring email alerts
We will create default password for user by issuing the following command, nagios-4.3.2]# htpasswd -s -c /usr/local/nagios/etc/ers nagiosadmin Web interface will be installed with a default user by the name ‘ nagiosadmin‘ but there will be no default password for the user. To install web interface, run nagios-4.3.2]# make install-webconf We will now install the web interface for the nagios, as we will be using web interface for monitoring the resources of the client systems. nagios-4.3.2]# make install-config Step:5 Configuring Nagios Core Web-Interface nagios-4.3.2]# make installĪfter running these, we need to install init scripts, command mode (to make nagios work from CLI) & also need to install some sample Nagios files nagios-4.3.2]# make install-init Next we will install the compiled nagios package by running, nagios-4.3.2]# make all We are now ready to install the nagios on our server, so go to the folder with extracted nagios core files & compile the extracted files ~]# cd nagios-4.3.2 ~]# usermod -G nagcmd apache Step:4 Installing Nagios core Once the user & group has been added, we will now add the user nagios & apache user to the created group i.e. Next step is to create a user named ‘ nagios‘ & a group named ‘ nagcmd‘ for running nagios, ~]# useradd nagios ~]# tar -zxpvf nagios-plugins-2.2.1.tar.gz Step:3 Create user and group for Nagios To extract the packages, run following commands ~]# tar -zxvf nagios-4.3.2.tar.gz
The download links are mentioned below ~]# wget
Next thing to do is to download & extract the nagios & its plugins files. We need to install some essential packages like apache, php & packages required for building the source packages, use below command to install these pakages ~]# yum install httpd php gcc glibc glibc-comman gd gd-devel make net-snmp unzip -y Step:2 Downloading and extracting the Nagios packages