check_rrd_data.pl

Jamie jamie at bclnz.net
Wed Feb 26 02:26:18 CET 2003


OK, so I modded that (as the suggestion didn't work) to:

<snip>
# Copyright Notice: GPL
#
require '/usr/lib/netsaint/plugins/utils.pm';
#changed by Jamie
use lib '/usr/share/cricket/lib/';
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>

Now I'm getting
SCALAR(0x821c400) as a response.

which means I'm getting:
a) Closer
b) Lost.

Thoughts?

Jamie


----- Original Message -----
From: "Subhendu Ghosh" <sghosh at sghosh.org>
To: <nagios-users at lists.sourceforge.net>
Sent: Wednesday, February 26, 2003 1:25 PM
Subject: Re: [Nagios-users] check_rrd_data.pl


> 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
>



-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
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