Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_rrd.pl

Rating
3 votes
Favoured:
2
Last Release Date
2013-05-30
Owner
Hits
126080
Files:
FileDescription
check_rrd.plcheck_rrd.pl
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Generic Perl plugin to check age and values of an rrd database. It uses RRDs and Nagios::Plugin (but not rrd_poller ;-)
check_rrd.pl has three modes: --info for having a quick look at the rrd header data; --age to check the time since the last recent update; --ds (data source) to check the values of a specific data source within the rrd file. Use check_rrd.pl --help for full documentation.
If you want to use it altogether with cacti, the parameter -R can use standard file matching globbing (*?) so it will pick the proper file without knowing the device id.

#You could define check for email limits like this:
define command{
command_name check_mqueue
command_line /usr/lib/nagios/plugins/check_rrd.pl -R /var/www/cacti/rra/$HOSTNAME$_qmailqueue_* --ds QmailQueue -w$ARG1$ -c$ARG2$ --start -10min --end -5min --compute=MAX
}
Reviews (2)
byaseques, May 13, 2013
This is a small pathc to allow fuzzy names (with globbing), it helps when integrating with cacti, so we can make a match like servername_service_*.rrd that is more effective.

--- /tmp/check_rrd.pl 2013-05-13 14:05:11.000000000 +0200
+++ check_rrd.pl 2013-05-13 16:35:09.000000000 +0200
@@ -313,8 +313,16 @@
# main
# -----------------------------------------------------------------------

+#In case the file is a glob expression (*), expand it and check if matches
if ( ! -r $rrdfile ) {
- $np->nagios_die("rrdfile $rrdfile not readable or does not exist");
+ my @filelist = glob "$rrdfile";
+ if ( ! @filelist) {
+ $np->nagios_die("rrdfile $rrdfile not readable or does not exist");
+ } elsif ( scalar(@filelist)!=1 ) {
+ $np->nagios_die("Glob matches more than one file @filelist
");
+ } else {
+ $rrdfile=$filelist[0];
+ }
}

# ----------------------------------------
byvmarzlin, August 4, 2010
1 of 2 people found this review helpful
First thanks for this add-on.
I just have a problem using it...
./check_rrd.pl -R /usr/share/cacti/site/rra/sec-001-prd-mgw_cpu_per_1329.rrd --ds cpu_per -w40 -c50 -v
CHECK_RRD CRITICAL - AVERAGE: 4.91611111111111 | cpu_per.AVERAGE.average=4.91611111111111;40;50

The returned value is 4.91611111111111, so this value is