Nagios Installation in Linux
Release:
RedHat Enterprise Linux
Problem:
Install Nagios system monitoring tool in RedHat Enterprise Server.
Solution:
- Download the Nagios from the below link
- Install the require RPMs
# yum install httpd php
# yum install gcc glibc gd gd-devel
- Create a user account to install the nagios
# useradd nagios
# passwd nagios
- Create a new group and add both nagios and apache users in that group
# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd apache
- Compile and install the nagios
# tar zxvf nagios-xxx.tar.gz
# cd nagios-xxx
# ./configure –with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make install-commandmode
- Sample configuration files are available in the below directory
# cd /usr/local/nagios/etc
- Customize the below file to send alerts to the mail id
# vi /usr/local/nagios/etc/objects/contacts.cfg
- configure the web interface by using the below command
# make install-webconf
- Create a login account to login into nagios web interface.
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Note: Here “nagiosadmin” is the user account to login in the web interface.
- Restart the httpd service
# service httpd restart
- Compile and install the nagios plugins
# tar -zxvf nagois-plugins-xxx.tar.gz
# cd nagios-plugins-xxx
# ./configure –with-nagios-user=nagio –with-nagios-group=nagios
# make
# make install
- Add the nagios service to the system service by using the below commands
# chkconfig –add nagios
# chkconfig nagios on
- Verify the nagios configuration file and start the service
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# service nagios start
- Access the nagios web interface by using the below URL.
No comments:
Post a Comment