Archive for October, 2009

Nagios: Nagvis splash page to emulate high priced monitoring and notifications

Saturday, October 31st, 2009

Here is a nice and clean way to display a listing of your diagrams of processes being monitored by Nagios. It is really simple and can give your opening page the look of Tivoli, which costs 2.5 million times what you are paying for Nagios and Nagvis.

  1. Go to our Nagvis installation files: $Prefix/nagvis/nagvis/includes/classes/
  2. You will need to edit the file: NagVisFrontend.php, so VI the file.
  3. Change the following SPAN tag to the size you want your rows: $ret[] = ‘<td ‘.$class.’ style=”width:50px;height:50px;”
  4. Comment out the following lines: /*if($this->MAPCFG->getValue(‘global’, 0,’usegdlibs’) == ’1′ && $MAP->checkGd(1)) {
    $ret[] = ‘<img style=”width:200px;height:150px;” src=”‘.$this->createThumbnail($imgPath, $mapName).’” /><br />’;
    } else {
    $ret[] = ‘<img style=”width:200px;height:150px;” src=”‘.$imgPathHtml.’” /><br />’;
    }*/
  5. Right beneath that part you want to add the TR tag and comment out the for loop: $ret[] = ‘</td></tr>’;
    /*if($i % 4 == 0) {
    $ret[] = ‘</tr><tr>’;
    }*/
  6. Save the file and refresh your browser. You should see:Nagvis Front Page

This is another example of how you can modify Nagios and Nagvis by thinking outside the box. Please take a chance to examine the “Learning Nagios 3″ book that is displayed on the right side of the page, because it contains many helpful hint when it comes to configuring your instance of the application.

Enjoy,

Mike Kniaziewicz, MIS

Nagios: How to monitor a networked file system (NFS)

Saturday, October 31st, 2009

Networked file system (NFS) is very complex to both monitor and send notifications. System Administrators are concerned with the network, cluster, server hardware and software and managing the file system. End user concerns are drive space and availability. Nagios® provides the perfect solution to monitoring a NFS.
Scenario
Upper management is concerned about the NFS. End users are complaining about not having access to or the ability to save files to a shared drive. How can Nagios® save-the-day once again?
Solution

  1. Identify how the system works. Create a diagram on a white-board and encourage input from all administrators. The diagram needs to include all hosts, host name aliases, special software, cnames, file names and at least one switch level above the hosts.
  2. Using a diagramming tool, like DIA, transfer the white-board diagram to a file (you will need the diagram later).
  3. Identify objects. Nagios® has two types of objects: hosts and services. You need to write down all the objects. Host objects should include: switches, servers and host aliases. Services should include all service checks for production hosts (template), PING for switches (template) and your NFS disk size checks(new template). Also establish your parent/child relationships.
  4. Identify the best plugins for monitoring your objects. Monitoring a host’s UP/DOWN state should be with a service check, like check_users. Monitoring NFS disk sizes would be check_disk.
  5. Create definitions. Nagios® needs configurations in order to start working with the NFS. Since many of the defined objects are standard with any system you will monitor, we will examine the specific NFS objects.
  6. Test Nagios® configuration. Make sure there are no mistakes with your object definitions: $PREFIX/bin/nagios -v $PREFIX/etc/nagios.cfg. Reload Nagios®: /etc/init.d/nagios reload. Lastly test the email notification by placing your email address in the”email”list for the contacts. Then within the Nagios® web console locate the host and services you just created. Click on the service – “send custom service notification – check the”force”box and add a comment – commit. Check the email you received to ensure it is correctly formatted, then click on the “Notifications” section of the web console and make sure the email was only sent to the contact group you stipulated.

NFS can be complicated and time consuming to establish monitoring and notification. However, if you take the time to properly plan how you want to accomplish the monitoring and notifications it becomes a simpler task. I hope this helps with your Nagios® instance.

Thoughts or Questions? Please share your NFS experiences with our community.