check_rrd_data.pl

Subhendu Ghosh sghosh at sghosh.org
Wed Feb 26 01:25:43 CET 2003


Inline edit

On Wed, 26 Feb 2003, Jamie wrote:

> Hi,
> 
> Has anyone actually managed to make check_rrd_data.pl work?
> 
> I've been hacking at it. Unsuccessfully. I tried messing around with the
> @INC array to include cricket's RRD::File.pm, and I thought I was getting
> there until I got:
> 
> Can't locate object method "new" via package "RRD::File" (perhaps you forgot
> to load "RRD::File"?) at ./check_rrd_data.pl line 95.
> 
> 
> This is what issue to check_rrd_data.pl:
> 
> ./check_rrd_data.pl
> /var/lib/cricket/edge/utilisation/inband.skt/fastethernet0_0.rrd 'return
> "Warning\n" if ($value > 10);' 'return \ "Critical\n" if ($value > 100);'
> 'printf \ "OK", $value; return 0;'
> 
> This is the code:
> 
> #!/usr/bin/perl -wT
> 
<snip>

> 
> # Doesn't work! Why? # BEGIN {
>         # my $runtimedir = substr($0,0,rindex($0,'/'));
>         # require "$runtimedir/utils.pm";
> # }

#**** BEGIN block breaks embedded perl
#***** add a "use lib" statement before loading modules

use lib "/usr/lib/netsaint/plugins/","/usr/share/cricket/lib/" ;

use utils.pm ;
use RRD::File ;

> require '/usr/lib/netsaint/plugins/utils.pm';
> 
> #changed by Jamie
> use lib '/usr/share/cricket/lib/RRD/File';
> 
> #use RRD::File;
> # use strict;                   # RRD:File and utils.pm don't like this
> 
> my $configfilepath = "/usr/lib/netsaint/plugins/rrd-files";     # Change if
> needed
> my %hostfile;                                           # For storing config
> my $rrdfile;                                            # RRD file to open
> 

<snip>

-- 

-sg



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list