enh(synology/snmp): temperature metric (#2915)
This commit is contained in:
parent
6eddcb74a8
commit
6916eaf507
|
@ -25,6 +25,19 @@ use base qw(centreon::plugins::templates::counter);
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
sub custom_temp_perfdata {
|
||||||
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{output}->perfdata_add(
|
||||||
|
nlabel => $self->{nlabel},
|
||||||
|
unit => 'C',
|
||||||
|
instances => 'system',
|
||||||
|
value => $self->{result_values}->{temperature},
|
||||||
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||||
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
sub set_counters {
|
sub set_counters {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
@ -33,12 +46,10 @@ sub set_counters {
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{maps_counters}->{global} = [
|
$self->{maps_counters}->{global} = [
|
||||||
{ label => 'temperature', nlabel => 'system.temperature.celsius', set => {
|
{ label => 'temperature', nlabel => 'hardware.temperature.celsius', set => {
|
||||||
key_values => [ { name => 'temperature' } ],
|
key_values => [ { name => 'temperature' } ],
|
||||||
output_template => 'system temperature: %s C',
|
output_template => 'system temperature: %s C',
|
||||||
perfdatas => [
|
closure_custom_perfdata => $self->can('custom_temp_perfdata')
|
||||||
{ template => '%s', unit => 'C' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue