#
# RRD support through executing rrdtool
#

package Statusmon::RRDi;

use Statusmon::Statusmon;

@Statusmon::RRDi::ISA = qw(Statusmon::Statusmon);


sub new
{

    my ($this) = @_;
    my  $class = ref($this) || $this;
    my  $self = {};

    bless($self, $class);

    $self->add_feature_provider( "rrd" );
    return($self);
}


sub start {
}
    


sub rrd_create {
    my( $self, $file, @args ) = @_;

    my $status = Platform::system( "rrdtool", "create", $file, @args );
    return( (! $status) && (-f $file) );
}


sub rrd_update {
    my( $self, $file, @args ) = @_;

    my $status = Platform::system( "rrdtool", "update", $file, @args );
    return( ! $status );
}


sub rrd_graph {
    my( $self, $file, @args ) = @_;

    my $status = Platform::system( "rrdtool", "graph", $file, @args );
    return( ! $status );
}


1;
