Skip to content

Commit 239246d

Browse files
committed
Generate empty.rrd at each request to fix issue #23
1 parent 6af72d9 commit 239246d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rpimonitor/rpimonitord

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ sub CreateRRD
194194

195195
my $current = time();
196196
my $start = $current - 60;
197+
198+
unlink $filename;
197199

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

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

0 commit comments

Comments
 (0)