Unix tip: Monitoring networks with Nagios

By Sandra Henry-Stocker  1 comment

Nagios, called NetSaint in its early versions, is a best of class, industry standard, open source (yes, free!) and fully extendable tool for monitoring networks. With surprising little effort, you can use it for basic system monitoring. You can also monitor individual services such as http, smtp, ssh, dns, pop3, ftp and others along with critical systems resources such as disk usage and processor load. With extra effort, you can monitor your databases and even the load on your routers. Nagios is a sophisticated tool for complex networks.

Some aspects of setting up and managing Nagios are relatively simple; others are intensely complex. But a good network monitoring system is worth the investment you have to make up front. Once set up, it can save you untold hours and lots of frustration.

Powerful and modular, Nagios provides the kind of control (including automatic restarting of services) you would expect to find in expensive network monitoring packages. One of the beauties of Nagios is that you can start with a modest configuration and slowly add to your network monitoring system.

Nagios is both powerful and modular. It also supports SNMP, so you can monitor nearly any type of modern routers and switches.

It's quite easy to configure Nagios to monitor basic services. You have to define who receives alerts, what systems and services you want to monitor and how alerts will be delivered. You will set up some basic configuration files such as /etc/nagios/contacts.cfg for contacts, /etc/nagios/hostgroups.cfg to define groups of systems for various types of monitoring and services.cfg for services you will be monitoring.

Nagios provides commands such as "nagios -v /etc/nagios/nagios.cfg" to test your configuration file. Nagios allows you to specify how many times a service or host check will be retried before the service or host is declared down. This reduces the number of false alarms that will be generated.

Nagios is generally easy to install. On debian-based systems, it's as easy as typing "apt-get install nagios-text". Other varieties of Linux systems should be similarly easy. Solaris installations are more of a challenge, but Nagios has been compiled successfully by numerous people on Solaris 8, 9, and 10. I haven't located any Solaris packages yet, but maybe some are in the works.

There are two ways to learn about Nagios. You can go to the http://www.nagios.org/ web site, download Nagios and try it out or you can buy a good text and gain the benefit of someone else's thorough use of the tool. I suggest doing both.

I recommend Wolfgang Barth's excellent "Nagios: System and Network Monitoring, 2nd Edition". At more than 700 pages, it's not a quick read, but it will teach you just about everything there is to know about the tool. With 26 chapters and 8 appendices, the book covers everything from preparing for an installation to writing your own plugins.

"Nagios: System and Network Monitoring" will teach you how to install and configure the system, configure the notification system, program event handlers, write plugins in Perl and make use of graphing and visualization tools. It will also show you how to monitor Windows servers, SAP systems and databases. The book highlights differences the between versions 2 and 3 of Nagios and provides extremely useful migration tips for anyone currently using Nagios version 2. There's a whole chapter on monitoring Oracle with the Instant Client (which dramatically reduces the work you have to do).

The book provides important information on features new or enhanced in Nagios 3. You'll find information, sometimes whole chapters on:

  • configuration and startup
  • service checks and plugins
  • resource testing (e.g., swap usage, processes)
  • running plugins with ssh
  • NRPE (the Nagios Remote Plugin Executor)
  • monitoring with SNMP
  • the notification system
  • passive tests
  • NSCA (the Nagio Service Check Acceptor)
  • distributed monitoring
  • the classical and flexible web interfaces
  • NagVis and graphical display of performance data
  • monitoring windows, room temperature and humidity
  • monitoring SAP systems
  • processing events with EventDB
  • writing your own plugins
  • monitoring file and folder sizes
  • monitoring oracle
  • Single-Sign on environments (Apache, Windows ...)
  • changes in object definitions from 2
  • Nagios embedded Perl Interpreter
  • changes in the CGI interface
  • Rapidly alternating states (flapping)
  • performance optimization with a special setting for large installations

and more. This book will get novices off to a good start, but it's invaluable for anyone who is migrating from Nagios 2 to 3 or enhancing their monitoring setup.

1 comment

    Anonymous 2 years ago
    Monitoring netwworks with Nagios will be even easier with the next release of Mobile Admin. Mobile Admin allows IT Administrators to manage their networks from their BlackBerry, Windows Mobile and very soon, Symbian phones.If you would like to bets this product, you can visit www.roveit.com/mabeta to sign up.

      Add a comment

      Post a comment using one of these accounts
      Or join now
      At least 6 characters

      Note: Comment will appear soon after you have activated your account.
      Obscene/spam comments will be removed and accounts suspended.
      The information you submit is subject to our Privacy Policy and Terms of Service.

      ITworld LIVE

      IT Management/StrategyWhite Papers & Webcasts

      White Paper

      Top Solutions and Tools to Prevent Devastating Malware

      Custom malware frequently goes undetected. According to Forrester Research, the best way to reduce risk of breach is to deploy file integrity monitoring (FIM) tools that provide immediate alerts. This white paper has been brought to you by NetIQ, the leader in solving complex IT challenges.

      White Paper

      Ten Steps to an Enterprise Mobility Strategy

      Enterprise employees are more mobile, relishing the ability to work productively anywhere, at any time. They may use any means to get connected, often creating financial and security risks for your company. Discover how to get control of your enterprise mobility strategy and ensure mobile worker productivity with these ten steps.

      White Paper

      What You Need to Know About the Costs of Mobility

      Mobile workers want to get connected anywhere, at any time, often at any cost. Enterprise mobility is often a hidden "black" budget in your company. Ensure that your traveling employees are productive everywhere, even while you control cost and security, through an enterprise mobility strategy.

      White Paper

      The 2011 iPass Mobile Enterprise Report

      This industry survey covers trends, recommendations and a policy guide on managing Enterprise Mobility for IT management and CIOs. Get data on employee device liability, as well as smartphone/tablet penetration, budget control and provisioning. Find out how your organization compares, how to ensure mobile worker productivity, and control costs.

      Webcast On Demand

      Customer Spotlight: How IPC The Hospitalist Company Implemented Oracle on VMware

      Have you been looking to hear about customer's experiences with the new VMware vCenter Site Recovery Manager product? View this webcast to learn about VMware customer, Navicure, and their experiences testing and evaluating the recovery manager, their progress in implementing it in their environment and their advice other customers considering using vCenter.

      Sponsor: VMware

      See more White Papers | Webcasts

      Answers - Powered by ITworld

      Ask a question

      Ask a Question