[rrd-users] PRINT to stdout - I give up

EA Kissack lists2012 at kissack.co.uk
Sat Dec 24 13:29:02 CET 2011


I've spent hours googling and trying various methods, none of which has 
worked.  All I want to to print a value from my rrd so that I can make a 
decision on it in a perl script.  The solution appears to be to specify 
- as the graph name, dont use a graph command an PRINT.  However I get 
no output. Hence my call for help (even if only a link to search this 
archive, as I couldn't find that either).

I am modifying rrd graphs etc on ipcop version 2.0.2

Here is the section of /usr/local/bin/makegraphs that I have added:

sub allan {
     my @rrd = ();

     push @rrd, "-";
     push @rrd, "-s -3600";
     push @rrd, "DEF:bidevices=$rrdlog/bwin.rrd:idevices:AVERAGE";
     push @rrd, "DEF:biservers=$rrdlog/bwin.rrd:iservers:AVERAGE";
     push @rrd, "DEF:biallans=$rrdlog/bwin.rrd:iallans:AVERAGE";
     push @rrd, "DEF:bikarens=$rrdlog/bwin.rrd:ikarens:AVERAGE";
     push @rrd, "DEF:bikevins=$rrdlog/bwin.rrd:ikevins:AVERAGE";
     push @rrd, "DEF:bicarls=$rrdlog/bwin.rrd:icarls:AVERAGE";
     push @rrd, "DEF:biothers=$rrdlog/bwin.rrd:iothers:AVERAGE";
     push @rrd, "DEF:bidhcps=$rrdlog/bwin.rrd:idhcps:AVERAGE";
     push @rrd, "DEF:bidmzs=$rrdlog/bwin.rrd:idmzs:AVERAGE";
     push @rrd, "DEF:biwlans=$rrdlog/bwin.rrd:iwlans:AVERAGE";

     push @rrd, "CDEF:idevices=bidevices,8,*";
     push @rrd, "CDEF:iservers=biservers,8,*";
     push @rrd, "CDEF:iallans=biallans,8,*";
     push @rrd, "CDEF:ikarens=bikarens,8,*";
     push @rrd, "CDEF:ikevins=bikevins,8,*";
     push @rrd, "CDEF:icarls=bicarls,8,*";
     push @rrd, "CDEF:iothers=biothers,8,*";
     push @rrd, "CDEF:idhcps=bidhcps,8,*";
     push @rrd, "CDEF:idmzs=bidmzs,8,*";
     push @rrd, "CDEF:iwlans=biwlans,8,*";
     push @rrd, "CDEF:ihardware=idevices,iservers,+";
     push @rrd, "CDEF:iguests=iothers,idhcps,iwlans,+,+";
     push @rrd, 
"CDEF:itotal=iguests,ihardware,iallans,ikarens,ikevins,icarls,idmzs,+,+,+,+,+,+";

     push @rrd, "PRINT:itotal:MAX:%9.0lf max\n";

     RRDs::graph(@rrd);
     $ERROR = RRDs::error;
     print "Error in RRD::graph for allan-bandwidth-in: $ERROR\n" if 
$ERROR;
}

This is called further down and is using an rrd that successfully 
renders to a graph in another procedure. However running the script 
produces nothing on the command line

thanks
-- 
Allan



More information about the rrd-users mailing list