mirror of https://github.com/mikaku/Monitorix.git
Merge branch 'master' into ipmi_map_whitespace_support
This commit is contained in:
commit
6e0bb3a793
13
Changes
13
Changes
|
@ -1,3 +1,16 @@
|
|||
N.NN.N - DD-MMM-YYYY
|
||||
====================
|
||||
- Added the 'additional_graph_name' configuration option. [#388]
|
||||
- Fixed an error in 'pgsql.pm' if a non-privileged user is used to read the
|
||||
statistics. [#384]
|
||||
- Fixed the amdgpu section in 'monitorix.conf'. [#385]
|
||||
- Fixed a change in the quotation marks introduced in 3.14 that prevented from
|
||||
sending reports. [#391]
|
||||
(thanks to Michael Bronzini, mb20 AT bronzeware.se for pointing this out)
|
||||
- Fixed wrong index for image directory in 'amdgpu.pm', 'nvidiagpu.pm' and
|
||||
'nvme.pm'. [#387]
|
||||
|
||||
|
||||
3.14.0 - 18-Jan-2022
|
||||
====================
|
||||
- Added a complete graph to support NVMe device statistics ('nvme.pm'). [#215]
|
||||
|
|
|
@ -679,7 +679,7 @@ sub amdgpu_cgi {
|
|||
$cdef_sensor_allvalues .= ",0,GT,1,UNKN,IF";
|
||||
}
|
||||
my $plot_title = $config->{graphs}->{'_amdgpu' . ($n_plot + 1)};
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$e * 3 + $n_plot]",
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . $IMG[$e * $number_of_sensor_values_in_use + $n_plot],
|
||||
"--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
"--imgformat=$imgfmt_uc",
|
||||
|
@ -697,10 +697,10 @@ sub amdgpu_cgi {
|
|||
@CDEF,
|
||||
@tmp);
|
||||
$err = RRDs::error;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 3 + $n_plot]: $err\n") if $err;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . $IMG[$e * $number_of_sensor_values_in_use + $n_plot]. ": $err\n") if $err;
|
||||
if(lc($config->{enable_zoom}) eq "y") {
|
||||
($width, $height) = split('x', $config->{graph_size}->{zoom});
|
||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 3 + $n_plot]",
|
||||
$picz = $rrd{$version}->("$IMG_DIR" . $IMGz[$e * $number_of_sensor_values_in_use + $n_plot],
|
||||
"--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
"--imgformat=$imgfmt_uc",
|
||||
|
@ -719,13 +719,13 @@ sub amdgpu_cgi {
|
|||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 3 + $n_plot]: $err\n") if $err;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . $IMGz[$e * $number_of_sensor_values_in_use + $n_plot]. ": $err\n") if $err;
|
||||
}
|
||||
$e2 = $e + $n_plot + 1;
|
||||
if($title || ($silent =~ /imagetag/ && $graph =~ /amdgpu$e2/)) {
|
||||
if(lc($config->{enable_zoom}) eq "y") {
|
||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 3 + $n_plot], IMG => $IMG[$e * 3 + $n_plot]) . "\n");
|
||||
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * $number_of_sensor_values_in_use + $n_plot], IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
|
||||
} else {
|
||||
if($version eq "new") {
|
||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||
|
@ -734,10 +734,10 @@ sub amdgpu_cgi {
|
|||
$picz_width = $width + 115;
|
||||
$picz_height = $height + 100;
|
||||
}
|
||||
push(@output, " " . picz_js_a_element(width => $picz_width, height => $picz_height, config => $config, IMGz => $IMGz[$e * 3 + $n_plot], IMG => $IMG[$e * 3 + $n_plot]) . "\n");
|
||||
push(@output, " " . picz_js_a_element(width => $picz_width, height => $picz_height, config => $config, IMGz => $IMGz[$e * $number_of_sensor_values_in_use + $n_plot], IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
|
||||
}
|
||||
} else {
|
||||
push(@output, " " . img_element(config => $config, IMG => $IMG[$e * 3 + $n_plot]) . "\n");
|
||||
push(@output, " " . img_element(config => $config, IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
56
lib/du.pm
56
lib/du.pm
|
@ -53,6 +53,8 @@ sub du_init {
|
|||
$heartbeat = 2 * $refresh_interval;
|
||||
}
|
||||
|
||||
my @disk_list = split(',', $du->{list});
|
||||
|
||||
if(-e $rrd) {
|
||||
$info = RRDs::info($rrd);
|
||||
for my $key (keys %$info) {
|
||||
|
@ -76,8 +78,8 @@ sub du_init {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(scalar(@ds) / 9 != scalar(my @fl = split(',', $du->{list}))) {
|
||||
logger("$myself: Detected size mismatch between 'list' (" . scalar(my @fl = split(',', $du->{list})) . ") and $rrd (" . scalar(@ds) / 9 . "). Resizing it accordingly. All historical data will be lost. Backup file created.");
|
||||
if(scalar(@ds) / 9 != scalar(@disk_list)) {
|
||||
logger("$myself: Detected size mismatch between 'list' (" . scalar(@disk_list) . ") and $rrd (" . scalar(@ds) / 9 . "). Resizing it accordingly. All historical data will be lost. Backup file created.");
|
||||
rename($rrd, "$rrd.bak");
|
||||
}
|
||||
if(scalar(@rra) < 12 + (4 * $config->{max_historic_years})) {
|
||||
|
@ -106,7 +108,7 @@ sub du_init {
|
|||
push(@max, "RRA:MAX:0.5:1440:" . (365 * $n));
|
||||
push(@last, "RRA:LAST:0.5:1440:" . (365 * $n));
|
||||
}
|
||||
for($n = 0; $n < scalar(my @fl = split(',', $du->{list})); $n++) {
|
||||
for($n = 0; $n < scalar(@disk_list); $n++) {
|
||||
push(@tmp, "DS:du" . $n . "_d1:GAUGE:" . $heartbeat . ":0:U");
|
||||
push(@tmp, "DS:du" . $n . "_d2:GAUGE:" . $heartbeat . ":0:U");
|
||||
push(@tmp, "DS:du" . $n . "_d3:GAUGE:" . $heartbeat . ":0:U");
|
||||
|
@ -177,8 +179,10 @@ sub du_update {
|
|||
return if(($min + 60 * $hour) % int($refresh_interval / 60));
|
||||
}
|
||||
|
||||
my @disk_list = split(',', $du->{list});
|
||||
|
||||
my $e = 0;
|
||||
while($e < scalar(my @dl = split(',', $du->{list}))) {
|
||||
while($e < scalar(@disk_list)) {
|
||||
my $type;
|
||||
my $e2 = 0;
|
||||
|
||||
|
@ -215,7 +219,7 @@ sub du_update {
|
|||
}
|
||||
|
||||
$e = 0;
|
||||
while($e < scalar(my @dl = split(',', $du->{list}))) {
|
||||
while($e < scalar(@disk_list)) {
|
||||
for($n = 0; $n < 9; $n++) {
|
||||
$dirs[$e][$n] = 0 unless defined $dirs[$e][$n];
|
||||
$rrdata .= ":" . $dirs[$e][$n];
|
||||
|
@ -291,7 +295,7 @@ sub du_cgi {
|
|||
}
|
||||
|
||||
$title = !$silent ? $title : "";
|
||||
|
||||
my @disk_list = split(',', $du->{list});
|
||||
|
||||
# text mode
|
||||
#
|
||||
|
@ -312,7 +316,7 @@ sub du_cgi {
|
|||
my $line3;
|
||||
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
|
||||
push(@output, " ");
|
||||
for($n = 0; $n < scalar(my @dl = split(',', $du->{list})); $n++) {
|
||||
for($n = 0; $n < scalar(@disk_list); $n++) {
|
||||
$line1 = "";
|
||||
foreach my $i (split(',', $du->{desc}->{$n})) {
|
||||
$i = trim($i);
|
||||
|
@ -324,7 +328,7 @@ sub du_cgi {
|
|||
}
|
||||
if($line1) {
|
||||
my $i = length($line1);
|
||||
push(@output, sprintf(sprintf("%${i}s", sprintf("%s", trim($dl[$n])))));
|
||||
push(@output, sprintf(sprintf("%${i}s", sprintf("%s", trim($disk_list[$n])))));
|
||||
}
|
||||
}
|
||||
push(@output, "\n");
|
||||
|
@ -341,7 +345,7 @@ sub du_cgi {
|
|||
$line = @$data[$n];
|
||||
$time = $time - (1 / $tf->{ts});
|
||||
push(@output, sprintf(" %2d$tf->{tc} ", $time));
|
||||
for($n2 = 0; $n2 < scalar(my @dl = split(',', $du->{list})); $n2++) {
|
||||
for($n2 = 0; $n2 < scalar(@disk_list); $n2++) {
|
||||
$n3 = 0;
|
||||
foreach my $i (split(',', $du->{desc}->{$n2})) {
|
||||
$from = $n2 * 9 + $n3++;
|
||||
|
@ -375,7 +379,7 @@ sub du_cgi {
|
|||
$u = "";
|
||||
}
|
||||
|
||||
for($n = 0; $n < scalar(my @dl = split(',', $du->{list})); $n++) {
|
||||
for($n = 0; $n < scalar(@disk_list); $n++) {
|
||||
$str = $u . $package . $n . "." . $tf->{when} . ".$imgfmt_lc";
|
||||
push(@IMG, $str);
|
||||
unlink("$IMG_DIR" . $str);
|
||||
|
@ -386,21 +390,41 @@ sub du_cgi {
|
|||
}
|
||||
}
|
||||
|
||||
my $graphs_per_row = $du->{graphs_per_row};
|
||||
my @linpad =(0) x scalar(@disk_list);
|
||||
if ($graphs_per_row > 1) {
|
||||
for(my $n = 0; $n < scalar(@disk_list); $n++) {
|
||||
my @ls = split(',', $du->{desc}->{$n});
|
||||
$linpad[$n] = scalar(@ls);
|
||||
}
|
||||
for(my $n = 0; $n < scalar(@linpad); $n++) {
|
||||
if ($n % $graphs_per_row == 0) {
|
||||
my $max_number_of_lines = 0;
|
||||
for (my $sub_n = $n; $sub_n < min($n + $graphs_per_row, scalar(@linpad)); $sub_n++) {
|
||||
$max_number_of_lines = max($max_number_of_lines, $linpad[$sub_n]);
|
||||
}
|
||||
for (my $sub_n = $n; $sub_n < min($n + $graphs_per_row, scalar(@linpad)); $sub_n++) {
|
||||
$linpad[$sub_n] = $max_number_of_lines;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@riglim = @{setup_riglim($rigid[0], $limit[0])};
|
||||
$n = 0;
|
||||
while($n < scalar(my @dl = split(',', $du->{list}))) {
|
||||
while($n < scalar(@disk_list)) {
|
||||
if($title) {
|
||||
if($n == 0) {
|
||||
push(@output, main::graph_header($title, $du->{graphs_per_row}));
|
||||
push(@output, main::graph_header($title, $graphs_per_row));
|
||||
}
|
||||
push(@output, " <tr>\n");
|
||||
}
|
||||
for($n2 = 0; $n2 < $du->{graphs_per_row}; $n2++) {
|
||||
for($n2 = 0; $n2 < $graphs_per_row; $n2++) {
|
||||
my $type;
|
||||
my @DEF0;
|
||||
my @CDEF0;
|
||||
|
||||
last unless $n < scalar(my @dl = split(',', $du->{list}));
|
||||
last unless $n < scalar(@disk_list);
|
||||
if($title) {
|
||||
push(@output, " <td>\n");
|
||||
}
|
||||
|
@ -460,7 +484,7 @@ sub du_cgi {
|
|||
push(@tmpz, "LINE2:d" . ($e + 1) . $LC[$e] . ":$str");
|
||||
$e++;
|
||||
}
|
||||
while($e < 9) {
|
||||
while($e < $linpad[$n]) {
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
$e++;
|
||||
}
|
||||
|
@ -470,7 +494,7 @@ sub du_cgi {
|
|||
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
|
||||
}
|
||||
($width, $height) = split('x', $config->{graph_size}->{medium});
|
||||
$str = substr(trim($dl[$n]), 0, 25);
|
||||
$str = substr(trim($disk_list[$n]), 0, 25);
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$n]",
|
||||
"--title=$str ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# Monitorix - A lightweight system monitoring tool.
|
||||
#
|
||||
# Copyright (C) 2005-2017 by Jordi Sanfeliu <jordi@fibranet.cat>
|
||||
# Copyright (C) 2005-2022 by Jordi Sanfeliu <jordi@fibranet.cat>
|
||||
#
|
||||
# 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
|
||||
|
@ -83,7 +83,7 @@ EOF
|
|||
<a href='https://www.monitorix.org'><img src='cid:image_logo' border='0'></a>
|
||||
<br>
|
||||
<font face='Verdana, sans-serif' color='000000' size='-2'>
|
||||
Copyright © 2005-2017 Jordi Sanfeliu
|
||||
Copyright © 2005-2022 Jordi Sanfeliu
|
||||
</font>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -135,7 +135,7 @@ EOF
|
|||
foreach (split('\n', $graph)) {
|
||||
if(/<img src=/) {
|
||||
push(@tmp, "<img src='cid:image_$g$e$n.$imgfmt_lc' border='0'>");
|
||||
($url) = $_ =~ m/<img src='(.*?)' /;
|
||||
($url) = $_ =~ m/<img src=['"](.*?)['"] /;
|
||||
my $uri = URI->new($url);
|
||||
my $path = $uri->path || "";
|
||||
$response = $ua->request(HTTP::Request->new('GET', "$prefix$path"));
|
||||
|
|
51
lib/ipmi.pm
51
lib/ipmi.pm
|
@ -77,7 +77,7 @@ sub ipmi_init {
|
|||
push(@max, "RRA:MAX:0.5:1440:" . (365 * $n));
|
||||
push(@last, "RRA:LAST:0.5:1440:" . (365 * $n));
|
||||
}
|
||||
for($n = 0; $n < scalar(my @sl = split(',', $ipmi->{list})); $n++) {
|
||||
for($n = 0; $n < scalar(my @sensor_list = split(',', $ipmi->{list})); $n++) {
|
||||
push(@tmp, "DS:ipmi" . $n . "_s1:GAUGE:120:U:U");
|
||||
push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:U:U");
|
||||
push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:U:U");
|
||||
|
@ -149,8 +149,10 @@ sub ipmi_update {
|
|||
my @data = <IN>;
|
||||
close(IN);
|
||||
|
||||
my @sensor_list = split(',', $ipmi->{list});
|
||||
|
||||
my $e = 0;
|
||||
while($e < scalar(my @sl = split(',', $ipmi->{list}))) {
|
||||
while($e < scalar(@sensor_list)) {
|
||||
my $e2 = 0;
|
||||
foreach my $i (split(',', $ipmi->{desc}->{$e})) {
|
||||
my $unit;
|
||||
|
@ -195,7 +197,7 @@ sub ipmi_update {
|
|||
}
|
||||
|
||||
$e = 0;
|
||||
while($e < scalar(my @sl = split(',', $ipmi->{list}))) {
|
||||
while($e < scalar(@sensor_list)) {
|
||||
for($n = 0; $n < 9; $n++) {
|
||||
$sens[$e][$n] = 0 unless defined $sens[$e][$n];
|
||||
$rrdata .= ":" . $sens[$e][$n];
|
||||
|
@ -271,7 +273,7 @@ sub ipmi_cgi {
|
|||
}
|
||||
|
||||
$title = !$silent ? $title : "";
|
||||
|
||||
my @sensor_list = split(',', $ipmi->{list});
|
||||
|
||||
# text mode
|
||||
#
|
||||
|
@ -292,7 +294,7 @@ sub ipmi_cgi {
|
|||
my $line3;
|
||||
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
|
||||
push(@output, " ");
|
||||
for($n = 0; $n < scalar(my @sl = split(',', $ipmi->{list})); $n++) {
|
||||
for($n = 0; $n < scalar(@sensor_list); $n++) {
|
||||
$line1 = "";
|
||||
foreach my $i (split(',', $ipmi->{desc}->{$n})) {
|
||||
$i = trim($i);
|
||||
|
@ -304,7 +306,7 @@ sub ipmi_cgi {
|
|||
}
|
||||
if($line1) {
|
||||
my $i = length($line1);
|
||||
push(@output, sprintf(sprintf("%${i}s", sprintf("%s", trim($sl[$n])))));
|
||||
push(@output, sprintf(sprintf("%${i}s", sprintf("%s", trim($sensor_list[$n])))));
|
||||
}
|
||||
}
|
||||
push(@output, "\n");
|
||||
|
@ -320,7 +322,7 @@ sub ipmi_cgi {
|
|||
$line = @$data[$n];
|
||||
$time = $time - (1 / $tf->{ts});
|
||||
push(@output, sprintf(" %2d$tf->{tc} ", $time));
|
||||
for($n2 = 0; $n2 < scalar(my @sl = split(',', $ipmi->{list})); $n2++) {
|
||||
for($n2 = 0; $n2 < scalar(@sensor_list); $n2++) {
|
||||
$n3 = $n2 * 9;
|
||||
foreach my $i (split(',', $ipmi->{desc}->{$n2})) {
|
||||
$from = $n3++;
|
||||
|
@ -353,7 +355,7 @@ sub ipmi_cgi {
|
|||
$u = "";
|
||||
}
|
||||
|
||||
for($n = 0; $n < scalar(my @sl = split(',', $ipmi->{list})); $n++) {
|
||||
for($n = 0; $n < scalar(@sensor_list); $n++) {
|
||||
$str = $u . $package . $n . "." . $tf->{when} . ".$imgfmt_lc";
|
||||
push(@IMG, $str);
|
||||
unlink("$IMG_DIR" . $str);
|
||||
|
@ -364,17 +366,38 @@ sub ipmi_cgi {
|
|||
}
|
||||
}
|
||||
|
||||
my $graphs_per_row = $ipmi->{graphs_per_row};
|
||||
my @linpad =(0) x scalar(@sensor_list);
|
||||
if ($graphs_per_row > 1) {
|
||||
for(my $n = 0; $n < scalar(@sensor_list); $n++) {
|
||||
my @ls = split(',', $ipmi->{desc}->{$n});
|
||||
$linpad[$n] = scalar(@ls);
|
||||
}
|
||||
for(my $n = 0; $n < scalar(@linpad); $n++) {
|
||||
if ($n % $graphs_per_row == 0) {
|
||||
my $max_number_of_lines = 0;
|
||||
for (my $sub_n = $n; $sub_n < min($n + $graphs_per_row, scalar(@linpad)); $sub_n++) {
|
||||
$max_number_of_lines = max($max_number_of_lines, $linpad[$sub_n]);
|
||||
}
|
||||
for (my $sub_n = $n; $sub_n < min($n + $graphs_per_row, scalar(@linpad)); $sub_n++) {
|
||||
$linpad[$sub_n] = $max_number_of_lines;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $whitespace_key_support = lc($ipmi->{whitespace_key_support} || "") eq "y" ? 1 : 0;
|
||||
|
||||
$n = 0;
|
||||
while($n < scalar(my @sl = split(',', $ipmi->{list}))) {
|
||||
while($n < scalar(@sensor_list)) {
|
||||
if($title) {
|
||||
if($n == 0) {
|
||||
push(@output, main::graph_header($title, $ipmi->{graphs_per_row}));
|
||||
push(@output, main::graph_header($title, $graphs_per_row));
|
||||
}
|
||||
push(@output, " <tr>\n");
|
||||
}
|
||||
for($n2 = 0; $n2 < $ipmi->{graphs_per_row}; $n2++) {
|
||||
last unless $n < scalar(my @sl = split(',', $ipmi->{list}));
|
||||
for($n2 = 0; $n2 < $graphs_per_row; $n2++) {
|
||||
last unless $n < scalar(@sensor_list);
|
||||
if($title) {
|
||||
push(@output, " <td>\n");
|
||||
}
|
||||
|
@ -396,7 +419,7 @@ sub ipmi_cgi {
|
|||
push(@tmpz, "LINE2:s" . ($e + 1) . $LC[$e] . ":$str");
|
||||
$e++;
|
||||
}
|
||||
while($e < 9) {
|
||||
while($e < $linpad[$n]) {
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
$e++;
|
||||
}
|
||||
|
@ -406,7 +429,7 @@ sub ipmi_cgi {
|
|||
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
|
||||
}
|
||||
($width, $height) = split('x', $config->{graph_size}->{medium});
|
||||
$str = substr(trim($sl[$n]), 0, 25);
|
||||
$str = substr(trim($sensor_list[$n]), 0, 25);
|
||||
my $cdef_allvalues = $gap_on_all_nan ? "CDEF:allvalues=s1,UN,0,1,IF,s2,UN,0,1,IF,s3,UN,0,1,IF,s4,UN,0,1,IF,s5,UN,0,1,IF,s6,UN,0,1,IF,s7,UN,0,1,IF,s8,UN,0,1,IF,s9,UN,0,1,IF,+,+,+,+,+,+,+,+,0,GT,1,UNKN,IF" : "CDEF:allvalues=s1,s2,s3,s4,s5,s6,s7,s8,s9,+,+,+,+,+,+,+,+";
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$n]",
|
||||
"--title=$str ($tf->{nwhen}$tf->{twhen})",
|
||||
|
|
|
@ -632,7 +632,7 @@ sub nvidiagpu_cgi {
|
|||
$cdef_sensor_allvalues .= ",0,GT,1,UNKN,IF";
|
||||
}
|
||||
my $plot_title = $config->{graphs}->{'_nvidiagpu' . ($n_plot + 1)};
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$e * 3 + $n_plot]",
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . $IMG[$e * $number_of_sensor_values_in_use + $n_plot],
|
||||
"--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
"--imgformat=$imgfmt_uc",
|
||||
|
@ -650,10 +650,10 @@ sub nvidiagpu_cgi {
|
|||
@CDEF,
|
||||
@tmp);
|
||||
$err = RRDs::error;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 3 + $n_plot]: $err\n") if $err;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . $IMG[$e * $number_of_sensor_values_in_use + $n_plot] . ": $err\n") if $err;
|
||||
if(lc($config->{enable_zoom}) eq "y") {
|
||||
($width, $height) = split('x', $config->{graph_size}->{zoom});
|
||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 3 + $n_plot]",
|
||||
$picz = $rrd{$version}->("$IMG_DIR" . $IMGz[$e * $number_of_sensor_values_in_use + $n_plot],
|
||||
"--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
"--imgformat=$imgfmt_uc",
|
||||
|
@ -672,13 +672,13 @@ sub nvidiagpu_cgi {
|
|||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 3 + $n_plot]: $err\n") if $err;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . $IMGz[$e * $number_of_sensor_values_in_use + $n_plot]. ": $err\n") if $err;
|
||||
}
|
||||
$e2 = $e + $n_plot + 1;
|
||||
if($title || ($silent =~ /imagetag/ && $graph =~ /nvidiagpu$e2/)) {
|
||||
if(lc($config->{enable_zoom}) eq "y") {
|
||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 3 + $n_plot], IMG => $IMG[$e * 3 + $n_plot]) . "\n");
|
||||
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * $number_of_sensor_values_in_use + $n_plot], IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
|
||||
} else {
|
||||
if($version eq "new") {
|
||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||
|
@ -687,10 +687,10 @@ sub nvidiagpu_cgi {
|
|||
$picz_width = $width + 115;
|
||||
$picz_height = $height + 100;
|
||||
}
|
||||
push(@output, " " . picz_js_a_element(width => $picz_width, height => $picz_height, config => $config, IMGz => $IMGz[$e * 3 + $n_plot], IMG => $IMG[$e * 3 + $n_plot]) . "\n");
|
||||
push(@output, " " . picz_js_a_element(width => $picz_width, height => $picz_height, config => $config, IMGz => $IMGz[$e * $number_of_sensor_values_in_use + $n_plot], IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
|
||||
}
|
||||
} else {
|
||||
push(@output, " " . img_element(config => $config, IMG => $IMG[$e * 3 + $n_plot]) . "\n");
|
||||
push(@output, " " . img_element(config => $config, IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
lib/nvme.pm
14
lib/nvme.pm
|
@ -631,7 +631,7 @@ sub nvme_cgi {
|
|||
push(@scaling_options, "--alt-y-grid");
|
||||
}
|
||||
my $plot_title = $config->{graphs}->{'_nvme' . ($n_smart + 1)};
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$e * 3 + $n_smart]",
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . $IMG[$e * $number_of_smart_values_in_use + $n_smart],
|
||||
"--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
"--imgformat=$imgfmt_uc",
|
||||
|
@ -650,10 +650,10 @@ sub nvme_cgi {
|
|||
@CDEF,
|
||||
@tmp);
|
||||
$err = RRDs::error;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMG[$e * 3 + $n_smart]: $err\n") if $err;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . $IMG[$e * $number_of_smart_values_in_use + $n_smart]. ": $err\n") if $err;
|
||||
if(lc($config->{enable_zoom}) eq "y") {
|
||||
($width, $height) = split('x', $config->{graph_size}->{zoom});
|
||||
$picz = $rrd{$version}->("$IMG_DIR" . "$IMGz[$e * 3 + $n_smart]",
|
||||
$picz = $rrd{$version}->("$IMG_DIR" . $IMGz[$e * $number_of_smart_values_in_use + $n_smart],
|
||||
"--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
"--imgformat=$imgfmt_uc",
|
||||
|
@ -673,13 +673,13 @@ sub nvme_cgi {
|
|||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . "$IMGz[$e * 3 + $n_smart]: $err\n") if $err;
|
||||
push(@output, "ERROR: while graphing $IMG_DIR" . $IMGz[$e * $number_of_smart_values_in_use + $n_smart]. ": $err\n") if $err;
|
||||
}
|
||||
$e2 = $e + $n_smart + 1;
|
||||
if($title || ($silent =~ /imagetag/ && $graph =~ /nvme$e2/)) {
|
||||
if(lc($config->{enable_zoom}) eq "y") {
|
||||
if(lc($config->{disable_javascript_void}) eq "y") {
|
||||
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 3 + $n_smart], IMG => $IMG[$e * 3 + $n_smart]) . "\n");
|
||||
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * $number_of_smart_values_in_use + $n_smart], IMG => $IMG[$e * $number_of_smart_values_in_use + $n_smart]) . "\n");
|
||||
} else {
|
||||
if($version eq "new") {
|
||||
$picz_width = $picz->{image_width} * $config->{global_zoom};
|
||||
|
@ -688,10 +688,10 @@ sub nvme_cgi {
|
|||
$picz_width = $width + 115;
|
||||
$picz_height = $height + 100;
|
||||
}
|
||||
push(@output, " " . picz_js_a_element(width => $picz_width, height => $picz_height, config => $config, IMGz => $IMGz[$e * 3 + $n_smart], IMG => $IMG[$e * 3 + $n_smart]) . "\n");
|
||||
push(@output, " " . picz_js_a_element(width => $picz_width, height => $picz_height, config => $config, IMGz => $IMGz[$e * $number_of_smart_values_in_use + $n_smart], IMG => $IMG[$e * $number_of_smart_values_in_use + $n_smart]) . "\n");
|
||||
}
|
||||
} else {
|
||||
push(@output, " " . img_element(config => $config, IMG => $IMG[$e * 3 + $n_smart]) . "\n");
|
||||
push(@output, " " . img_element(config => $config, IMG => $IMG[$e * $number_of_smart_values_in_use + $n_smart]) . "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,6 +180,13 @@ All the configuration files in there will be loaded in alphabetic order, so the
|
|||
Default value: \fI/etc/monitorix/conf.d\fP
|
||||
.RE
|
||||
.P
|
||||
.BI additional_graph_name
|
||||
.RS
|
||||
This is an optional configuration option for configuration files in \fIinclude_dir\fP. It takes a comma separated list of additional modules that is appended to the \fIgraph_name\fP option. This enables you to add custom modules without changing the \fImonitorix.conf\fP or copy all names from \fIgraph_name\fP to your config file.
|
||||
.P
|
||||
Default value: \fINone\fP
|
||||
.RE
|
||||
.P
|
||||
.BI ip_default_table
|
||||
.RS
|
||||
This option will define in which table Monitorix will put all \fIiptables\fP rules for network traffic accounting monitoring. It only works on Linux.
|
||||
|
|
|
@ -607,7 +607,11 @@ if($config{include_dir} && opendir(DIR, $config{include_dir})) {
|
|||
# delete $config_inc{$key};
|
||||
# next;
|
||||
#}
|
||||
|
||||
if($key eq "additional_graph_name") {
|
||||
$config{graph_name} .= ", $val";
|
||||
delete $config_inc{$key};
|
||||
next;
|
||||
}
|
||||
# one level options
|
||||
$config{$key} = $val;
|
||||
delete $config_inc{$key};
|
||||
|
|
|
@ -295,7 +295,11 @@ if($config{include_dir} && opendir(DIR, $config{include_dir})) {
|
|||
# delete $config_inc{graph_name};
|
||||
# next;
|
||||
#}
|
||||
|
||||
if($key eq "additional_graph_name") {
|
||||
$config{graph_name} .= ", $val";
|
||||
delete $config_inc{$key};
|
||||
next;
|
||||
}
|
||||
# one level options
|
||||
$config{$key} = $val;
|
||||
delete $config_inc{$key};
|
||||
|
|
Loading…
Reference in New Issue