I. Software Installation
Ll
-Rwxrwxr-x 1 root 9097591 2009-12-31 nagios-20091231.tar.bz2
1. decompress the Software Package
Tar jxvf nagios-20091231.tar.bz2
2. Installation
/Soft/monitoring/nagios/bin/
./Install. sh
3.
Check the configuration file
Rpm-ql nagios
/Etc/httpd/conf. d/nagios. conf
/Etc/logrotate. d/nagios
/Etc/nagios
/Etc/nagios/cgi. cfg
/Etc/nagios/commands. cfg
/Etc/nagios/localhost. cfg
/Etc/nagios. cfg
/Etc/nagios/private
/Etc/nagios/private/resource. cfg
/Etc/rc. d/init. d/nagios
/Usr/bin/nagiostats
4. Add a startup Item
Chkconfig -- add nagios
Chkconfig nagios on
5. Check whether the configuration file is correct
Root @ monitor nagios] # nagios-v nagios. cfg
6. Start the service
/Etc/init. d/nagios start
7. View service processes
Ps axw | grep nagios
24782? Ssl 0: 00/usr/sbin/nagios-d/etc/nagios. cfg
24800 pts/1 R + grep nagios
8. Configure Access Control
[Root @ monitor nagios] # cd/etc/httpd/conf. d/
[Root @ monitor conf. d] # ls
Cacti. conf nagios. conf php. conf python. conf squid. conf webalizer. conf
Manual. conf perl. conf proxy_ajp.conf README ssl. conf welcome. conf
Vi nagios. conf
1 ScriptAlias/nagios/cgi-bin // usr/lib/nagios/cgi-bin/
2 <Directory/usr/lib/nagios/cgi-bin/>
3 Options ExecCGI
4 order deny, allow
5 deny from all
6 allow from 127.0.0.1
7 allow from 10.24.29.0 # set to allow access from other network segments
8 AuthType Basic
9 AuthUserFile/etc/nagios/passwd
10 AuthName "nagios"
11 require valid-user
12 </Directory>
13
14 Alias/nagios // usr/share/nagios/html/
15 <Directory/usr/share/nagios/html/>
16 Options None
17 order deny, allow
18 deny from all
19 allow from 127.0.0.1
20 allow from 10.24.29.0 # set to allow access from other network segments
21 AuthType Basic
22 AuthType Basic
23 AuthUserFile/etc/nagios/passwd # access password storage location
9. Create a password for logging on to nagios
[Root @ monitor conf. d] # cd/etc/nagios/
[Root @ monitor nagios] # ls
Cgi. cfg commands. cfg localhost. cfg nagios. cfg private
10. Add logon User Password
[Root @ monitor nagios] # htpasswd-bmc passwd michael
Adding password for user Michael
11. Verify user and password generation
[Root @ monitor nagios] # ls
Cgi. cfg commands. cfg localhost. cfg nagios. cfg passwd private
[Root @ monitor nagios] # pwd
/Etc/nagios
Root @ monitor nagios] # cat passwd
Michael: $ apr1 $ NOb5F... $/Hlz07.veQcIM/ucJdkX50
12. Restart the WEB Service
Root @ monitor nagios] #/etc/init. d/httpd restart
13. Page access test
14. Modify WEB Access Management Permissions
[Root @ monitor nagios] # pwd
/Etc/nagios
[Root @ monitor nagios] # ls
Cgi. cfg commands. cfg localhost. cfg nagios. cfg passwd private
[Root @ monitor nagios] # sed-I's/^ # \ (authorized_for. * \) =. * $/\ 1 = michael/g'cgi. cfg # Sort script modifications to files
Authorize the Access Management of Michal
[Root @ monitor nagios] # grep authorized cgi. cfg
Verify
Authorized_for_system_information = michael
Authorized_for_configuration_information = michael
Authorized_for_system_commands = michael
Authorized_for_all_services = michael
Authorized_for_all_hosts = michael
Authorized_for_all_service_commands = michael
Authorized_for_all_host_commands = Michael
15. login verification
Login successful! Monitoring Device addition and configuration file modification To be continued ...............
Author: "Kang Jianhua"