Before process installation, make sure the dependency are available onto your machine,
httpd, gcc, gcc-c++, glibc, glibc-common, gd, gd-devel
you can look at this how to install httpd from source, or you can follow in the bellow to install dependency.
*. install dependency .*
with user root run this command:
root@linux:~#yum -y install httpd* gcc gcc-c++ glibc glibc-common gd gd-devel
*. install nagios .*
I. create account for nagios
root@linux:~#useradd -m nagios root@linux:~#passwd nagios root@linux:~#groupadd nagcmd root@linux:~#usermod -a -G nagcmd nagios root@linux:~#usermod -a -G nagcmd daemon
II. download nagios and plugin packages
root@linux:~#wget ftp://ftp.prz.rzeszow.pl/pub/gentoo/source/distfiles/nagios-3.0.6.tar.gz root@linux:~#wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.14/nagios-plugins-1.4.14.tar.gz/download
III. extract those package
root@linux:~#tar xzvf nagios-3.0.6.tar.gz root@linux:~#tar xzvf nagios-plugins-1.4.11.tar.gz
IV. compile nagios
oot@linux:~# cd nagios-3.0.6 root@linux: nagios-3.0.6 # ./configure --with-command-group=nagcmd root@linux: nagios-3.0.6 # make all root@linux: nagios-3.0.6 # make install root@linux: nagios-3.0.6 # make install-init root@linux: nagios-3.0.6 # make install-config root@linux: nagios-3.0.6 # make install-commandmode root@linux: nagios-3.0.6 # make install-webconf
IV. create nagiosadmin accout for logging into nagios web interface.
root@linux:nagios-3.0.6 #/usr/local/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
the username is : nagiosadmin and input the password as do you want. Please remember the user and password for login on web interface later.
note: on RH4 the command line is :
root@linux:nagios-3.0.6 # htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
V. install plugins
root@linux: ~# cd nagios-plugins-1.4.11 root@linux: nagios-plugins-1.4.11 # ./configure --with-nagios-user=nagios --with-nagios-group=nagios root@linux: nagios-plugins-1.4.11 # make root@linux: nagios-plugins-1.4.11 # make install
note: on RH4, when make install my friends got error like bellow:
make[2]: Entering directory `/root/nagios-plugins-1.4.14/plugins' test -z "/usr/local/nagios/libexec" || /bin/mkdir -p "/usr/local/nagios/libexec" /bin/sh ../libtool --mode=install /usr/bin/install -c -o nagios--with-nagios-group=nagios 'check_apt' '/usr/local/nagios/libexec/check_apt' /usr/bin/install -c -o nagios--with-nagios-group=nagios check_apt /usr/local/nagios/libexec/check_apt /usr/bin/install: invalid user `nagios--with-nagios-group=nagios' make[2]: *** [install-libexecPROGRAMS] Error 1 make[2]: Leaving directory `/root/nagios-plugins-1.4.14/plugins' make[1]: *** [install-am] Error 2 make[1]: Leaving directory `/root/nagios-plugins-1.4.14/plugins' make: *** [install-recursive] Error 1
to fix that error, repeat starting from command configur like bellow
root@linux:~# cd nagios-3.0.6 root@linux: nagios-3.0.6 # ./configure --with-command-group=nagcmd root@linux: nagios-3.0.6 # make all root@linux: nagios-3.0.6 # make instal
VI. verify nagios configuration
root@linux: ~# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
if there are not error, configure is true
VII. start nagios service
root@linux: ~ # chkconfig --add nagios root@linux: ~ # chkconfig nagios on root@linux: ~ # /etc/init.d/nagios
VIII. Edit file httpd.conf add the line bellow on # Supplemental configuration part
root@linux: ~ # vi /usr/local/apache2/conf/httpd.conf
#nagios Include /etc/httpd/conf.d/nagios.conf
note : on RH4, if you are using apache old version, you can ignore part VIII
IX. restart apache service
and then you can cek or you can acces nagios web interface with your browser on http://yourdomain.com/nagios
input user and password
Thanks for the_mean aKa satria who practices's friends and tox_penguin aKa Totok for your documentation :)
0 comments:
Post a Comment