X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=bindings%2Fperl-piped%2FRRDp.pm;h=63d968fc86d66ac556d2ba191f153265a644105f;hb=d9822df7ed5e8122cf3a62e4e99678e94007f504;hp=e37104bd78f88fb351a9a06919122b2d724a760a;hpb=034c985d61f53f91dac1c2f5facffa51b145a536;p=pkg-rrdtool.git diff --git a/bindings/perl-piped/RRDp.pm b/bindings/perl-piped/RRDp.pm index e37104b..63d968f 100644 --- a/bindings/perl-piped/RRDp.pm +++ b/bindings/perl-piped/RRDp.pm @@ -42,9 +42,12 @@ start RRDtool. The argument must be the path to the RRDtool executable =item B I -pass commands on to RRDtool. check the RRDtool documentation for +pass commands on to RRDtool. Check the RRDtool documentation for more info on the RRDtool commands. +B: Due to design limitations, B does not support the +C command - use C instead. + =item $answer = B read RRDtool's response to your command. Note that the $answer variable will @@ -66,7 +69,7 @@ running, System time is the time spend in system calls and real time is the total time RRDtool has been running. The difference between user + system and real is the time spent -waiting for things like the hard disk and new input from the perl +waiting for things like the hard disk and new input from the Perl script. =item B<$RRDp::error_mode> and B<$RRDp::error> @@ -102,6 +105,7 @@ For more information on how to use RRDtool, check the manpages. Tobias Oetiker =cut + #' this is to make cperl.el happy use strict; @@ -120,7 +124,7 @@ sub cmd (@); sub end (); sub read (); -$VERSION=1.299908051800; +$VERSION=1.4008; sub start ($){ croak "rrdtool is already running" @@ -186,6 +190,13 @@ sub cmd (@){ } $cmd =~ s/\n/ /gs; $cmd =~ s/\s/ /gs; + + # The generated graphs aren't necessarily terminated by a newline, + # causing RRDp::read() to wait for a line matching '^OK' forever. + if ($cmd =~ m/^\s*graph\s+-\s+/) { + croak "RRDp does not support the 'graph -' command - " + . "use 'graphv -' instead"; + } print RRDwriteHand "$cmd\n"; }