Wednesday, November 26, 2014

Nagios Software Installation

Nagios Software Installation - Free Monitoring software

Nagios is a Freeware Software available for Monitoring Windows and Linux machines. It Requires Linux OS System as Nagios Freeware version which is called Core version is install only on Linux. 
You can monitor below things of Server:-

# CPU
# Memory
# Disk Space
# Ping
# Any Other Define Service you want

1. Installation of Nagios:-

1. Need to Create Account Information-
     Become the Root User

     # Create New Nagios User Account and Password.
     #  /Usr/Sbin/Useradd -m nagios
     #  passwd nagios
      
# Create a new nagcmd for allowing external commands to      submitted through Web interface

   #  /usr/sbin/groupadd nagcmd


    #  /usr/sbin/usermod -a -G nagcmd nagios


  #  /usr/sbin/usermod -a -G nagcmd apache



2. Download nagios and Plugins-

     # Create a Directory for storing Downloads

     # mkdir -/Downloads


     # cd -/Downloads


# Download Nagios Installation file and Plugins.


3. Install Nagios-

    # Extract Nagios source code

    # cd -/Downloads


    # tar xzf filename.tar.gz


    # cd Folder name 

# Run nagios configure script with name of group created          earlier.

    #  _/configure --with-command-group=nagcmd

    #  compile nagios source code 

    #  make all


# install binaries, init script, sample config files

     # make install


     # make install-init


     # make install-config

 
     # make install-commandmode

# Dont start nagios. Need to do more settings.   


4. Customize Configuration-

# Sample Configuration File has been installed in /usr/local/nagios/etc directory.

# Edit /usr/local/nagios/etc/objects/contacts.cfg and change email address associated with nagiosadmin contact information with email address which we like to receive alerts.

  # vi /usr/local/nagios/etc/objects/contacts.cfg



5. Configure Web Interface-
    
    # Install Nagios Web config file in Apache config.d                  directory

    # make install-webconf

# Create Nagiosadmin account for logging in to web interface.

    # htpasswd -c /usr/local/nagios/etc/htpasswd.users                   nagiosadmin 

# Restart Apache for new settings to apply.

     # Service httpd restart


6. Install Nagios Plugins-

Extract Nagios Plugins Source code tarball.

     # cd -/downloads

     # tar xzf plugins file name.tar.gz

     # cd nagios-Plugins-1.4.11 (Folder name)

     # ./Configure --with-nagios-user=nagios --with-                          nagios-group=nagios
  
    #  make

    # install

7. Start Nagios- 

Add nagios to list of system services to automaticall start when server get reboot.

    # chkconfig --add nagios

    # chkconfig nagios on

# Nagios should start now.