wok-current rev 3583

perl-rrd-simple: fix rrd_addsource
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 26 18:13:45 2009 +0200 (2009-06-26)
parents 471df2a3ab20
children e829f657b054
files perl-rrd-simple/stuff/usr/bin/rrd_addsource
line diff
     1.1 --- a/perl-rrd-simple/stuff/usr/bin/rrd_addsource	Fri Jun 26 17:57:24 2009 +0200
     1.2 +++ b/perl-rrd-simple/stuff/usr/bin/rrd_addsource	Fri Jun 26 18:13:45 2009 +0200
     1.3 @@ -5,16 +5,18 @@
     1.4  
     1.5  use RRD::Simple();
     1.6  
     1.7 -if (@ARGV != 2) {
     1.8 -   print "Usage: $0 rrdfile DSname\n";
     1.9 +if (@ARGV != 3) {
    1.10 +   print "Usage: $0 rrdfile DSname DStype \n";
    1.11 +   print "Example: $0 cpu.rrd nice COUNTER \n";
    1.12     exit;
    1.13  }
    1.14  
    1.15  my $file = $ARGV[0];
    1.16  my $dsname = $ARGV[1];
    1.17 +my $dstype = $ARGV[2];
    1.18  
    1.19  my $rrd = RRD::Simple->new();
    1.20  
    1.21 -print "Add $dsname into $file...";
    1.22 -$rrd->add_source($file, 'DS_name' => $dsname);
    1.23 +print "Add $dsname:$dstype into $file...";
    1.24 +$rrd->add_source($file, $dsname => $dstype);
    1.25  print " ok.\n";