Merge branch 'master' into ipmi_map_whitespace_support

This commit is contained in:
Andreas Bachlechner 2022-02-03 16:42:33 +01:00
commit 6e0bb3a793
10 changed files with 131 additions and 56 deletions

13
Changes
View File

@ -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 3.14.0 - 18-Jan-2022
==================== ====================
- Added a complete graph to support NVMe device statistics ('nvme.pm'). [#215] - Added a complete graph to support NVMe device statistics ('nvme.pm'). [#215]

View File

@ -679,7 +679,7 @@ sub amdgpu_cgi {
$cdef_sensor_allvalues .= ",0,GT,1,UNKN,IF"; $cdef_sensor_allvalues .= ",0,GT,1,UNKN,IF";
} }
my $plot_title = $config->{graphs}->{'_amdgpu' . ($n_plot + 1)}; 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})", "--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc", "--imgformat=$imgfmt_uc",
@ -697,10 +697,10 @@ sub amdgpu_cgi {
@CDEF, @CDEF,
@tmp); @tmp);
$err = RRDs::error; $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") { 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 * 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})", "--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc", "--imgformat=$imgfmt_uc",
@ -719,13 +719,13 @@ sub amdgpu_cgi {
@CDEF, @CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $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; $e2 = $e + $n_plot + 1;
if($title || ($silent =~ /imagetag/ && $graph =~ /amdgpu$e2/)) { if($title || ($silent =~ /imagetag/ && $graph =~ /amdgpu$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") {
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 { } 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};
@ -734,10 +734,10 @@ sub amdgpu_cgi {
$picz_width = $width + 115; $picz_width = $width + 115;
$picz_height = $height + 100; $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 { } 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");
} }
} }
} }

View File

