Wednesday, December 31, 2014

Install Nagios from Sources in CentOS 6.X

Nagios is software monitoring. It can monitor server uptime, service, and so on. For more details, you can go here.

To install nagios, follow step below:

  1. Install dependencies
  2. yum install -y httpd php gcc glibc glibc-common gd gd-devel make net-snmp
  3. Create nagios user and group
  4. useradd nagios groupadd nagcmd usermod -G nagcmd nagios usermod -G nagcmd apache
  5. Make folder to save nagios installation file and log file
  6. mkdir nagios
  7. Download nagios
  8. wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
  9. Extract the source code
  10. tar -xvf nagios-4.0.8.tar.gz
  11. Configure nagios
  12. ./configure --with-command-group=nagcmd >& /root/nagios/nagios-log/configure.log
  13. Compile
  14. make all >& /root/nagios/makeall.log
  15. Install nagios core
  16. make install >& /root/nagios/nagios-log/makeinstall.log
  17. Install init script
  18. make install-init >& /root/nagios/nagios-log/makeinstallinit.log
  19. Install command line mode
  20. make install-commandmode >& /root/nagios/nagios-log/makeinstallcommandmode.log
  21. Install sample nagios file
  22. make install-config >& /root/nagios/nagios-log/makeinstallconfig.log
  23. Open contact config file
  24. nano /usr/local/nagios/etc/objects/contacts.cfg
  25. Search for email and change email alert destination to your email
  26. Install nagios web interface
  27. make install-webconf >& /root/nagios/nagios-log/makeinstallwebconfig.log
  28. Change htpassword for nagiosadmin and remember this to login into nagios web
  29. htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
  30. Restart apache daemon
  31. service httpd restart
  32. Start nagios service
  33. service nagios start
  34. Access your nagios web interface with username nagiosadmin and the password from step 15
  35. http://ip-server/nagios

Source: http://www.tecmint.com/install-nagios-in-linux/

0 comments:

Post a Comment