diff options
author | Niko Tyni <ntyni@iki.fi> | 2005-02-22 21:18:14 +0100 |
---|---|---|
committer | Niko Tyni <ntyni@iki.fi> | 2005-02-22 21:18:14 +0100 |
commit | 09504475c41653b151b02605ea1ea7b53f86e222 (patch) | |
tree | 371da03a85aaf263c8f16251172fa93cc8d86837 | |
parent | a8f89dab926914ba921b09adc6eaf2e92f9e0512 (diff) | |
download | smokeping-09504475c41653b151b02605ea1ea7b53f86e222.tar.gz smokeping-09504475c41653b151b02605ea1ea7b53f86e222.tar.xz |
* don't create any RRD files if running as a CGI -- niko
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/Smokeping.pm | 10 |
2 files changed, 7 insertions, 4 deletions
@@ -1,3 +1,4 @@ +* don't create any RRD files if running as a CGI -- niko * Curl timeouts work better now -- niko, reported by Chris Wilson <chris *aidworld.org> * Curl User-Agent string doesn't need quotes anymore -- niko * check at startup that existing RRD files conform to the config specifications -- niko diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index 82113a3..8cd5897 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -370,10 +370,12 @@ sub init_target_tree ($$$$) { 1..$pings), (map { "RRA:".(join ":", @{$_}) } @{$cfg->{Database}{_table}} )); if (not -f $name.".rrd"){ - do_debuglog("Calling RRDs::create(@create)"); - RRDs::create(@create); - my $ERROR = RRDs::error(); - do_log "RRDs::create ERROR: $ERROR\n" if $ERROR; + unless ($cgimode) { + do_debuglog("Calling RRDs::create(@create)"); + RRDs::create(@create); + my $ERROR = RRDs::error(); + do_log "RRDs::create ERROR: $ERROR\n" if $ERROR; + } } else { shift @create; # remove the filename my $comparison = Smokeping::RRDtools::compare($name.".rrd", \@create); |