1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

nvme: enable specifying warnings and criticals for serial numbers

This commit is contained in:
Andreas Perhab 2021-09-28 10:23:44 +02:00 committed by Lars Kruse
parent 502348577e
commit 6408924066

View file

@ -24,6 +24,12 @@ name, e.g., 'nvme0n1', to make environment variable:
env.nvme_usage_nvme0n1_warning 5:
env.nvme_usage_warning 8:
If your device names change on reboot you can also use the labels
(based on serial numbers) to set the warning and critical labels
env.nvme_usage_SN_1234567_warning 8:101
env.nvme_usage_SN_1234567_critical 5:101
=head1 INTERPRETATION
This is a multigraph plugin which makes three graphs.
@ -191,8 +197,10 @@ sub smart_log {
sub my_print_thresholds {
my ($label, $graph, $device, $warn_default, $crit_default) = @_;
my $dev = basename($device);
my ($warn, $crit) = get_thresholds($graph, "${graph}_${dev}_warning", "${graph}_${dev}_critical",
my ($warn_label, $crit_label) = get_thresholds($graph, "${graph}_${label}_warning", "${graph}_${label}_critical",
$warn_default, $crit_default);
my ($warn, $crit) = get_thresholds($graph, "${graph}_${dev}_warning", "${graph}_${dev}_critical",
$warn_label, $crit_label);
print "${label}.warning $warn\n" if defined $warn;
print "${label}.critical $crit\n" if defined $crit;
}