One, add users
Groupadd Nagcmd
Useradd-g Nagcmd Nagios
passwd Nagios
123456
usermod-a-G nagcmd Apache
Ii. installation of Nagios
Cd/root/download
wget http://jaist.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.7/nagios-4.0.7.tar.gz
can also be downloaded from here: http://www.nagios.org/download/
tar xzvf nagios-4.0.7.tar.gz
CD nagios-4.0.7
./configure--with-command-group=nagcmd--enable-event-broker
Make all
Make install
Make Install-init
Make Install-config
Make Install-commandmode
Make install-webconf
Set the password for HTTP authentication when landing the Web interface
Htpasswd-c/usr/local/nagios/etc/htpasswd.users Nagiosadmin
Service httpd Restart
Third, installation Nagios-plugins
Cd/root/download
wget http://nagios-plugins.org/download/nagios-plugins-2.0.2.tar.gz
Tar xzvf nagios-plugins-2.0.2.tar.gz
CD nagios-plugins-2.0.2
./configure--with-nagios-user=nagios--with-nagios-group=nagios--with-mysql
Make
Make install
All plug-in commands will be installed in the/usr/local/nagios/libexec directory
Iv. Other Settings
1. Detection of Nagios Configuration
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
2. Add Auto-Move Item
chkconfig--add Nagios
Chkconfig Nagios on
Service Nagios Start
3. Landing Page
Http://localhost/nagios
Account nagiosadmin Password 123456
V. Problems encountered
Click map and History error on the left side of the page:
The requested url/nagios/sbin/statusmap.cgi is not found on this server.
The requested url/nagios/sbin/histogram.cgi is not found on this server.
Reason one: Because Gd-devel PHP-GD does not have an installation problem, Nagios does not generate this statusmap.cgi at compile time
Reason two: Nagios is compiled in front, Gd-devel installed after, resulting in not generating this statusmap.cgi
This article is from the "Moon Ching Xing Fei" blog, please be sure to keep this source http://ywzhou.blog.51cto.com/2785388/1531926