This is a description of the installation process of NAGIOS monitoring on two Fedora21 based servers.
Choose one server as the main nagios host. Lets call it nas1.
Add nagios users , group and add apache as member in the nagios group:
# useradd nagios
# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd apache
Install nagios binaries on nas1:
# yum install -y nagios
Install all the nagios plugins on nas1:
# yum install -y nagios-*
Start nagios service and enable it at server start.
# systemctl start nagios
# systemctl enable nagios
Change the default password for nagiosadmin user. This will be the user used to login to the nagios web interface.
# htpasswd -C /etc/nagios/passwd nagiosadmin
Restart the Apache service.
# systemctl restart httpd
To access the nagios web interface simply point your browser to https://nas1/nagios
Add a second linux host nas2 to Nagios monitoring server nas1 using the NRPE Plugin.
First do on nas2 the following installation steps:
Add nagios users , group and add apache as member in the nagios group:
# useradd nagios
# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd apache
Install nagios binaries on nas1:
# yum install -y nagios
Install all the nagios plugins on nas1:
# yum install -y nagios-*
Start nagios service and enable it at server start.
# systemctl start nagios
# systemctl enable nagios
Edit the nrpe config file
# vi /etc/nagios/nrpe.cfg
Change the following from default to:
- allowed_hosts=nas1
Start the nrpe daemon and enable at server start.
# systemctl start nrpe
# systemctl enable nrpe
Check the status of nrpe to see the port and allowed hosts
# systemctl status nrpe
In case a firewall is active on nas2 add a rule:
# iptables -A INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
# service iptables save
On the Nagios monitoring server nas1 we already have installed the nrpe plugin the remaining steps are:
- Create a Nagios command definition using the check_nrpe plugin.
- Create Nagios host and add service definitions for monitoring the remote Linux host.
TO BE CONTINUED …
[paypal_donation_button]