Nagios Installation Guide environment: rhel6.2 software: nagios-3.3.1.tar.gz1, minimal installation system 2. install missing plug-ins yuminstall-yhttpdhttp-develmysqlmysql-develmysql-servergccgliglibc-commongdgd-develphpmakephp-develphp-gdntpmak
Nagios Installation Guide
Environment: rhel6.2
Software: nagios-3.3.1.tar.gz
1. Minimize system installation
2. install missing plug-ins
Yum install-y httpd http-devel mysql-server gcc glibc-common gd-devel php make php-devel php-gd ntp make net-snmp -devel
3. Create a nagios user and a nagcmd group to allow the user to execute commands on the web.
Useradd-m nagios
Groupadd nagcmd
Usermod-a-G nagcmd nagios
Usermod-a-G nagcmd apache
3. Compile and install nagios
./Configure -- with-gd-lib =/usr/local/lib -- with-command-group = nagcmd -- prefix =/var/www/html/nagios
Make all
Make install
Make install-init
Make install-config
Make install-commandmode
4. Modify the mail box and apache configuration file
Vi/var/www/html/nagios/etc/objects/contacts. cfg
Copy the segment in nagios-3.2.3/sample-config/httpd. conf to/etc/httpd/conf/httpd. conf
5. Add a logon authentication File
Htpasswd-c/var/www/html // nagios/etc/htpasswd. users nagiosadmin
6. Install the nagios-plugins plugin
Tar-zvxf nagios-plugins-1.4.15.tar.gz
Cd nagios-plugins-1.4.15
./Configure -- with-nagios-user = nagios -- with-nagios-group = nagios -- prefix =/var/www/html/nagios
Make & make install
7. nagios Testing
Chown nagios: nagios/var/www/html/nagios/-R
/Etc/init. d/httpd restart
Chkconfig httpd on
/Etc/init. d/nagios start
8. Install nrpe
Tar xzvf nrpe-2.12.tar.gz
Cd nrpe-2.12
./Configure
Make all
Make install-plugin
Make install-daemon
Make install-daemon-config
Make install-xinetd
9. Modify the nrpe Configuration
Edit/etc/xinetd. d/nrpe
Only_from = 127.0.0.1 # Only one IP address can be added here
Edit/etc/services and add
Nrpe 5666/tcp # NRPE
Edit/var/www/html/nagios/etc/objects/commands. cfg on the monitoring host and add the following command.
[Plain] view plaincopy
Define command {
Command_name check_nrpe
Command_line $ USER1 $/check_nrpe-H $ HOSTADDRESS $-c $ ARG1 $
}
10. Configure the snmp service
Yum install net-snmp-devel net-snmp-libs net-snmp-utils
Chkconfig-level 35 snmpd on
Service snmpd start
Vi/etc/snmp/snmpd. conf
Modify com2sec notConfigUser default public
Com2sec notConfigUser 127.0.0.1 public
Modify access notConfigGroup "" any noauth exact systemview none
Access notConfigGroup "" any noauth exact all none
And enable view all supported ded. 1 80;