mirror of https://github.com/mikaku/Monitorix.git
redirect all the output into an array to support parallelizing in 'mysql.pm'
This commit is contained in:
parent
d77d35f29b
commit
1b76900b15
141
lib/mysql.pm
141
lib/mysql.pm
|
@ -1,7 +1,7 @@
|
||||||
#
|
#
|
||||||
# Monitorix - A lightweight system monitoring tool.
|
# Monitorix - A lightweight system monitoring tool.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005-2016 by Jordi Sanfeliu <jordi@fibranet.cat>
|
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -485,6 +485,7 @@ sub mysql_update {
|
||||||
|
|
||||||
sub mysql_cgi {
|
sub mysql_cgi {
|
||||||
my ($package, $config, $cgi) = @_;
|
my ($package, $config, $cgi) = @_;
|
||||||
|
my @output;
|
||||||
|
|
||||||
my $mysql = $config->{mysql};
|
my $mysql = $config->{mysql};
|
||||||
my @rigid = split(',', ($mysql->{rigid} || ""));
|
my @rigid = split(',', ($mysql->{rigid} || ""));
|
||||||
|
@ -540,21 +541,21 @@ sub mysql_cgi {
|
||||||
#
|
#
|
||||||
if(lc($config->{iface_mode}) eq "text") {
|
if(lc($config->{iface_mode}) eq "text") {
|
||||||
if($title) {
|
if($title) {
|
||||||
main::graph_header($title, 2);
|
push(@output, main::graph_header($title, 2));
|
||||||
print(" <tr>\n");
|
push(@output, " <tr>\n");
|
||||||
print(" <td bgcolor='$colors->{title_bg_color}'>\n");
|
push(@output, " <td bgcolor='$colors->{title_bg_color}'>\n");
|
||||||
}
|
}
|
||||||
my (undef, undef, undef, $data) = RRDs::fetch("$rrd",
|
my (undef, undef, undef, $data) = RRDs::fetch("$rrd",
|
||||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||||
"AVERAGE",
|
"AVERAGE",
|
||||||
"-r $tf->{res}");
|
"-r $tf->{res}");
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while fetching $rrd: $err\n") if $err;
|
push(@output, "ERROR: while fetching $rrd: $err\n") if $err;
|
||||||
my $line1;
|
my $line1;
|
||||||
my $line2;
|
my $line2;
|
||||||
my $line3;
|
my $line3;
|
||||||
print(" <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
|
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
|
||||||
print(" ");
|
push(@output, " ");
|
||||||
for($n = 0; $n < scalar(my @ml = split(',', $mysql->{list})); $n++) {
|
for($n = 0; $n < scalar(my @ml = split(',', $mysql->{list})); $n++) {
|
||||||
$line1 = " ";
|
$line1 = " ";
|
||||||
$line2 .= " Select Commit Delete Insert Insert_S Update Replace Replace_S Rollback TCacheHit QCache_U Conns_U KeyBuf_U InnoDB_U OpenedTbl TLocks_W Queries SlowQrs Conns AbrtCli AbrtConn BytesRecv BytesSent QCacheHitR StmtExec TmpTbToDsk";
|
$line2 .= " Select Commit Delete Insert Insert_S Update Replace Replace_S Rollback TCacheHit QCache_U Conns_U KeyBuf_U InnoDB_U OpenedTbl TLocks_W Queries SlowQrs Conns AbrtCli AbrtConn BytesRecv BytesSent QCacheHitR StmtExec TmpTbToDsk";
|
||||||
|
@ -562,16 +563,16 @@ sub mysql_cgi {
|
||||||
if($line1) {
|
if($line1) {
|
||||||
my $i = length($line1);
|
my $i = length($line1);
|
||||||
if(lc($mysql->{conn_type}) eq "host") {
|
if(lc($mysql->{conn_type}) eq "host") {
|
||||||
printf(sprintf("%${i}s", sprintf("%s:%s", $ml[$n], trim((split(',', $mysql->{desc}->{$ml[$n]}))[0]))));
|
push(@output, sprintf(sprintf("%${i}s", sprintf("%s:%s", $ml[$n], trim((split(',', $mysql->{desc}->{$ml[$n]}))[0])))));
|
||||||
}
|
}
|
||||||
if(lc($mysql->{conn_type}) eq "socket") {
|
if(lc($mysql->{conn_type}) eq "socket") {
|
||||||
printf(sprintf("%${i}s", sprintf("socket: %s", $ml[$n])));
|
push(@output, sprintf(sprintf("%${i}s", sprintf("socket: %s", $ml[$n]))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print("\n");
|
push(@output, "\n");
|
||||||
print("Time$line2\n");
|
push(@output, "Time$line2\n");
|
||||||
print("----$line3 \n");
|
push(@output, "----$line3 \n");
|
||||||
my $line;
|
my $line;
|
||||||
my @row;
|
my @row;
|
||||||
my $time;
|
my $time;
|
||||||
|
@ -581,24 +582,24 @@ sub mysql_cgi {
|
||||||
for($n = 0, $time = $tf->{tb}; $n < ($tf->{tb} * $tf->{ts}); $n++) {
|
for($n = 0, $time = $tf->{tb}; $n < ($tf->{tb} * $tf->{ts}); $n++) {
|
||||||
$line = @$data[$n];
|
$line = @$data[$n];
|
||||||
$time = $time - (1 / $tf->{ts});
|
$time = $time - (1 / $tf->{ts});
|
||||||
printf(" %2d$tf->{tc}", $time);
|
push(@output, sprintf(" %2d$tf->{tc}", $time));
|
||||||
for($n2 = 0; $n2 < scalar(my @ml = split(',', $mysql->{list})); $n2++) {
|
for($n2 = 0; $n2 < scalar(my @ml = split(',', $mysql->{list})); $n2++) {
|
||||||
undef(@row);
|
undef(@row);
|
||||||
$from = $n2 * 38;
|
$from = $n2 * 38;
|
||||||
$to = $from + 38;
|
$to = $from + 38;
|
||||||
push(@row, @$line[$from..$to]);
|
push(@row, @$line[$from..$to]);
|
||||||
printf(" %6d %6d %6d %6d %8d %6d %7d %8d %8d %2d%% %2d%% %2d%% %2d%% %2d%% %6d %6d %6d %6d %6d %6d %6d %9d %9d %2d%% %6d %2d%%", @row);
|
push(@output, sprintf(" %6d %6d %6d %6d %8d %6d %7d %8d %8d %2d%% %2d%% %2d%% %2d%% %2d%% %6d %6d %6d %6d %6d %6d %6d %9d %9d %2d%% %6d %2d%%", @row));
|
||||||
}
|
}
|
||||||
print("\n");
|
push(@output, "\n");
|
||||||
}
|
}
|
||||||
print(" </pre>\n");
|
push(@output, " </pre>\n");
|
||||||
if($title) {
|
if($title) {
|
||||||
print(" </td>\n");
|
push(@output, " </td>\n");
|
||||||
print(" </tr>\n");
|
push(@output, " </tr>\n");
|
||||||
main::graph_footer();
|
push(@output, main::graph_footer());
|
||||||
}
|
}
|
||||||
print(" <br>\n");
|
push(@output, " <br>\n");
|
||||||
return;
|
return @output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -637,15 +638,15 @@ sub mysql_cgi {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($e) {
|
if($e) {
|
||||||
print(" <br>\n");
|
push(@output, " <br>\n");
|
||||||
}
|
}
|
||||||
if($title) {
|
if($title) {
|
||||||
main::graph_header($title, 2);
|
push(@output, main::graph_header($title, 2));
|
||||||
}
|
}
|
||||||
@riglim = @{setup_riglim($rigid[0], $limit[0])};
|
@riglim = @{setup_riglim($rigid[0], $limit[0])};
|
||||||
if($title) {
|
if($title) {
|
||||||
print(" <tr>\n");
|
push(@output, " <tr>\n");
|
||||||
print(" <td valign='top' bgcolor='$colors->{title_bg_color}'>\n");
|
push(@output, " <td valign='top' bgcolor='$colors->{title_bg_color}'>\n");
|
||||||
}
|
}
|
||||||
undef(@tmp);
|
undef(@tmp);
|
||||||
undef(@tmpz);
|
undef(@tmpz);
|
||||||
|
@ -748,7 +749,7 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmp);
|
@tmp);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 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});
|
||||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6]",
|
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6]",
|
||||||
|
@ -776,13 +777,13 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmpz);
|
@tmpz);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6]: $err\n") if $err;
|
||||||
}
|
}
|
||||||
$e2 = $e + 1;
|
$e2 = $e + 1;
|
||||||
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
||||||
if(lc($config->{enable_zoom}) eq "y") {
|
if(lc($config->{enable_zoom}) eq "y") {
|
||||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||||
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6] . "' border='0'></a>\n");
|
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6] . "' border='0'></a>\n");
|
||||||
} else {
|
} else {
|
||||||
if($version eq "new") {
|
if($version eq "new") {
|
||||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||||
|
@ -791,10 +792,10 @@ sub mysql_cgi {
|
||||||
$picz_width = $width + 115;
|
$picz_width = $width + 115;
|
||||||
$picz_height = $height + 100;
|
$picz_height = $height + 100;
|
||||||
}
|
}
|
||||||
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6] . "' border='0'></a>\n");
|
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6] . "' border='0'></a>\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6] . "'>\n");
|
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6] . "'>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,7 +880,7 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmp);
|
@tmp);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 1]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 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});
|
||||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 1]",
|
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 1]",
|
||||||
|
@ -904,13 +905,13 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmpz);
|
@tmpz);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 1]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 1]: $err\n") if $err;
|
||||||
}
|
}
|
||||||
$e2 = $e + 2;
|
$e2 = $e + 2;
|
||||||
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
||||||
if(lc($config->{enable_zoom}) eq "y") {
|
if(lc($config->{enable_zoom}) eq "y") {
|
||||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||||
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 1] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 1] . "' border='0'></a>\n");
|
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 1] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 1] . "' border='0'></a>\n");
|
||||||
} else {
|
} else {
|
||||||
if($version eq "new") {
|
if($version eq "new") {
|
||||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||||
|
@ -919,16 +920,16 @@ sub mysql_cgi {
|
||||||
$picz_width = $width + 115;
|
$picz_width = $width + 115;
|
||||||
$picz_height = $height + 100;
|
$picz_height = $height + 100;
|
||||||
}
|
}
|
||||||
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 1] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 1] . "' border='0'></a>\n");
|
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 1] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 1] . "' border='0'></a>\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 1] . "'>\n");
|
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 1] . "'>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($title) {
|
if($title) {
|
||||||
print(" </td>\n");
|
push(@output, " </td>\n");
|
||||||
print(" <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
|
push(@output, " <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
|
||||||
}
|
}
|
||||||
@riglim = @{setup_riglim($rigid[2], $limit[2])};
|
@riglim = @{setup_riglim($rigid[2], $limit[2])};
|
||||||
undef(@tmp);
|
undef(@tmp);
|
||||||
|
@ -977,7 +978,7 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmp);
|
@tmp);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 2]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 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});
|
||||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 2]",
|
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 2]",
|
||||||
|
@ -998,13 +999,13 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmpz);
|
@tmpz);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 2]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 2]: $err\n") if $err;
|
||||||
}
|
}
|
||||||
$e2 = $e + 3;
|
$e2 = $e + 3;
|
||||||
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
||||||
if(lc($config->{enable_zoom}) eq "y") {
|
if(lc($config->{enable_zoom}) eq "y") {
|
||||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||||
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 2] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 2] . "' border='0'></a>\n");
|
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 2] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 2] . "' border='0'></a>\n");
|
||||||
} else {
|
} else {
|
||||||
if($version eq "new") {
|
if($version eq "new") {
|
||||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||||
|
@ -1013,10 +1014,10 @@ sub mysql_cgi {
|
||||||
$picz_width = $width + 115;
|
$picz_width = $width + 115;
|
||||||
$picz_height = $height + 100;
|
$picz_height = $height + 100;
|
||||||
}
|
}
|
||||||
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 2] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 2] . "' border='0'></a>\n");
|
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 2] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 2] . "' border='0'></a>\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 2] . "'>\n");
|
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 2] . "'>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1067,7 +1068,7 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmp);
|
@tmp);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 3]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 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});
|
||||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 3]",
|
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 3]",
|
||||||
|
@ -1088,13 +1089,13 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmpz);
|
@tmpz);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 3]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 3]: $err\n") if $err;
|
||||||
}
|
}
|
||||||
$e2 = $e + 4;
|
$e2 = $e + 4;
|
||||||
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
||||||
if(lc($config->{enable_zoom}) eq "y") {
|
if(lc($config->{enable_zoom}) eq "y") {
|
||||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||||
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 3] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 3] . "' border='0'></a>\n");
|
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 3] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 3] . "' border='0'></a>\n");
|
||||||
} else {
|
} else {
|
||||||
if($version eq "new") {
|
if($version eq "new") {
|
||||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||||
|
@ -1103,10 +1104,10 @@ sub mysql_cgi {
|
||||||
$picz_width = $width + 115;
|
$picz_width = $width + 115;
|
||||||
$picz_height = $height + 100;
|
$picz_height = $height + 100;
|
||||||
}
|
}
|
||||||
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 3] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 3] . "' border='0'></a>\n");
|
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 3] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 3] . "' border='0'></a>\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 3] . "'>\n");
|
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 3] . "'>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1163,7 +1164,7 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmp);
|
@tmp);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 4]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 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});
|
||||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 4]",
|
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 4]",
|
||||||
|
@ -1185,13 +1186,13 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmpz);
|
@tmpz);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 4]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 4]: $err\n") if $err;
|
||||||
}
|
}
|
||||||
$e2 = $e + 5;
|
$e2 = $e + 5;
|
||||||
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
||||||
if(lc($config->{enable_zoom}) eq "y") {
|
if(lc($config->{enable_zoom}) eq "y") {
|
||||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||||
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 4] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 4] . "' border='0'></a>\n");
|
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 4] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 4] . "' border='0'></a>\n");
|
||||||
} else {
|
} else {
|
||||||
if($version eq "new") {
|
if($version eq "new") {
|
||||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||||
|
@ -1200,10 +1201,10 @@ sub mysql_cgi {
|
||||||
$picz_width = $width + 115;
|
$picz_width = $width + 115;
|
||||||
$picz_height = $height + 100;
|
$picz_height = $height + 100;
|
||||||
}
|
}
|
||||||
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 4] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 4] . "' border='0'></a>\n");
|
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 4] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 4] . "' border='0'></a>\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 4] . "'>\n");
|
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 4] . "'>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1262,7 +1263,7 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmp);
|
@tmp);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 5]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 6 + 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});
|
||||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 5]",
|
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 6 + 5]",
|
||||||
|
@ -1283,13 +1284,13 @@ sub mysql_cgi {
|
||||||
@CDEF,
|
@CDEF,
|
||||||
@tmpz);
|
@tmpz);
|
||||||
$err = RRDs::error;
|
$err = RRDs::error;
|
||||||
print("ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 5]: $err\n") if $err;
|
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 6 + 5]: $err\n") if $err;
|
||||||
}
|
}
|
||||||
$e2 = $e + 6;
|
$e2 = $e + 6;
|
||||||
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
if($title || ($silent =~ /imagetag/ && $graph =~ /mysql$e2/)) {
|
||||||
if(lc($config->{enable_zoom}) eq "y") {
|
if(lc($config->{enable_zoom}) eq "y") {
|
||||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||||
print(" <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 5] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 5] . "' border='0'></a>\n");
|
push(@output, " <a href=\"" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 5] . "\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 5] . "' border='0'></a>\n");
|
||||||
} else {
|
} else {
|
||||||
if($version eq "new") {
|
if($version eq "new") {
|
||||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||||
|
@ -1298,31 +1299,31 @@ sub mysql_cgi {
|
||||||
$picz_width = $width + 115;
|
$picz_width = $width + 115;
|
||||||
$picz_height = $height + 100;
|
$picz_height = $height + 100;
|
||||||
}
|
}
|
||||||
print(" <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 5] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 5] . "' border='0'></a>\n");
|
push(@output, " <a href=\"javascript:void(window.open('" . $config->{url} . "/" . $config->{imgs_dir} . $IMGz[$e * 6 + 5] . "','','width=" . $picz_width . ",height=" . $picz_height . ",scrollbars=0,resizable=0'))\"><img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 5] . "' border='0'></a>\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print(" <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 5] . "'>\n");
|
push(@output, " <img src='" . $config->{url} . "/" . $config->{imgs_dir} . $IMG[$e * 6 + 5] . "'>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($title) {
|
if($title) {
|
||||||
print(" </td>\n");
|
push(@output, " </td>\n");
|
||||||
print(" </tr>\n");
|
push(@output, " </tr>\n");
|
||||||
|
|
||||||
print(" <tr>\n");
|
push(@output, " <tr>\n");
|
||||||
print " <td bgcolor='$colors->{title_bg_color}' colspan='2'>\n";
|
push(@output, " <td bgcolor='$colors->{title_bg_color}' colspan='2'>\n");
|
||||||
print " <font face='Verdana, sans-serif' color='$colors->{title_fg_color}'>\n";
|
push(@output, " <font face='Verdana, sans-serif' color='$colors->{title_fg_color}'>\n");
|
||||||
print " <font size='-1'>\n";
|
push(@output, " <font size='-1'>\n");
|
||||||
print " <b style='{color: " . $colors->{title_fg_color} . "}'> $uri</b>\n";
|
push(@output, " <b style='{color: " . $colors->{title_fg_color} . "}'> $uri</b>\n");
|
||||||
print " </font></font>\n";
|
push(@output, " </font></font>\n");
|
||||||
print " </td>\n";
|
push(@output, " </td>\n");
|
||||||
print(" </tr>\n");
|
push(@output, " </tr>\n");
|
||||||
main::graph_footer();
|
push(@output, main::graph_footer());
|
||||||
}
|
}
|
||||||
$e++;
|
$e++;
|
||||||
}
|
}
|
||||||
print(" <br>\n");
|
push(@output, " <br>\n");
|
||||||
return;
|
return @output;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Reference in New Issue