check_rrd perl issue?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dxk9_dtman
Posts: 12
Joined: Fri Nov 30, 2012 1:59 pm

check_rrd perl issue?

Post by dxk9_dtman »

Hi all,
I'm trying to use a 'check_rrd.pl' script to check for values in a changing RRD file.

Has any one had any luck using a check_rrd script with versions of perl higher than perl 5.8.8?

I found 2 (old) scripts for checking RRD files(Cacti) on the nagios exchange.

One does not use rrdpoller, but returns 'No valid values found'. I've found in my environment that it does work ok when CF is set to percent, just not AVERAGE. But I want --ds working so I can get an alert on -w or -c. Setting --compute ==AVERAGE or CF AVERAGE doesn't seem to help.

and the other one does use rrdpoller. rrdpoller 1.5 compiled ok, but did give the message:

Code: Select all

 # Unparsable version '' for prerequisite File::Temp at Makefile.PL line 87.
The perl script runs and returns this, but works fine on an older linux system with perl 5.8.8.

Code: Select all

##Argument "" isn't numeric in numeric le (<=) at /usr/local/perl-5.16.1/lib/site_perl/5.16.1/Nagios/Plugin/Range.pm line 98.
##Argument "" isn't numeric in numeric le (<=) at /usr/local/perl-5.16.1/lib/site_perl/5.16.1/Nagios/Plugin/Range.pm line 98.
##RRD_12 OK - :
The one that uses rrdpoller works fine on an older version of linux.

Thanks for any ideas.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_rrd perl issue?

Post by slansing »

Have you tried to update your Perl nagios plugins package from CPAN? The path you are getting the error from is citing a directory from your old version of Perl. Also are you sure the prerequisites are in the proper directory for the new installation?
dxk9_dtman
Posts: 12
Joined: Fri Nov 30, 2012 1:59 pm

Re: check_rrd perl issue?

Post by dxk9_dtman »

Nagios::Plugin is up to date (0.36).
dxk9_dtman
Posts: 12
Joined: Fri Nov 30, 2012 1:59 pm

Re: check_rrd perl issue?

Post by dxk9_dtman »

nagios@servero:/usr/local/nagios/libexec> ./check_rrd.pl -R /sprj/cacti_rrds/server3_reqs_2647.rrd --ds reqs --compute=AVERAGE AVERAGE -w 120:120 -c 140:140
CHECK_RRD CRITICAL - AVERAGE: 32.9412280701754 | reqs.AVERAGE.average=32.9412280701754;120:120;140:140


This check tool returns the average, but notice the logic always returns critical
dxk9_dtman
Posts: 12
Joined: Fri Nov 30, 2012 1:59 pm

Re: check_rrdtraf logic

Post by dxk9_dtman »

It looks like there was a restructuring to the output of RRD in 2011 and so AVERAGE data may be coming in on a different line. I'm still looking in this
http://old.nabble.com/Odd-mismatch-in-f ... 98300.html

The PHP script I was looking at seems to get the value from rrdtool fetch fine though. I changed the code to pull from lines 2,3,4,5. Then back to line[2]. Using printf it seems to have the right number from the rrd file and it just seems to be the logic that's off in the script. IOW, I've noticed on both the perl and php scritpt which is odd that the logic is off. Just return critical if 8 is bigger than 5 already!! NO, it's not OK. I'm getting closer...
dxk9_dtman
Posts: 12
Joined: Fri Nov 30, 2012 1:59 pm

Re: check_rrd.pl rrdpoller

Post by dxk9_dtman »

This may be my last post for a while, since I'm giving up and we will monitor thresholds via cacti


I found that issuing this command returns nothing, snippet from perl script

Code: Select all

 /usr/bin/rrdpoller get /cacti_rrds/server3_reqs_2647.rrd reqs
Locked