Permalink
Browse files

master: bring back checks for graph_strategy set to cron.

This unbreaks the default generation of the graphs when not installing
the CGI (before, it would have worked if the CGI was in place).
  • Loading branch information...
Flameeyes authored and steveschnepp committed Jul 23, 2012
1 parent ebe809e commit 7b02885eb02509ccf0069b07264f6a5db73a991f
Showing with 3 additions and 5 deletions.
  1. +3 −5 master/lib/Munin/Master/HTMLConfig.pm
@@ -430,8 +430,6 @@ sub generate_service_templates {
$srv{'root_path'} = $root_path;
$srv{'filename'} = $filename;
- my $method = "cgi"; # Method can no longer be either cron or cgi, it's always cgi
-
$srv{'url'} = "$srv{node}.html";
my $path = join('/', @loc);
@@ -460,7 +458,7 @@ sub generate_service_templates {
}
}
- if ($method eq "cgi") {
+ if ($config->{'graph_strategy'} eq "cgi") {
map { $srv{$_} = $config->{'cgiurl_graph'} . "/" . $imgs{$_} } keys %imgs;
} else {
map { $srv{$_} = $root_path . "/" . $imgs{$_} } keys %imgs;
@@ -487,7 +485,7 @@ sub generate_service_templates {
for my $scale (@times) {
# Don't try to find the size if cgi is enabled,
# otherwise old data might pollute
- next if ($method eq "cgi");
+ next if ($config->{'graph_strategy'} eq "cgi");
if (my ($w, $h)
= get_png_size(munin_get_picture_filename($service, $scale))) {
$srv{"img" . $scale . "width"} = $w;
@@ -499,7 +497,7 @@ sub generate_service_templates {
$srv{imgweeksum} = "$srv{node}-week-sum.png";
$srv{imgyearsum} = "$srv{node}-year-sum.png";
for my $scale (["week", "year"]) {
- next if ($method eq "cgi");
+ next if ($config->{'graph_strategy'} eq "cgi");
if (my ($w, $h)
= get_png_size(munin_get_picture_filename($service, $scale, 1)))
{

0 comments on commit 7b02885

Please sign in to comment.