หน้าเว็บ

วันพุธที่ 22 กรกฎาคม พ.ศ. 2552

Install Nagios 3.1.2 on Ubuntu 9.04 desktop






Step 1 prepare Computer
$ sudo apt-get install apache2 build-essential php5 libapache2-mod-php5 libgd2-xpm-dev

Config servername of apache2
$ sudo vim /etc/apache2/httpd.conf

Edit in file
servername nagios

$ sudo /etc/init.d/apache2 restart

Create Account
$ sudo -s

Create a new account and password
$ useradd -m nagios
$ passwd nagios

Create new groups for external commands
$ groupadd nagcmd
$ usermod -a -G nagcmd nagios
$ usermod -a -G nagcmd www-data


Step 2 Download source code from nagios.org

$ mkdir ~/downloads
$ cd ~/downloads

nagios 3.1.2
$ wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.1.2.tar.gz
plugin 1.4.13
$ wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz

Step 3. Compile and Install

Extract source code and prapare library
$ cd ~/downloads
$ tar -xzvf nagios-3.1.2.tar.gz
$ cd nagios-3.1.2/
$ ./configure --with-command-group=nagcmd

Compile and Install
$ make all
$ make install
$ make install-init
$ make install-config
$ make install-commandmode
$ make install-webconf

Create user and password for web login
$ htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin


Step 4 . Compile and Install plugin

$ cd ~/download
$ tar -xzvf nagios-plugins-1.4.13.tar.gz
$ cd nagios-plugin-1.4.11

Compile and Install plugin
$ ./configure --with-nagios-user=nagios --with-nagios-group=nagios
$ make
$ make install

Step 5. Create Startup When Reboot
$ ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

Step 6. Restart service with New Modification

$ /etc/init.d/apache2 reload
$ /etc/init.d/nagios restart
$ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Step 7. Login to web interface
Open web browser with
http://localhost/nagios/

Thanks : www.nagios.org

ไม่มีความคิดเห็น: