Code

initial
[rrdtool-all.git] / tutorial / ouce2013 / rrd-by-example / ex / v-interfaces.pl
diff --git a/tutorial/ouce2013/rrd-by-example/ex/v-interfaces.pl b/tutorial/ouce2013/rrd-by-example/ex/v-interfaces.pl
new file mode 100644 (file)
index 0000000..0dcdc0a
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/perl -w
+use strict;
+use lib qw( /scratch/rrd4/lib/perl );
+use RRDs;
+my $out = RRDs::graphv(
+     '-', '--start' => '00:00 20080916',
+     '--end' => 'start+8d',
+     '--lower-limit' => 0,
+     '--imgformat' => 'PDF',
+     'DEF:a=hw-demo.rrd:in:AVERAGE',
+     'LINE1:a#c00:InOctets');
+my $ERROR = RRDs::error;
+die "ERROR: $ERROR\n" if $ERROR;
+map { 
+    print $_.' = '.substr($out->{$_},0,8)."\n" 
+} sort keys %$out;