Network monitoring/info gathering tools in linux


1.Why we have to monitor Network ?
Some times we have to monitor Network traffic in our LAN if there is any traffic issues such as "Broadcast Stroms". Here I am going to explain some Linux tools which are used to monitor network traffic.

I used to struggle a lot initially to use these tools.

Network monitoring tools can be divided in to three types :

  1. Traffic monitoring tools(which will do just monitoring traffic in network) .
  2. Network monitoring tools(these tools will do just monitoring such as services and devices).
  3. Network Info gathering tools(these tools will just get you info about your network, tools such as ifconfig, traceroute will come under this).

Some of the tools which we are going to cover in it are:-

6.MRTG(Multi Router Traffic Grapher)

I will give the explanation regarding above mentioned tools in my next posts.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • N.A.G.I.O.S


    NAGIOS(N.A.G.I.O.S. is a recursive acronym: "Nagios Ain't Gonna Insist On Sainthood", "Sainthood" being a reference to the original name of the software, which was changed in response to a legal challenge by owners of a similar trademark).
    NAGIOS is a system and network monitoring application that watches host and services that we specify as well as alerting when finds any error.

    NAGIOS is implemented by using SNMP protocol, so which ever devices support SNMP we can monitor that device using NAGIOS.

    NAGIOS can do following things
    1.Monitor wide range of hosts like Servers,Switches,Routers etc.
    2.Monitor network services (Like :
    3.Monitor Host resources (Processor load, Running processes, Disk usage, System logs, etc)
    4.Monitor Host environments(Temperature, Alarms etc).
    Can alert you through e-mail, SMS, Pager etc.

    NAGIOS can not do Monitoring of Bandwidth utilization in network.

    Installing NAGIOS:

    Step1: Before installing NAGIOS we required some packages to be installed, These are listed as below.
    Apache(For accessing NAGIOS web interface),
    gcc compiler,glibc, glibc-common and gd development library(for compiling source code which we are going download ).

    # yum install httpd
    # yum install gcc
    # yum install glibc*
    # yum install gd*

    Step2 : First we have Create a new NAGIOS user account , group and its password.
    # useradd nagios
    # passwd nagios
    # groupadd nagcmd
    # usermod -G nagcmd nagios
    # usermod -G nagcmd apache

    We are adding "nagcmd" as secondary group to both "nagios" and "apache" user because some times we require to execute commands through web interface.

    Step3 : Create a directory called download and download Nagios and its pluggins.

    # mkdir ~/download
    # cd ~/download
    # cd
    # wget
    # wget

    If you are unable to download using wget then use the following link to download nagios through GUI and nagiosplug:-

    Step4 : Now its time to Compile and install Nagios, to do this uncompress the tarball file and do as follows:

    # cd /root/download
    # tar -xvzf nagios-3.1.2.tar.gz ## extract the tar file.
    # cd nagio-3.1.2
    # ./configure --with-command-group=nagcmd
    # make all

    Stpe5 : Now Install binaries, init script, sample config file and set permissions on the external command(make install-commandmod) directory.

    # make install
    # make install-init
    # make install-config
    # make install-commandmod

    Now NAGIOS is installed and the configuring files are stored in /usr/local/nagios/etc

    Step6 : Install the NAGIOS web config file in the Apache conf.d directory.

    # make install-webconf

    Step7 : Create a nagiosadmin account for logging into the Nagios web interface.

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

    Here it will ask for new password, enter the password and remember it in order to access NAGIOS web interface.

    Step8 : Start nagios service by using below commands and add the nagios service to run at system start-up time.

    # /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

    When we execute the above command the output will be as below.

    Output like this:-
    Nagios 3.0.2
    Copyright (c) 1999-2008 Ethan Galstad (
    Last Modified: 05-19-2008
    License: GPL

    Reading configuration data...

    Running pre-flight check on configuration data...

    Checking services...
    Checked 35 services.
    Checking hosts...
    Checked 4 hosts.
    Checking host groups...
    Checked 1 host groups.
    Checking service groups...
    Checked 0 service groups.
    Checking contacts...
    Checked 1 contacts.
    Checking contact groups...
    Checked 1 contact groups.
    Checking service escalations...
    Checked 0 service escalations.
    Checking service dependencies...
    Checked 0 service dependencies.
    Checking host escalations...
    Checked 0 host escalations.
    Checking host dependencies...
    Checked 0 host dependencies.
    Checking commands...
    Checked 25 commands.
    Checking time periods...
    Checked 5 time periods.
    Checking for circular paths between hosts...
    Checking for circular host and service dependencies...
    Checking global event handlers...
    Checking obsessive compulsive processor commands...
    Checking misc settings...

    Total Warnings: 0
    Total Errors: 0

    Things look okay - No serious problems were detected during the pre-flight check.
    If output comes like this, it means there is no error.

    Step9 : start the nagios service and configure the service to run at start-up time of the system

    # service nagios start
    # chkconfig --add nagios
    # chkconfig nagios on

    Stpe10 : Use the following command to run the CGIs under the SElinux enforcing/targated mode. This will eliminate security loopholes.

    # chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
    # chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

    Stpe11 : Now change the contact details in
    /usr/local/nagios/etc/objects/contacts.cfg, you will find nagiosadmin, change the e-mail id associated to it with your required e-mail id, so that alerts .

    Step12 : Now restart the apache server

    # service httpd restart

    Step13 : Access the Nagios web interface through your web browser:


    Note:- Here you will be prompted for the username (nagiosadmin) and password that is given by you at step7 ).

    I will update the blog how to monitor different devices such as Servers, Network devices and System resources and how to get alerts through SMS, e-mail and Pager. Please keep us visiting.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • All about ISO image files



    What are ISO image files?
    An ISO image is an archive file (also known as a disk image) of an optical disc in a format defined by the International Organization for Standardization (ISO). ISO image files typically have a file extension of .iso. The name ISO is taken from the ISO 9660 file system used with CD-ROM media according to

    So these are the basic points i am going to cover in this post

    • How to create an iso file?
    • How to mount an iso file?
    • How to unmount an iso file?
    • How to update an iso file?
    • How to write an ISO file to CD?
    • How to view content of iso file?

    1)How to create an ISO image?
    As of now I know two methods to create an ISO file. One is through dd command(disk dump) and other is mkisofs command

    A)Creating ISO files from cd-rom/dvd by using dd command

    #dd if=/dev/cdrom of=/temp/songs.iso
    dd if=/dev/dvd of=/temp/songs1.iso # for dvd
    dd if=/dev/scd0 of=/temp/songs2.iso # if cdrom is scsi

    Let me explain what actually the above command will do. dd is a disk dump command which will present in most of the Linux/nix systems and "if" specifies input file and "of" specifies output file. So we are specifying to dd command what is our input file and where is our output file.
    Here my songs.iso file is created in /temp folder.

    B)Creating ISO file using mkisofs command.
    Method1:Creating an iso image from cd-rom

    #mkisofs /dev/cdrom -o /temp/songs3.iso

    Method2:Creating an iso image from a folder

    Suppose i am having a folder /opt/data which contains some data to be converted in to .iso file, follow below step

    #mkisofs -o /temp/songs4.iso /opt/data

    2)How to mount an ISO file?
    #mount -o loop /temp/songs4.iso /opt/mountpoint

    3)How to unmount an ISO file?
    #umount -lf /opt/mountpoint

    here /opt/mountpoint is the place where my iso file is mounted.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How to implement RAID10?


    RAID10 can be implemented by first implement RAID1(ie mirring) then implementing RAID0(stripeset on different disks) on it.

    Configuring RAID10
    Step1:Get the info who many devices are participating, for example here we taken 4 disks(/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1).
    Step2:Implement RAID1 on four drives(taking 2 each)

    #mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[ab]1
    #mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sd[cd]1
    Step3:Now implement RAID0 on two of RAID1 devices(/dev/md0,/dev/md1)

    #mdadm --create /dev/md2 --chunk=64 --level=0 --raid-devices=2 /dev/md[01]
    Step4:Format the RAID10 device with ext3 and mount the device
    #mke2fs -j /dev/md2
    #mkdir /store
    #mount /dev/md2 /store
    Unconfiguring RAID10
    Step1:Unmount the RAID device /dev/md2
    #umount /dev/md2 or #umount /store
    Step2:Stop the RAID device
    #mdadm --manage /dev/md2 --stop
    #mdadm --manage /dev/md1 --stop
    #mdadm --manage /dev/md0 --stop
    Step3:Remove the Disks(/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1) by using fdisk utility

    Comments are entertained --- Surendra

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Firefox 3.5 Released


    Fire fox 3.5 version is released with some good features such as private browsing(which is already implemented in IE and Chrome some long time back). Here are the features which is new to FF3.5

    1. Private browsing
    2. Tab tearing
    3. HTML5 support
    4. Forget this site
    5. Geo-location
    I see most of the features are brought from Chrome.. What you say people?
    And here is the link to download Latest Firefox browser

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Get the basic Linux book


    This post is for the beginners who want's to start learning linux, which contains

    • Introduction
    • Shell Tips
    • Help
    • Re-directing operators
    • Basic file system
    • System monitoring
    • Disk management
    • User management
    • Text Editors
    • Mathematical tools
    • Network Management
    • Security
    • Backup/Restore
    • Scheduling
    etc... So many basic consepts with good explination for new Linux users.

    Get the book here.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Server configuration file syntax Checking commands



    I have planned to write this post some long time ago, now the time has come to do it.

    Basically configuring servers in Linux/*nix include editing of configuration files and saving them. Once editing the files if any syntax error is there and when we start the service they will show some wearied errors which we cant resolve.
    For counter attacking this type of issues for each service there will be one command to check this syntax errors before starting of the service/server, I have collected these commands from my experience and from some of my friends. Please feel free to comment on this if you know some other commands so that I will update my post.

    SSHD server check for syntax error
    sshd -t

    FTP server check for syntax error

    DNS server check for syntax error

    For checking syntax errors in main configuration file..
    #named-checkconf main-config-file

    #named-checkconf named.conf

    Syntax OK

    #named-checkzone domain zonefile-loc

    #named-checkzone /var/named/chroot/var/named/exaple-zone.frd

    SAMBA server check for syntax error

    APACHE server check for syntax error
    httpd -t

    For virtual hosts

    httpd -t -D DUMP_VHOSTS

    TCP Wrappers check for syntax error
    tcpdchk -v

    Postfox server check for syntax error
    postfix check
    postfix -vv

    server check for syntax error
    lighttpd -t -f /etc/lighttpd/lighttpd.conf

    server check for syntax error
    squid -k check
    squid -k parse

    NAGIOS server check for syntax error
    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page


    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here