Differences
This shows you the differences between two versions of the page.
— |
how-to-install-nagios-on-centos-6 [2014-07-01 01:30:33] (current) shaun.reitan created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How to install Nagios on CentOS 6 ====== | ||
+ | |||
+ | Nagios is a powerful monitoring system that monitors your servers and/or services and alerts staff if a problem should arise. | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | ==== Install required packages ==== | ||
+ | |||
+ | <code console> | ||
+ | yum -y install http:// | ||
+ | yum -y install nagios nagios-plugins-all | ||
+ | </ | ||
+ | |||
+ | ==== Create blank index.html ==== | ||
+ | |||
+ | If you do not do this you will get a warning from nagios when it checks itself to make sure apache is running. | ||
+ | |||
+ | <code console> | ||
+ | touch / | ||
+ | </ | ||
+ | |||
+ | ==== Set services to start on boot ==== | ||
+ | |||
+ | <code console> | ||
+ | chkconfig httpd on | ||
+ | chkconfig nagios on | ||
+ | </ | ||
+ | |||
+ | ==== Change nagiosadmin password ==== | ||
+ | |||
+ | By default the web interface is password protected, the default user is nagiosadmin so we'll change this users password. | ||
+ | |||
+ | <code console> | ||
+ | htpasswd -c / | ||
+ | </ | ||
+ | |||
+ | ==== Change default contact address ==== | ||
+ | |||
+ | By default alerts will be sent to nagios@localhost. | ||
+ | |||
+ | ==== Start Services ==== | ||
+ | |||
+ | <code console> | ||
+ | service httpd start | ||
+ | service nagios start | ||
+ | </ | ||
+ | |||
+ | ==== Web Interface ==== | ||
+ | |||
+ | You can now open your browser and goto your server' | ||
+ | |||
+ | Example: http:// | ||
+ | |||
+ | ===== Monitoring a remote server ===== | ||
+ | |||
+ | We will now create a configuration file to monitor an additional host. We will monitor ICMP and SSH | ||
+ | |||
+ | Create and edit a file in / | ||
+ | |||
+ | < | ||
+ | define host { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | define service { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | define service { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Next you need to reload nagios | ||
+ | |||
+ | <code console> | ||
+ | service nagios reload | ||
+ | </ | ||
+ | |||
+ | |||