Jan 7, 2008

Ubuntu: Easy Way to View Your Network

I've been wondering quite sometime to find a suitable application to view my network from single pc/laptop. I keep searching and i found one interesting application named Nagios. This software let you to view your network including router, modem, server whether it's up or down.

Nagios check protocol like SMTP, POP3, HTTP, NNTP, PING and etc to find any problem with the services. This software also check modem, router for problem and you can check the uptime of your router with this application.

All reports you need can be access via web browser. The requirement for nagios:
  • Apache web server
  • Thomas Boutell's gdlibrary(version 1.6.3 or later)
It's being license under GNU General Public Lisence and being published by free software foundation. Here is how to install the nagios:
  • If you dont have webserver installed on your ubuntu, you must install first to make nagios working. Install apache , GCC compiler and development libraries, and gd library:
  • sudo apt-get install apache2
  • sudo apt-get install build-essential
  • sudo apt-get install libgd-dev
  • Next thing you must create a user account for nagios.
      • sudo -s (become root)
      • sudo /usr/sbin/useradd nagios
      • passwd nagios
  • After adding user nagios, you need to create group for the new user created on the previous step.
      • /usr/sbin/groupadd nagios
      • /usr/sbin/usermod -G nagios nagios
  • Create a new user name and group name nagcmd:
      • /usr/sbin/useradd nagcmd
      • /usr/sbin/usermod -G nagcmd nagios
      • /usr/sbin/usermod -G nagcmd www-data
  • Now you've just finish setting the requirement to install nagios. We may proceed to the installation. First you need to download two things from internet.
      • wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc1.tar.gz
      • wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
  • After you've done downloading the files, all you need to do is extract it and compile as usual.
    • tar zxvf (filename).tar.gz
    • cd (filename)
    • ./configure --with-command-group=nagcmd
    • after finish, run make all
    • make install
    • make install-init
    • make install-config
    • make install-commandmode
  • Now we need to configure the web interface:
    • make install-webconf
    • htpasswd -c /usr/local/nagios/etc/htpasswd.user nagiosadmin
    • remember your password here cause you'll need it to login the web interface later.
  • After this you need to install the plugin. All you need to do is extract the tar.gz file:
    • tar zxvf (filename).tar.gz
    • cd (filename)/
    • ./configure --with-nagios-user=nagios --with-nagios-group=nagios
    • make
    • make install
  • There you go.. but dont start the nagios yet. You need to change the contact configuration and provide you info inside it:
    • sudo gedit /usr/local/nagios/etc/objects/contacts.cfg
    • change the email address to your emel address. Nagios will email the address given if there is something unusual to your network.
  • Now to start nagios:
    • ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios <--- this will make nagios start on startup
    • /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg <--- to verify nothing's wrong with your configuration.
    • So if there is no error, you can start nagios by using this command:
      • /etc/init.d/nagios start
And after you've finish installing those two files, all you need to do now is open your browser and type in the address bar http://localhost/nagios and it will ask for user and pass where the user is nagiosadmin and the password is the password you put earlier during installation.

So happy trying. Any problems you may leave it in the comment box, and i'll try to solve it for you!

Thank you for your unbelievable support on Negative Zero - Permission to read and write blog for nearly 4 years. Don't forget to like Negative Zero on Facebook.
Blogirific.com Blog Directory

Post(s) you might like to read :



Post a Comment