mirror of https://github.com/mikaku/Monitorix.git
Add show_current_values option to nvme.
This commit is contained in:
parent
03ccbc6a37
commit
45b1d5782c
|
@ -354,6 +354,7 @@ sub nvme_cgi {
|
||||||
logger(@output, "ERROR: Number of smart values (" . $number_of_smart_values_in_use . ") has smaller or equal to number of smart values in rrd (" . $number_of_smart_values_in_rrd . ")!");
|
logger(@output, "ERROR: Number of smart values (" . $number_of_smart_values_in_use . ") has smaller or equal to number of smart values in rrd (" . $number_of_smart_values_in_rrd . ")!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
my $show_current_values = lc($nvme->{show_current_values} || "") eq "y" ? 1 : 0;
|
||||||
|
|
||||||
$version = "old" if $RRDs::VERSION < 1.3;
|
$version = "old" if $RRDs::VERSION < 1.3;
|
||||||
my $rrd = $config->{base_lib} . $package . ".rrd";
|
my $rrd = $config->{base_lib} . $package . ".rrd";
|
||||||
|
@ -551,10 +552,14 @@ sub nvme_cgi {
|
||||||
$str = sprintf("%-57s", $dstr);
|
$str = sprintf("%-57s", $dstr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if($show_current_values) {
|
||||||
$str = sprintf("%-13s", substr($dstr, 0, 13));
|
$str = sprintf("%-13s", substr($dstr, 0, 13));
|
||||||
|
} else {
|
||||||
|
$str = sprintf("%-19s", substr($dstr, 0, 19));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
my $value_name = "hd" . $n . "_smv" . $n_smart;
|
my $value_name = "hd" . $n . "_smv" . $n_smart;
|
||||||
push(@tmp, "LINE2:trans_" . $value_name . $LC[$n] . ":$str" . ($n_plot < $main_smart_plots ? "" :"\\: \\g"));
|
push(@tmp, "LINE2:trans_" . $value_name . $LC[$n] . ":$str" . ($n_plot < $main_smart_plots ? "" : ( $show_current_values ? "\\: \\g" : (($n%2 || !$d[$n+1]) ? "\\n" : ""))));
|
||||||
push(@tmpz, "LINE2:trans_" . $value_name . $LC[$n] . ":$dstr");
|
push(@tmpz, "LINE2:trans_" . $value_name . $LC[$n] . ":$dstr");
|
||||||
if($n_plot < $main_smart_plots) {
|
if($n_plot < $main_smart_plots) {
|
||||||
if($main_plot_with_average[$n_plot]) {
|
if($main_plot_with_average[$n_plot]) {
|
||||||
|
@ -566,10 +571,12 @@ sub nvme_cgi {
|
||||||
push(@tmp, "GPRINT:trans_" . $value_name . ":LAST: Current\\: " . $legend_labels[$n_smart] . "\\n");
|
push(@tmp, "GPRINT:trans_" . $value_name . ":LAST: Current\\: " . $legend_labels[$n_smart] . "\\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if($show_current_values) {
|
||||||
push(@tmp, "GPRINT:trans_" . $value_name . ":LAST:" . $legend_labels[$n_smart] . (($n%2 || !$d[$n+1]) ? "\\n" : ""));
|
push(@tmp, "GPRINT:trans_" . $value_name . ":LAST:" . $legend_labels[$n_smart] . (($n%2 || !$d[$n+1]) ? "\\n" : ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($n_plot < $main_smart_plots) {
|
if($n_plot < $main_smart_plots) {
|
||||||
push(@tmp, "COMMENT: \\n");
|
push(@tmp, "COMMENT: \\n");
|
||||||
|
|
Loading…
Reference in New Issue