Projet

Général

Profil

Révision 64089240

ID6408924066c3a1d6dc85480e414c85ae080d898a
Parent 50234857
Enfant 520c436c

Ajouté par Andreas Perhab il y a environ 4 ans

nvme: enable specifying warnings and criticals for serial numbers

Voir les différences:

plugins/disk/nvme
24 24
    env.nvme_usage_nvme0n1_warning 5:
25 25
    env.nvme_usage_warning 8:
26 26

  
27
If your device names change on reboot you can also use the labels
28
(based on serial numbers) to set the warning and critical labels
29

  
30
    env.nvme_usage_SN_1234567_warning 8:101
31
    env.nvme_usage_SN_1234567_critical 5:101
32

  
27 33
=head1 INTERPRETATION
28 34

  
29 35
This is a multigraph plugin which makes three graphs.
......
191 197
sub my_print_thresholds {
192 198
    my ($label, $graph, $device, $warn_default, $crit_default) = @_;
193 199
    my $dev = basename($device);
194
    my ($warn, $crit) = get_thresholds($graph, "${graph}_${dev}_warning", "${graph}_${dev}_critical",
200
    my ($warn_label, $crit_label) = get_thresholds($graph, "${graph}_${label}_warning", "${graph}_${label}_critical",
195 201
                                       $warn_default, $crit_default);
202
    my ($warn, $crit) = get_thresholds($graph, "${graph}_${dev}_warning", "${graph}_${dev}_critical",
203
                                       $warn_label, $crit_label);
196 204
    print "${label}.warning $warn\n" if defined $warn;
197 205
    print "${label}.critical $crit\n" if defined $crit;
198 206
}

Formats disponibles : Unified diff