Nagios Addons and Monitoring Scripts







Overview

From the documentation:
Nagios® is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better.

Once you have set up a basic installation, you will notice, that nothing works and everything needs to be configured. You will also notice, that a lot of functionality is included neither in the basic distribution nor in the module packs availlable on sourceforge.

Of course there are thousands of things to be monitored and as many different setups. But maybe the scripts I used in my scenario will also work for you. They are pretty well documented, so you can also change them to your needs if desired.

I differentiated a little more on how we actually monitor the service, that’s why the terminology is not equal to the one in the Nagios® documentation.

Direct check modules

File iconcheck_ping.pl (1.73 KiB)
This script is a perl substitute for the standard check_ping program. It is a little more flexible.
File iconcheck_dns.pl (2.51 KiB)
Using this script you can ask a server to resolve a DNS name. The time needed is returned.

NRPE_NT modules

(mostly for Windows running Active State Perl)

File iconelwatch.pl (4.76 KiB)
Run this as a service (using instsrv.exe). It will check every Eventlog-Event that is generated on the system. In a config file, you can tell it what to look for. If you looked for that event a log message is written to a file. This file can be checked with Nagios using check_elwatch.pl (see below).
File iconcheck_elwatch.pl (5.83 KiB)
Checks whether certain Eventlog-Events occured in the past … hours.
File iconcheck_frs.pl (2.11 KiB)
File Replicaion test: Checks the age of a file. Create the file by using ‘be_the_one.pl’.
File iconcheck_objage.pl (1.88 KiB)
Checks Active Directory Object replication: Looks wether a object is too old. Update the object using ‘be_the_one.pl’.
File iconbe_the_one.pl (1.54 KiB)
This script updates an object in the Active Directory and a file that is replicated, so you can test the replication of both later on.
File iconcheck_netdiag.pl (1.96 KiB)
Checks the output of netdiag for errors.
File iconcheck_perfcnt.pl (4.70 KiB)
Checks a "raw" performance counter. For this the actual value is written to a local file and only the difference to it is returned. Great for graphing using RRDTool.
File iconcheck_reps.pl (2.02 KiB)
Checks the output of repadmin /showreps for errors.
File iconcheck_services.pl (754 Byte)
Checks whether certain services are running.
File iconcheck_roles.pl (779 Byte)
Checks wether the server knows all its 5 roles using dumpfsmos.

General Nagios Addons

The scripts here mostly deal with graphing data collected by Nagios.

File iconPerfDataConsumer.pl (3.72 KiB)
Calls handlers for saved performance data from PerfDataConsumers.pm. Run in a cronjob.
Download iconPerfDataConsumers.pm (13.58 KiB)
Handlers for saved performance data. Calls graphing routines in RRDPerf.pm. To create graphs for a new service, this is the only place you have to modify.
Download iconRRDPerf.pm (5.96 KiB)
Library that creates an RRDTool database file for every host/service and saves data in it. Also creates pictures for every host/service that can be viewed with WritePerfGraphs.pl.
File iconWritePerfGraphs.pl (2.96 KiB)
is a CGI that lets you flexibly view and compare the graphs created by the scripts above.
File iconExtPerfGraph.pl (5.93 KiB)
creates the pictures "live" and allows more flexible time ranges than WritePerfGraphs.pl. It also allows you to download the values for the graph in CSV format so you can easily create special graphs in your spreadsheet application.

This is, how it looks like when it is set up properly: Selecting a servers/services combination using WritePerfGraphs.pl…

Viewing the combination…

Need Help Setting up Nagios?

If your business or institution wants to set up Nagios® monitoring and you need professional help, feel free to contact me.


Nagios and the Nagios logo are registered trademarks of Ethan Galstad.
Hannes...
  • ...

Menu

Links