Saturday 10 March 2012

How to install NAGIOS Server

Nagios is a popular open source computer system monitor, network monitoring and infrastructure monitoring software application. Nagios offers complete monitoring and alerting for servers, switches, applications, and services and is considered as the defacto industry standard In IT Infrastructure Monitoring. It watches hosts and services, alerting users when things go wrong and again when they get better.

1. First   install some  tools

# yum install httpd php gcc glibc glibc-common gd gd-devel

Create  nagios  user
# /usr/sbin/useradd -m nagios
# passwd nagios


Add  nagcmd  group
# /usr/sbin/groupadd nagcmd
# /usr/sbin/usermod -a -G nagcmd nagios
# /usr/sbin/usermod -a -G nagcmd apache 


Now go to http://www.nagios.org download  files
 ---> nagios-3.1.0.tar.gz ---> nagios-plugins-1.4.13.tar.gz ---> nrpe-2.12.tar.gz

# tar  -zxvf  nagios-3.1.0.tar.gz
# mv nagios-3.1.0 /home/nagios/
# cd /home/nagios/nagios-3.1.0/
# ./configure --with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make install-commandmode
# make install-webconf

Edit  your  email  admin address
# vim /usr/local/nagios/etc/objects/contacts.cfg

Create a nagiosadmin account for logging into the Nagios web interfaceassign to this you’ll need it later.
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

pwd:- nagiosadmin

Restart  the  httpd  server
# service httpd restart

2. Second step : Extract and install plugins

# tar -zxvf nagios-plugins-1.4.13.tar.gz
# mv nagios-plugins-1.4.13 /home/nagios/


# cd /home/nagios/nagios-plugins-1.4.13/
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make
# make install 


Now  add nagios  to  Chkconfig
# chkconfig --add nagios
# chkconfig nagios on

Verify  if  you  have  a  good config of nagios with the command
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Check if  there  are  no errors  displayed;  then start  nagios with command
# service  nagios  start

To  simplify  the   procesure  please  disable  the selinux  and  iptables  and  ip6tables.
now  open   your  browser   and http://localhost/nagios or http://ip/nagios

No comments:

Post a Comment