Skip to content

Commit

Permalink
Generate empty.rrd at each request to fix issue #23
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierBerger committed Mar 16, 2014
1 parent 6af72d9 commit 239246d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rpimonitor/rpimonitord
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ sub CreateRRD

my $current = time();
my $start = $current - 60;

unlink $filename;

$this->Debug(2,"$filename",
"--start", $start,
Expand Down Expand Up @@ -406,6 +408,8 @@ sub DoGET
$path =~ /shellinabox$/ and $this->ShowShellinabox( $configuration, $request->header('Host') ) and return;
$path =~ /dynamic\.json/ and $this->SendStatus( $configuration ) and return;
$path =~ /([^\/]+)\.json/ and $this->SendJSON($this->{$1}) and return;
#Recreate empty rrd on demand
$path =~ /empty\.rrd/ and $configuration->CreateRRD( "$configuration->{'daemon'}->{'webroot'}/stat/empty.rrd", 'empty', 'GAUGE', 'U', 'U' );

#The main page (/) is requested
$path =~ /^\/$/ and $path = "/index.html";
Expand Down

0 comments on commit 239246d

Please sign in to comment.