Zoomed graphs in 'memcached.pm' now honour the 'global_zoom' option, and they also use the function RRDs::graphv to fit better in the browser pop up window (only for RRDtool v1.3+)

This commit is contained in:
Jordi Sanfeliu 2015-02-03 16:43:54 +01:00
parent fb3db44c1f
commit 238bbf2060
1 changed files with 87 additions and 21 deletions

View File

@ -404,6 +404,15 @@ sub memcached_cgi {
my $graph = $cgi->{graph}; my $graph = $cgi->{graph};
my $silent = $cgi->{silent}; my $silent = $cgi->{silent};
my $zoom = "--zoom=" . $config->{global_zoom}; my $zoom = "--zoom=" . $config->{global_zoom};
my %rrd = (
'new' => \&RRDs::graphv,
'old' => \&RRDs::graph,
);
my $version = "new";
my $pic;
my $picz;
my $picz_width;
my $picz_height;
my $u = ""; my $u = "";
my $width; my $width;
@ -421,6 +430,7 @@ sub memcached_cgi {
my $str; my $str;
my $err; my $err;
$version = "old" if $RRDs::VERSION < 1.3;
my $rrd = $config->{base_lib} . $package . ".rrd"; my $rrd = $config->{base_lib} . $package . ".rrd";
my $title = $config->{graph_title}->{$package}; my $title = $config->{graph_title}->{$package};
my $PNG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir}; my $PNG_DIR = $config->{base_dir} . "/" . $config->{imgs_dir};
@ -625,7 +635,7 @@ sub memcached_cgi {
($width, $height) = split('x', $config->{graph_size}->{main}) if $silent eq "imagetagbig"; ($width, $height) = split('x', $config->{graph_size}->{main}) if $silent eq "imagetagbig";
@tmp = @tmpz; @tmp = @tmpz;
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7]",
"--title=$config->{graphs}->{_memcached1} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached1} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -655,7 +665,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7]",
"--title=$config->{graphs}->{_memcached1} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached1} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -663,6 +673,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
"DEF:inchit=$rrd:memc" . $e . "_inchit:AVERAGE", "DEF:inchit=$rrd:memc" . $e . "_inchit:AVERAGE",
@ -686,7 +697,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7] . "'>\n");
@ -751,7 +769,7 @@ sub memcached_cgi {
($width, $height) = split('x', $config->{graph_size}->{main}) if $silent eq "imagetagbig"; ($width, $height) = split('x', $config->{graph_size}->{main}) if $silent eq "imagetagbig";
@tmp = @tmpz; @tmp = @tmpz;
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7 + 1]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7 + 1]",
"--title=$config->{graphs}->{_memcached2} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached2} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -782,7 +800,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 1]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 1]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7 + 1]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7 + 1]",
"--title=$config->{graphs}->{_memcached2} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached2} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -790,6 +808,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
"DEF:autcmd=$rrd:memc" . $e . "_autcmd:AVERAGE", "DEF:autcmd=$rrd:memc" . $e . "_autcmd:AVERAGE",
@ -812,7 +831,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 1] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 1] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 1] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 1] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 1] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 1] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 1] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 1] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 1] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 1] . "'>\n");
@ -848,7 +874,7 @@ sub memcached_cgi {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7 + 2]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7 + 2]",
"--title=$config->{graphs}->{_memcached3} (${cachesizemb}MB) ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached3} (${cachesizemb}MB) ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -871,7 +897,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 2]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 2]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7 + 2]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7 + 2]",
"--title=$config->{graphs}->{_memcached3} (${cachesizemb}MB) ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached3} (${cachesizemb}MB) ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -879,6 +905,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$cgi->{version12_small}}, @{$cgi->{version12_small}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
@ -896,7 +923,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 2] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 2] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 2] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 2] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 2] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 2] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 2] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 2] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 2] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 2] . "'>\n");
@ -924,7 +958,7 @@ sub memcached_cgi {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7 + 3]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7 + 3]",
"--title=$config->{graphs}->{_memcached4} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached4} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -944,7 +978,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 3]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 3]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7 + 3]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7 + 3]",
"--title=$config->{graphs}->{_memcached4} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached4} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -952,6 +986,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$cgi->{version12_small}}, @{$cgi->{version12_small}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
@ -969,7 +1004,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 3] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 3] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 3] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 3] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 3] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 3] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 3] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 3] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 3] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 3] . "'>\n");
@ -1003,7 +1045,7 @@ sub memcached_cgi {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7 + 4]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7 + 4]",
"--title=$config->{graphs}->{_memcached5} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached5} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -1025,7 +1067,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 4]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 4]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7 + 4]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7 + 4]",
"--title=$config->{graphs}->{_memcached5} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached5} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -1033,6 +1075,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$cgi->{version12_small}}, @{$cgi->{version12_small}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
@ -1052,7 +1095,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 4] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 4] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 4] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 4] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 4] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 4] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 4] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 4] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 4] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 4] . "'>\n");
@ -1086,7 +1136,7 @@ sub memcached_cgi {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7 + 5]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7 + 5]",
"--title=$config->{graphs}->{_memcached6} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached6} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -1108,7 +1158,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 5]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 5]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7 + 5]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7 + 5]",
"--title=$config->{graphs}->{_memcached6} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached6} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -1116,6 +1166,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$cgi->{version12_small}}, @{$cgi->{version12_small}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
@ -1135,7 +1186,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 5] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 5] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 5] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 5] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 5] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 5] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 5] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 5] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 5] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 5] . "'>\n");
@ -1172,7 +1230,7 @@ sub memcached_cgi {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
} }
RRDs::graph("$PNG_DIR" . "$PNG[$e * 7 + 6]", $pic = $rrd{$version}->("$PNG_DIR" . "$PNG[$e * 7 + 6]",
"--title=$config->{graphs}->{_memcached7} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached7} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -1193,7 +1251,7 @@ sub memcached_cgi {
print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 6]: $err\n") if $err; print("ERROR: while graphing $PNG_DIR" . "$PNG[$e * 7 + 6]: $err\n") if $err;
if(lc($config->{enable_zoom}) eq "y") { if(lc($config->{enable_zoom}) eq "y") {
($width, $height) = split('x', $config->{graph_size}->{zoom}); ($width, $height) = split('x', $config->{graph_size}->{zoom});
RRDs::graph("$PNG_DIR" . "$PNGz[$e * 7 + 6]", $picz = $rrd{$version}->("$PNG_DIR" . "$PNGz[$e * 7 + 6]",
"--title=$config->{graphs}->{_memcached7} ($tf->{nwhen}$tf->{twhen})", "--title=$config->{graphs}->{_memcached7} ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=PNG", "--imgformat=PNG",
@ -1201,6 +1259,7 @@ sub memcached_cgi {
"--width=$width", "--width=$width",
"--height=$height", "--height=$height",
@riglim, @riglim,
$zoom,
@{$cgi->{version12}}, @{$cgi->{version12}},
@{$cgi->{version12_small}}, @{$cgi->{version12_small}},
@{$colors->{graph_colors}}, @{$colors->{graph_colors}},
@ -1219,7 +1278,14 @@ sub memcached_cgi {
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 6] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 6] . "' border='0'></a>\n"); print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 6] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 6] . "' border='0'></a>\n");
} }
else { else {
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 6] . "','','width=" . ($width + 115) . ",height=" . ($height + 100) . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 6] . "' border='0'></a>\n"); if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
}
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $PNGz[$e * 7 + 6] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 6] . "' border='0'></a>\n");
} }
} else { } else {
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 6] . "'>\n"); print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $PNG[$e * 7 + 6] . "'>\n");