[rrd-users] rrdtool perl interface from 1.0 to 1.2

Tobias Oetiker tobi at oetiker.ch
Mon Nov 26 16:41:58 CET 2007


Xavier,

note that 1.2 is able to read ad write  ALL 1.0 rrds the problem
may be that the old server was 32bit while the new one is 64 bit
... curently this is not compatible since the rrdtool data format
is architecture dependant ...

cheers
tobi

Today Xavier Beaudouin wrote:

> On Mon, 26 Nov 2007, Joe Loiacono wrote:
>
> > Make sure you have the RRDs that goes with 1.2. I upgraded RRDtool to v
> > 1.2, and somehow didn't get the RRDs upgraded.
>
> I am 100% sure. It is a brand new server installed from scratch :)
>
> Old server will be killed when this issue is fixed... (had lots of other
> issues, but this one is the most nasty one)....
>
> /Xavier
>
> > Joe
> >
> >
> >
> >
> > Xavier Beaudouin <kiwi at oav.net>
> > Sent by: rrd-users-bounces at lists.oetiker.ch
> > 11/26/2007 08:30 AM
> >
> > To
> > rrd-users at lists.oetiker.ch
> > cc
> >
> > Subject
> > [rrd-users] rrdtool perl interface from 1.0 to 1.2
> >
> >
> >
> >
> >
> >
> > Hello,
> >
> > I am trying to migrate some rrdtool scripts from a smokeping based on
> > rrdtool 1.0 to rrdtool 1.2 based.
> >
> > Migration are ok but it seems that RRDs perl library (and maybe rrdtool
> > itself also) has some woes with last update data.
> >
> > I used theses scripts to check some data from Smokeping and send alert in
> > Nagios is there is more than x% losts packets.
> >
> > Sample idea :
> >
> > rrdtool last <rrdfile>
> > rrdtool fetch <rrdfile> AVERAGE -s <value from last>
> >
> > This was working... on 1.0.49 without any pain.
> >
> > Now on 1.2.19 (backport from debian SID to Etch) the script doesn't work
> > at all and it seems that rrdtool last gave some random values because when
> >
> > I do rrdtool fetch ... I allways got nan value in return.
> >
> > I have saw that is rrdtools lastupdate, but it is not yet implemented into
> >
> > RRDs perl library.
> >
> > Any hints ? idea ? Fixes ?
> >
> > Script used :
> >
> > ---//---
> > #!/usr/bin/perl -w
> > use RRDs;
> > use strict;
> >
> > $ENV{'PATH'} = "/bin:/usr/bin";
> > $ENV{'ENV'} = "";
> >
> > if (scalar @ARGV != 3) {
> >         print STDERR join "' '", @ARGV, "\n";
> >         print "not enough argument\n";
> >         exit;
> > }
> >
> > my $rrd = $ARGV[0] if (-r $ARGV[0]);
> > my $warn= $ARGV[1];
> > my $crit=$ARGV[2];
> > my ($last) = RRDs::last ($rrd);
> >
> > my ($start,$step,$names,$data) = RRDs::fetch ($rrd,"AVERAGE","-s",$last);
> > my $line= @$data[0];
> > my $nbloss=@$line[1]
> >
> > if($nbloss >= $crit)
> > {
> >  printf "RRD CRITICAL too much packet loss or failed to connect.Lost pack
> > et : %4.2f packets\n", $nbloss;
> >         exit 2;
> > }
> > else
> > {
> >
> >         if( $nbloss >= $warn )
> >         {
> >                 printf "RRD WARNING.Lost packet : %4.2f packets\n",
> > $nbloss;
> >                 exit 1;
> >         }
> >         else
> >         {
> >                 printf "RRD OK.Lost packet :%4.2f packet\n", $nbloss;
> >                 exit 0;
> >         }
> > }
> > ---//----
> >
> > See that it is quite simple...
> >
> >
> > Thanks,
> > /Xavier
> >
> > --
> > Xavier Beaudouin - http://oav.net/
> >
> > _______________________________________________
> > rrd-users mailing list
> > rrd-users at lists.oetiker.ch
> > https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
> >
> >
>
> --
> Xavier Beaudouin - http://oav.net/
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902



More information about the rrd-users mailing list