@ -53,6 +53,8 @@ sub du_init {
$heartbeat = 2 * $refresh_interval; $heartbeat = 2 * $refresh_interval;
} }
my @disk_list = split(',', $du->{list});
if(-e $rrd) { if(-e $rrd) {
$info = RRDs::info($rrd); $info = RRDs::info($rrd);
for my $key (keys %$info) { for my $key (keys %$info) {
@ -76,8 +78,8 @@ sub du_init {
} }
} }
} }
if(scalar(@ds) / 9 != scalar(my @fl = split(',', $du->{list}))) { if(scalar(@ds) / 9 != scalar(@disk_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."); 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"); rename($rrd, "$rrd.bak");
} }
if(scalar(@rra) < 12 + (4 * $config->{max_historic_years})) { 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(@max, "RRA:MAX:0.5:1440:" . (365 * $n));
push(@last, "RRA:LAST: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 . "_d1:GAUGE:" . $heartbeat . ":0:U");
push(@tmp, "DS:du" . $n . "_d2:GAUGE:" . $heartbeat . ":0:U"); push(@tmp, "DS:du" . $n . "_d2:GAUGE:" . $heartbeat . ":0:U");
push(@tmp, "DS:du" . $n . "_d3: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)); return if(($min + 60 * $hour) % int($refresh_interval / 60));
} }
my @disk_list = split(',', $du->{list});
my $e = 0; my $e = 0;
while($e < scalar(my @dl = split(',', $du->{list}))) { while($e < scalar(@disk_list)) {
my $type; my $type;
my $e2 = 0; my $e2 = 0;
@ -215,7 +219,7 @@ sub du_update {
} }
$e = 0; $e = 0;
while($e < scalar(my @dl = split(',', $du->{list}))) { while($e < scalar(@disk_list)) {
for($n = 0; $n < 9; $n++) { for($n = 0; $n < 9; $n++) {
$dirs[$e][$n] = 0 unless defined $dirs[$e][$n]; $dirs[$e][$n] = 0 unless defined $dirs[$e][$n];
$rrdata .= ":" . $dirs[$e][$n]; $rrdata .= ":" . $dirs[$e][$n];
@ -291,7 +295,7 @@ sub du_cgi {
} }
$title = !$silent ? $title : ""; $title = !$silent ? $title : "";
my @disk_list = split(',', $du->{list});
# text mode # text mode
# #
@ -312,7 +316,7 @@ sub du_cgi {
my $line3; my $line3;
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n"); push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
push(@output, " "); push(@output, " ");
for($n = 0; $n < scalar(my @dl = split(',', $du->{list})); $n++) { for($n = 0; $n < scalar(@disk_list); $n++) {
$line1 = ""; $line1 = "";
foreach my $i (split(',', $du->{desc}->{$n})) { foreach my $i (split(',', $du->{desc}->{$n})) {
$i = trim($i); $i = trim($i);
@ -324,7 +328,7 @@ sub du_cgi {
} }
if($line1) { if($line1) {
my $i = length($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"); push(@output, "\n");
@ -341,7 +345,7 @@ sub du_cgi {
$line = @$data[$n]; $line = @$data[$n];
$time = $time - (1 / $tf->{ts}); $time = $time - (1 / $tf->{ts});
push(@output, sprintf(" %2d$tf->{tc} ", $time)); 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; $n3 = 0;
foreach my $i (split(',', $du->{desc}->{$n2})) { foreach my $i (split(',', $du->{desc}->{$n2})) {
$from = $n2 * 9 + $n3++; $from = $n2 * 9 + $n3++;
@ -375,7 +379,7 @@ sub du_cgi {
$u = ""; $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"; $str = $u . $package . $n . "." . $tf->{when} . ".$imgfmt_lc";
push(@IMG, $str); push(@IMG, $str);
unlink("$IMG_DIR" . $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])}; @riglim = @{setup_riglim($rigid[0], $limit[0])};
$n = 0; $n = 0;
while($n < scalar(my @dl = split(',', $du->{list}))) { while($n < scalar(@disk_list)) {
if($title) { if($title) {
if($n == 0) { 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"); push(@output, " <tr>\n");
} }
for($n2 = 0; $n2 < $du->{graphs_per_row}; $n2++) { for($n2 = 0; $n2 < $graphs_per_row; $n2++) {
my $type; my $type;
my @DEF0; my @DEF0;
my @CDEF0; my @CDEF0;
last unless $n < scalar(my @dl = split(',', $du->{list})); last unless $n < scalar(@disk_list);
if($title) { if($title) {
push(@output, " <td>\n"); push(@output, " <td>\n");
} }
@ -460,7 +484,7 @@ sub du_cgi {
push(@tmpz, "LINE2:d" . ($e + 1) . $LC[$e] . ":$str"); push(@tmpz, "LINE2:d" . ($e + 1) . $LC[$e] . ":$str");
$e++; $e++;
} }
while($e < 9) { while($e < $linpad[$n]) {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
$e++; $e++;
} }
@ -470,7 +494,7 @@ sub du_cgi {
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF"); push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
} }
($width, $height) = split('x', $config->{graph_size}->{medium}); ($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]", $pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$n]",
"--title=$str ($tf->{nwhen}$tf->{twhen})", "--title=$str ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",

View File

@ -1,7 +1,7 @@
# #
# Monitorix - A lightweight system monitoring tool. # 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 # 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
@ -83,7 +83,7 @@ EOF
<a href='https://www.monitorix.org'><img src='cid:image_logo' border='0'></a> <a href='https://www.monitorix.org'><img src='cid:image_logo' border='0'></a>
<br> <br>
<font face='Verdana, sans-serif' color='000000' size='-2'> <font face='Verdana, sans-serif' color='000000' size='-2'>
Copyright &copy; 2005-2017 Jordi Sanfeliu Copyright &copy; 2005-2022 Jordi Sanfeliu
</font> </font>
</body> </body>
</html> </html>
@ -135,7 +135,7 @@ EOF
foreach (split('\n', $graph)) { foreach (split('\n', $graph)) {
if(/<img src=/) { if(/<img src=/) {
push(@tmp, "<img src='cid:image_$g$e$n.$imgfmt_lc' border='0'>"); 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 $uri = URI->new($url);
my $path = $uri->path || ""; my $path = $uri->path || "";
$response = $ua->request(HTTP::Request->new('GET', "$prefix$path")); $response = $ua->request(HTTP::Request->new('GET', "$prefix$path"));

View File

@ -77,7 +77,7 @@ sub ipmi_init {
push(@max, "RRA:MAX:0.5:1440:" . (365 * $n)); push(@max, "RRA:MAX:0.5:1440:" . (365 * $n));
push(@last, "RRA:LAST: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 . "_s1:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:U:U"); push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:U:U"); push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:U:U");
@ -149,8 +149,10 @@ sub ipmi_update {
my @data = <IN>; my @data = <IN>;
close(IN); close(IN);
my @sensor_list = split(',', $ipmi->{list});
my $e = 0; my $e = 0;
while($e < scalar(my @sl = split(',', $ipmi->{list}))) { while($e < scalar(@sensor_list)) {
my $e2 = 0; my $e2 = 0;
foreach my $i (split(',', $ipmi->{desc}->{$e})) { foreach my $i (split(',', $ipmi->{desc}->{$e})) {
my $unit; my $unit;
@ -195,7 +197,7 @@ sub ipmi_update {
} }
$e = 0; $e = 0;
while($e < scalar(my @sl = split(',', $ipmi->{list}))) { while($e < scalar(@sensor_list)) {
for($n = 0; $n < 9; $n++) { for($n = 0; $n < 9; $n++) {
$sens[$e][$n] = 0 unless defined $sens[$e][$n]; $sens[$e][$n] = 0 unless defined $sens[$e][$n];
$rrdata .= ":" . $sens[$e][$n]; $rrdata .= ":" . $sens[$e][$n];
@ -271,7 +273,7 @@ sub ipmi_cgi {
} }
$title = !$silent ? $title : ""; $title = !$silent ? $title : "";
my @sensor_list = split(',', $ipmi->{list});
# text mode # text mode
# #
@ -292,7 +294,7 @@ sub ipmi_cgi {
my $line3; my $line3;
push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n"); push(@output, " <pre style='font-size: 12px; color: $colors->{fg_color}';>\n");
push(@output, " "); push(@output, " ");
for($n = 0; $n < scalar(my @sl = split(',', $ipmi->{list})); $n++) { for($n = 0; $n < scalar(@sensor_list); $n++) {
$line1 = ""; $line1 = "";
foreach my $i (split(',', $ipmi->{desc}->{$n})) { foreach my $i (split(',', $ipmi->{desc}->{$n})) {
$i = trim($i); $i = trim($i);
@ -304,7 +306,7 @@ sub ipmi_cgi {
} }
if($line1) { if($line1) {
my $i = length($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"); push(@output, "\n");
@ -320,7 +322,7 @@ sub ipmi_cgi {
$line = @$data[$n]; $line = @$data[$n];
$time = $time - (1 / $tf->{ts}); $time = $time - (1 / $tf->{ts});
push(@output, sprintf(" %2d$tf->{tc} ", $time)); 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; $n3 = $n2 * 9;
foreach my $i (split(',', $ipmi->{desc}->{$n2})) { foreach my $i (split(',', $ipmi->{desc}->{$n2})) {
$from = $n3++; $from = $n3++;
@ -353,7 +355,7 @@ sub ipmi_cgi {
$u = ""; $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"; $str = $u . $package . $n . "." . $tf->{when} . ".$imgfmt_lc";
push(@IMG, $str); push(@IMG, $str);
unlink("$IMG_DIR" . $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; my $whitespace_key_support = lc($ipmi->{whitespace_key_support} || "") eq "y" ? 1 : 0;
$n = 0; $n = 0;
while($n < scalar(my @sl = split(',', $ipmi->{list}))) { while($n < scalar(@sensor_list)) {
if($title) { if($title) {
if($n == 0) { 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"); push(@output, " <tr>\n");
} }
for($n2 = 0; $n2 < $ipmi->{graphs_per_row}; $n2++) { for($n2 = 0; $n2 < $graphs_per_row; $n2++) {
last unless $n < scalar(my @sl = split(',', $ipmi->{list})); last unless $n < scalar(@sensor_list);
if($title) { if($title) {
push(@output, " <td>\n"); push(@output, " <td>\n");
} }
@ -396,7 +419,7 @@ sub ipmi_cgi {
push(@tmpz, "LINE2:s" . ($e + 1) . $LC[$e] . ":$str"); push(@tmpz, "LINE2:s" . ($e + 1) . $LC[$e] . ":$str");
$e++; $e++;
} }
while($e < 9) { while($e < $linpad[$n]) {
push(@tmp, "COMMENT: \\n"); push(@tmp, "COMMENT: \\n");
$e++; $e++;
} }
@ -406,7 +429,7 @@ sub ipmi_cgi {
push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF"); push(@CDEF, "CDEF:wrongdata=allvalues,UN,INF,UNKN,IF");
} }
($width, $height) = split('x', $config->{graph_size}->{medium}); ($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,+,+,+,+,+,+,+,+"; 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]", $pic = $rrd{$version}->("$IMG_DIR" . "$IMG[$n]",
"--title=$str ($tf->{nwhen}$tf->{twhen})", "--title=$str ($tf->{nwhen}$tf->{twhen})",

View File

@ -632,7 +632,7 @@ sub nvidiagpu_cgi {
$cdef_sensor_allvalues .= ",0,GT,1,UNKN,IF"; $cdef_sensor_allvalues .= ",0,GT,1,UNKN,IF";
} }
my $plot_title = $config->{graphs}->{'_nvidiagpu' . ($n_plot + 1)}; 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})", "--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc", "--imgformat=$imgfmt_uc",
@ -650,10 +650,10 @@ sub nvidiagpu_cgi {
@CDEF, @CDEF,
@tmp); @tmp);
$err = RRDs::error; $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") { 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 * 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})", "--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc", "--imgformat=$imgfmt_uc",
@ -672,13 +672,13 @@ sub nvidiagpu_cgi {
@CDEF, @CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $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; $e2 = $e + $n_plot + 1;
if($title || ($silent =~ /imagetag/ && $graph =~ /nvidiagpu$e2/)) { if($title || ($silent =~ /imagetag/ && $graph =~ /nvidiagpu$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") {
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 { } 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};
@ -687,10 +687,10 @@ sub nvidiagpu_cgi {
$picz_width = $width + 115; $picz_width = $width + 115;
$picz_height = $height + 100; $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 { } 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");
} }
} }
} }

View File

@ -631,7 +631,7 @@ sub nvme_cgi {
push(@scaling_options, "--alt-y-grid"); push(@scaling_options, "--alt-y-grid");
} }
my $plot_title = $config->{graphs}->{'_nvme' . ($n_smart + 1)}; 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})", "--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc", "--imgformat=$imgfmt_uc",
@ -650,10 +650,10 @@ sub nvme_cgi {
@CDEF, @CDEF,
@tmp); @tmp);
$err = RRDs::error; $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") { 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 * 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})", "--title=$plot_title ($tf->{nwhen}$tf->{twhen})",
"--start=-$tf->{nwhen}$tf->{twhen}", "--start=-$tf->{nwhen}$tf->{twhen}",
"--imgformat=$imgfmt_uc", "--imgformat=$imgfmt_uc",
@ -673,13 +673,13 @@ sub nvme_cgi {
@CDEF, @CDEF,
@tmpz); @tmpz);
$err = RRDs::error; $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; $e2 = $e + $n_smart + 1;
if($title || ($silent =~ /imagetag/ && $graph =~ /nvme$e2/)) { if($title || ($silent =~ /imagetag/ && $graph =~ /nvme$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") {
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 { } 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};
@ -688,10 +688,10 @@ sub nvme_cgi {
$picz_width = $width + 115; $picz_width = $width + 115;
$picz_height = $height + 100; $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 { } 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");
} }
} }
} }

View File

@ -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 Default value: \fI/etc/monitorix/conf.d\fP
.RE .RE
.P .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 .BI ip_default_table
.RS .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. This option will define in which table Monitorix will put all \fIiptables\fP rules for network traffic accounting monitoring. It only works on Linux.

View File

@ -607,7 +607,11 @@ if($config{include_dir} && opendir(DIR, $config{include_dir})) {
# delete $config_inc{$key}; # delete $config_inc{$key};
# next; # next;
#} #}
if($key eq "additional_graph_name") {
$config{graph_name} .= ", $val";
delete $config_inc{$key};
next;
}
# one level options # one level options
$config{$key} = $val; $config{$key} = $val;
delete $config_inc{$key}; delete $config_inc{$key};

View File

@ -295,7 +295,11 @@ if($config{include_dir} && opendir(DIR, $config{include_dir})) {
# delete $config_inc{graph_name}; # delete $config_inc{graph_name};
# next; # next;
#} #}
if($key eq "additional_graph_name") {
$config{graph_name} .= ", $val";
delete $config_inc{$key};
next;
}
# one level options # one level options
$config{$key} = $val; $config{$key} = $val;
delete $config_inc{$key}; delete $config_inc{$key};