Jump to content

MCA - Building Process for DR NAGIOS Server

From TetraWiki
Building Process for DR NAGIOS Server (10.80.7.70)


Table of Contents
[edit]

Pre-requisites

Nagios Installation

PNP4Nagios Installation

Nagvis Installation

MRTG Instalation

Smokeping Installation

Final Steps


Template:Anchor Pre-requisites[edit]

  • Disable selinux
  • Yum repo server should be there so that Yum can work
  • Proxy server should allow this Server to go out via 3128 so set following at .bashrc or at command prompt
  • Install rpmforge and epel repositories ( get it from old server )
  • Network team needs to allow 10.80.7.70 for snmp polling
  • Storage team needs to allow 10.80.7.70 for snmp polling
  • Unix team needs to add 10.80.7.70 to all the server in nrpe configurations
  • Wintel team needs to add 10.80.7.70 to all servers in nsclient configuration




Template:Anchor Nagios Installation[edit]

  • Rsync all the data from /opt , rsync -avrlv 10.64.7.70:/opt/ /opt/
  • Referance URL http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html
  • yum install httpd php gcc glibc glibc-common gd gd-devel net-snmp-utils net-snmp-libs mrtg-libs mrtg
  • /usr/sbin/useradd -m nagios
  • passwd nagios
  • /usr/sbin/groupadd nagcmd
  • /usr/sbin/usermod -a -G nagcmd nagios
  • /usr/sbin/usermod -a -G nagcmd apache
  • cd /opt/nagios/
  • ./configure --with-command-group=nagcmd
  • make all
  • make install
  • make install-init
  • make install-config
  • make install-commandmode
  • make install-webconf
  • service httpd restart
  • cd nagios-plugins-1.4.16
  • ./configure --with-nagios-user=nagios --with-nagios-group=nagios
  • make && make install
  • Rsync the data of nagios rsync -avrlv 10.64.7.70:/usr/local/nagios/ /usr/local/nagios/



Template:Anchor PNP4Nagios Installation[edit]

  • Reference document http://linuxdrops.com/install-pnp4nagios-graphing-solution-for-nagios/
  • yum install perl-Time-HiRes libtool-ltdl rrdtool rrdtool-devel php-rrdtool perl-rrdtool php-gd php php-pdo php-common
  • cd /opt/pnp4nagios-0.6.20
  • ./configure
  • make all
  • make fullinstall
  • Rsync the data from old server , rsync -avrlv 10.64.7.70:/usr/local/pnp4nagios/ /usr/local/pnp4nagios/
  • /etc/init.d/nagios restart



Template:Anchor Nagvis Installation[edit]

  • Ist Install – NDOUTILs - http://linuxdrops.com/ndoutils-on-centos-56-fedora/
  • yum install gcc gcc-c++ libdbi-dbd-mysql mysql mysql-devel mysql-server
  • # mysql -u root -p
  • mysql> create database nagios;
  • mysql> GRANT ALL ON nagios.* TO 'nagios'@'localhost' IDENTIFIED BY "nagios";
  • mysql> FLUSH PRIVILEGES;
  • mysql> quit
  • # cd /opt/ndoutils-1.4b9
  • # ./configure
  • # make
  • # cd /opt/ndoutils-1.4b9/db/
  • # ./installdb -u nagios -p nagios -h localhost -d nagios
  • copy the init script /etc/init.d/ndo2db from old server and start . Nagios configuartion are all there as it was copied .
  • Now Install mk_livestatus – Referance http://mathias-kettner.de/checkmk_livestatus.html
  • cd /opt/mk-livestatus-1.1.6p1
  • ./configure
  • make && make install
  • Restart nagios ( Check for nagios log if any error )
  • Now Nagvis - Referance document - http://linuxdrops.com/install-nagvis-for-nagios/
  • yum install rsync graphviz
  • cd /opt/nagvis-1.7.7
  • ./install.sh
  • http://ip-address/nagvis , username=admin , password – admin
  • Rsync the nagvis data , rsync -avrlv 10.64.7.70:/usr/local/nagvis/ /usr/local/nagvis/



Template:Anchor MRTG Instalation[edit]

  • Rsync the mrtg files - rsync -avrlv 10.64.7.70:/etc/mrtg/ /etc/mrtg/ and rsync -avrlv 10.64.7.70:/opt/mrtg/ /opt/mrtg/
  • Set the crontab - */5 * * * * sh /etc/mrtg/scripts/mrtg-gen.sh
  • Check the graphs on network Devices


Template:Anchor Smokeping Installation[edit]

  • Referance- http://www.wedebugyou.com/2012/11/how-to-install-and-configure-smokeping-on-centos-6/
  • yum install mod_fcgid httpd httpd-devel rrdtool fping wget curl bind-utils gcc make
  • yum install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-RRD-Simple perl-CGI-SpeedCGI perl-ExtUtils-MakeMaker
  • cd /opt/smokeping/
  • # ./configure –prefix=/opt/smokeping ; make install
  • Rsync the data rsync -avrlv 10.64.7.70:/opt/smokeping/ /opt/smokeping/
  • copy /etc/init.d/smokeping , copy /etc/httpd/conf.d/smokeping.cong
  • Restart smokeping and httpd services



Template:Anchor Final Steps[edit]

  • Copy postfix configuration /etc/postfix .
  • rsync -avrlv 10.64.7.70:/etc/mrtg/ /etc/mrtg/
  • rsync -avrlv 10.64.7.70:/opt/mrtg/ /opt/mrtg/
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/etc/ /usr/local/nagios/etc/
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/bin/pnp* /usr/local/nagios/bin/ - only once
  • rsync -avrluv 10.64.7.70:/usr/local/nagios/libexec/ /usr/local/nagios/libexec/ -only once
  • rsync -avrlv 10.64.7.70:/usr/local/nagvis/ /usr/local/nagvis/
  • rsync -avrlv 10.64.7.70:/usr/local/pnp4nagios/ /usr/local/pnp4nagios/
  • Activate cron
  • Activate postfix , chkconfig on
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/var/archives/ /usr/local/nagios/var/archives/ - one time
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/var/*.out /usr/local/nagios/var/
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/var/*.dat /usr/local/nagios/var/
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/var/nagios.log /usr/local/nagios/var/
  • rsync -avrlv 10.64.7.70:/usr/local/nagios/var/spool/ /usr/local/nagios/var/spool/