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
- check_ping.pl (1.73 KiB)
- This script is a perl substitute for the standard check_ping program. It is a little more flexible.
- check_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)
- elwatch.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).
- check_elwatch.pl (5.83 KiB)
- Checks whether certain Eventlog-Events occured in the past … hours.
- check_frs.pl (2.11 KiB)
- File Replicaion test: Checks the age of a file. Create the file by using ‘be_the_one.pl’.
- check_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’.
- be_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.
- check_netdiag.pl (1.96 KiB)
- Checks the output of netdiag for errors.
- check_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.
- check_reps.pl (2.02 KiB)
- Checks the output of
repadmin /showreps
for errors. - check_services.pl (754 Byte)
- Checks whether certain services are running.
- check_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.
- PerfDataConsumer.pl (3.72 KiB)
- Calls handlers for saved performance data from PerfDataConsumers.pm. Run in a cronjob.
- PerfDataConsumers.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.
- RRDPerf.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.
- WritePerfGraphs.pl (2.96 KiB)
- is a CGI that lets you flexibly view and compare the graphs created by the scripts above.
- ExtPerfGraph.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.