Nagios - Install
Revision as of 01:39, 8 November 2013 by Daniel Baker (talk | contribs)
Compiling from source is the only sure way to install a consistent Nagios platform across distributions, their various versions, on varied hardware.
Perform a fresh install - Minimal Centos 6 first. Then make sure the following packages are installed. Many of these will be duplicated from the basic install, but are included as an accurate list as to what's needed for Nagios, and Nagiosgraph
htop wget htop iftop nmon sysstat gd gd-devel httpd php gcc glibc glibc-common openssl-devel gcc glibc glibc-common gcc php-devel php-pear libssh2 libssh2-devel mysql-server mysql php-mysql sendmail man ntp mail mutt which mailx cpan libcurl curl-devel curl yaml php-gd rrdtool rrdtool perl-rrdtool perl-Time-HiRes
yum groupinstall "Development Tools"
cpan install CGI
Disable firewall and selinux - This box should only be available from the internal network and these options are redundant.
vim /etc/selinux/config chkconfig iptables off
>- REBOOT -<
Create nagios compile folder, nagios user, change to nagios compile folder.
mkdir nagios adduser nagios cd nagios
Download and Compile Nagios
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.4.tar.gz ./configure && make all && make install && make install-init && make install-commandmode && make install-config && make install-webconf
Download and compile Nagios Plugins
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz ./configure --with-nagios-user=nagios --with-nagios-group=nagios && make && make install
Set the nagiosadmin password.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Gracefully restart apache.
/usr/local/nagios/etc/nagios.cfg
cfg_dir=/usr/local/nagios/etc/hosts cfg_dir=/usr/local/nagios/etc/services cfg_dir=/etc/nagiosql/ command_file=/usr/local/nagios/var/rw/nagios.cmd lock_file=/usr/local/nagios/var/nagios.lock
The last part above will need a little correction later.