# Create a user
Useradd nagios
Passwd nagios
Groupadd nagcmd
Usermod-a-G nagcmd nagios
Usermod-a-G nagcmd apache
# Install basic package
Yum install-y gcc glibc-common
Yum install-y gd-devel
Yum install-y libtool-ltdl
# Download
Wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz
# Decompress
Tar-zvxf nagios-3.4.1.tar.gz
Cd nagios
# Installation
./Configure-with-command-group = nagcmd
Make all
# Configuration
Vi/usr/local/nagios/etc/objects/contacts. cfg
# Modify the email address above
# Create an administrator password
Htpasswd-c/usr/local/nagios/etc/htpasswd. users nagiosadmin
# Restart apache
Service httpd restart
# Set startup
Chkconfig-add nagios
Chkconfig nagios on
Service nagios start
Install the nagios plugin
# Download
Wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
# Decompress
Tar xzf nagios-plugins-1.4.16.tar.gz
Cd nagios-plugins-1.4.16
# Installation
./Configure-with-nagios-user = nagios-with-nagios-group = nagios
Make
Make install
Logon address:
Http: // ip/nagios
Administrator name: nagiosadmin
Troubleshooting
/Usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios. cfg/usr/local/nagios/bin/nagios: error while loading shared libraries: libltdl. so.7: cannot open shared object file: No such file or directory
Find/-name libltdl. so.7
Ln-s/usr/local/lib/libltdl. so.7/usr/lib/libltdl. so.7