RRD::Simple

Simple interface to create and store data in RRD files
Download

RRD::Simple Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Nicola Worthington
  • Publisher web site:
  • http://search.cpan.org/~nicolaw/

RRD::Simple Tags


RRD::Simple Description

Simple interface to create and store data in RRD files RRD::Simple is a simple Perl interface to create and store data in RRD files.SYNOPSIS use strict; use RRD::Simple (); # Create an interface object my $rrd = RRD::Simple->new( file => "myfile.rrd" ); # Create a new RRD file with 3 data sources called # bytesIn, bytesOut and faultsPerSec. $rrd->create( bytesIn => "GAUGE", bytesOut => "GAUGE", faultsPerSec => "COUNTER" ); # Put some arbitary data values in the RRD file for the same # 3 data sources called bytesIn, bytesOut and faultsPerSec. $rrd->update( bytesIn => 10039, bytesOut => 389, faultsPerSec => 0.4 ); # Generate graphs: # /var/tmp/myfile-daily.png, /var/tmp/myfile-weekly.png # /var/tmp/myfile-monthly.png, /var/tmp/myfile-annual.png my %rtn = $rrd->graph( destination => "/var/tmp", title => "Network Interface eth0", vertical_label => "Bytes/Faults", interlaced => "" ); printf("Created %s ",join(", ",map { $rtn{$_}-> } keys %rtn)); # Return information about an RRD file my $info = $rrd->info; require Data::Dumper; print Data::Dumper::Dumper($info); # Get unixtime of when RRD file was last updated my $lastUpdated = $rrd->last; print "myfile.rrd was last updated at " . scalar(localtime($lastUpdated)) . " "; # Get list of data source names from an RRD file my @dsnames = $rrd->sources; print "Available data sources: " . join(", ", @dsnames) . " "; # And for the ultimately lazy, you could create and update # an RRD in one go using a one-liner like this: perl -MRRD::Simple=:all -e"update(@ARGV)" myfile.rrd bytesIn 99999RRD::Simple provides a simple interface to RRDTool's RRDs module. This module does not currently offer a fetch method that is available in the RRDs module.It does however create RRD files with a sensible set of default RRA (Round Robin Archive) definitions, and can dynamically add new data source names to an existing RRD file.This module is ideal for quick and simple storage of data within an RRD file if you do not need to, nor want to, bother defining custom RRA definitions. Requirements: · Perl


RRD::Simple Related Software