Tuesday, September 22, 2015

How to install Nagios in Centos 6.5 via yum


yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp
wget http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
yum install nagios*

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
service iptables restart

vi /etc/nagios/objects/contacts.cfg
email                         user@example.com ;

vi /etc/httpd/conf.d/nagios.conf
## Comment Lines 15 & 16 ##
#   Order allow,deny
#   Allow from all

## Uncomment and Change lines 17,18 & 19 as shown below ##
Order deny,allow
Deny from all
Allow from 127.0.0.1 10.50.249.0/24

htpasswd /etc/nagios/passwd nagiosadmin
New password:
Re-type new password:
Updating password for user nagiosadmin

service nagios start
# service httpd start
# chkconfig nagios on
# chkconfig httpd on

http://nagios-server-ip/nagios

vi /etc/nagios/nagios.cfg

cfg_dir=/etc/nagios/servers

mkdir /etc/nagios/servers

Put
Client End

yum install nrpe nagios-plugins-all openssl

vi /etc/nagios/nrpe.cfg
## Line 81 - Add the Nagios server IP ##
allowed_hosts=127.0.0.1 10.50.249.0/24


service nrpe start
chkconfig nrpe on


0 comments:

Post a Comment