Monday, January 16, 2006

Step 1 - Installing Nagios

I downloaded nagios-1.3.tar.gz from http://www.nagios.org/download/

After Downloading,
Copy the nagios-1.3.tar.gz in /usr/local/src

#gunzip nagios-1.3.tar.gz
#tar xf nagios-1.3.tar

Before Installing Create a Installation Directory and a User for Nagios

Create the base directory where you would like to install Nagios as follows...
#mkdir /usr/local/nagios

Create User/Group
You're probably going to want to run Nagios under a normal user account, so add a new user (and group) to your system with the following commands (these will vary depending on what OS you're running):

#adduser nagios


I used the following Option

[root@mybox nagios-1.3]# ./configure --prefix=/usr/local/nagios --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios/ --with-nagios-user=nagios --with-nagios-grp=nagios

You Will get this after you run the above

*** Configuration summary for nagios 1.3 11-17-2005 ***:

General Options:
-------------------------
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagios
Embedded Perl: no
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Init directory: /etc/rc.d/init.d

Web Interface Options:
------------------------
HTML URL: http://localhost/nagios//
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /usr/sbin/traceroute

External Data Routines:
------------------------
Status data: Default (text file)
Object data: Template-based (text file)
Comment data: Default (text file)
Downtime data: Default (text file)
Retention data: Default (text file)
Peformance data: Default (external commands)
Extended info data: Template-based (text file)

Compile Nagios and the CGIs with the following command:

#make all

Installing The Binaries And HTML Files

Install the binaries and HTML files (documentation and main web page) with the following command:

#make install

Installing An Init Script

If you wish, you can also install the sample init script to /etc/rc.d/init.d/nagios with the following command:

#make install-init

#make install-commandmode
- This installs and configures permissions on the
directory for holding the external command file

#make install-config
- This installs *SAMPLE* config files in /usr/local/nagios/etc
You'll have to modify these sample files before you can
use Nagios. Read the HTML documentation for more info
on doing this. Pay particular attention to the docs on
object configuration files, as they determine what/how
things get monitored!

Now the Installation of Nagios is complete !!!

cd /usr/local/nagios

You should see five different subdirectories. A brief description of what each directory contains is given in the table below.

Sub-Directory Contents
bin/ Nagios core program
etc/ Main, resource, object, and CGI configuration files should be put here
sbin/ CGIs
share/ HTML files (for web interface and online documentation)
var/ Empty directory for the log file

No comments: