Paid Advertisement

Wireless Network Management with Nagios, 10 Easy Step to Install

image

Introduction with Nagios Network Management System

Nagios is a great network monitoring and
management tool. It provides a valuable management dashboard. It's open source / free software. Other Open Source systems and alternatives (partly overlapping with Nagios) Like: Cacti, mrtg / rrdtools, nedi…
Personally I like and prefer Nagios for its easy installation deployment and Network Management Features.

Installing Nagios Network Management System on Ubuntu(Linux)

Step-1 : Installing Apache-2 with Extra Compiler and Libraries
First of all you need to Install Apache 2 with following bundles
  1. GCC compiler and development libraries
  2. GD development libraries
Using Ubuntu witch is a Free Versatile Open Source OS in Linux: You can use apt-get to install these packages by running the following commands:
> sudo apt-get install apache
> sudo apt-get install build-essential


Step-2 : Downloading and Installing Nagios Open Source Package



After installing Apache 2 Next Step is about to Download and install Nagios with following commands

Get sources, currently: nagios-3.0.4.tar.gz

> wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.4.tar.gz
> wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.12.tar.gz

You can select Mirror Download site accourding to your physical location and their link closer to your country! If that is the case then you can start looking the links here: http://www.nagios.org/download/
After downloading apropriate and latest version Run the following command to install Nagios package on your Linux System


Step-3 : Uncompressing Nagios Package with TAR Command

tar -xzvf nagios-_._._.tar.gz

Look for Pre bundled “quickstartUbuntu” witch is going to help you out while installing and configuring Nagios on Ubuntu Linux.

<nagios-dir>/html/docs/quickstartubuntu.html ... there are also html help files for other distribution of Linux. If you are not using Ubuntu you can look for help file related to your distro.


Step-4 : Creating User and Group in Nagios on Ubuntu

To create User and Group you have to run following command on Ubuntu

/usr/sbin/useradd -m nagios passwd nagios
/usr/sbin/groupadd nagios
/usr/sbin/usermod -G nagios nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data


Step-5 : Running Configuration Script on Nagios …. remember we are on Ubuntu 

Now time to run Configure Script of Nagios, passing the group name you was create in early Steps.

> ./configure --with-command-group=nagcmd


Step-6 : Compiling the Nagios Source Code

Run following command to Compile the Nagios Source Code … on Ubuntu Linux Distro

> make all

Install binaries, init script, sample config files and set permissions on the external command directory.

>make install
>make install-init
>make install-config
> make install-commandmode


Step-7 : Editing Config File of Nagios

View and Edit “config” files in this location
/usr/local/nagios/etc


Step-8 : Installing  and Enabling Web Configration

Command line to install Nagios Web Config file in “Apache-2 conf.d” directory•.

>make install-webconf


Step-9 : Creating NAGIOSADMIN account for Web Interface

Now we have to create nagiosadmin account for Web Interface Login. Write down the password you assign to this account - you'll need it the time you have to login to Web Interface for Network Management System’s Configurations purposes.

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


Step 10 : Restarting Apache-2 to Activate with New Settings

Command to “Restart” Apache to make the new settings to work and take the effect of last configuration commands..

>/etc/init.d/apache2 reload

Congrats as you have completed Successful Installation of Nagios on Ubuntu Linux Distro.

Introduction to the Nagios web interface

Visit this link for Nagios Web Interface from where you have to manage the things easily.
http://localhost/nagios

How to Use Nagios Network Management Features

Two kind of Monitoring is available for your gateway or main server
  1. Publicly available services
  2. Internal services (via ssh / plugins)
Nagios relies on objects (hosts, groups, services, ...) and their configuration
You can take a Start by creating a host configuration.

Example config files are located here
/usr/local/nagios/etc/objects/
 
When Monitoring a server
Example of a host definition
define host{
use generichost
; Inherit default values from a template
host_name SkyLines ; The name we're giving to this host
alias my own laptop ; A longer name associated with the host
address 127.0.0.1 ; IP address of the host
hostgroups allhosts ; Host groups this host is associated with
}


Example of a service definition – monitoring ssh on our gateway, using the check_ssh plugin
define service{
use genericservice
; Inherit default values from a template
host_name SkyLines
service_description SSH
check_command check_ssh
}


Lab Times Exercises: How to Use plugins
Whenever you are done adding a host or service, or have made any change, check the config files here:
>/usr/local/nagios/bin/nagios
-v /usr/local/nagios/etc/nagios.cfg
Remember that your new files need to be enabled in nagios.cfg, by a
cfg_file or cfg_dir directive !
And restart Nagios like so
>/etc/init.d/nagios start

How to Become an Expert or Geek of  Nagios Network Management System.
Key to be a successful Nagios Operator or Admin is to Learn how to work with Configuration Files, Services, and Plugins. Too Many websites with Nagios Plugins Repositories. Help Documents and Files are right there in your system so use those files. Thats it.
Comments & Suggestions are Welcome!

No comments:

Post a Comment