mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-09-26 11:18:39 +02:00
fix indentation
This commit is contained in:
parent
d0e61caec3
commit
d09ad2a993
@ -34,7 +34,7 @@ sub set_system {
|
|||||||
$self->{cb_hook2} = 'snmp_execute';
|
$self->{cb_hook2} = 'snmp_execute';
|
||||||
|
|
||||||
$self->{thresholds} = {
|
$self->{thresholds} = {
|
||||||
sensor => [
|
sensor => [
|
||||||
['unknown', 'UNKNOWN'],
|
['unknown', 'UNKNOWN'],
|
||||||
['faulty', 'CRITICAL'],
|
['faulty', 'CRITICAL'],
|
||||||
['below-min', 'WARNING'],
|
['below-min', 'WARNING'],
|
||||||
@ -134,9 +134,9 @@ my %map_type = (1 => 'temperature', 2 => 'fan', 3 => 'power-supply');
|
|||||||
my %map_unit = (temperature => 'C', fan => 'rpm'); # No voltage value available
|
my %map_unit = (temperature => 'C', fan => 'rpm'); # No voltage value available
|
||||||
|
|
||||||
my $mapping = {
|
my $mapping = {
|
||||||
swSensorType => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2', map => \%map_type },
|
swSensorType => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2', map => \%map_type },
|
||||||
swSensorStatus => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3', map => \%map_status },
|
swSensorStatus => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.3', map => \%map_status },
|
||||||
swSensorValue => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4' },
|
swSensorValue => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4' },
|
||||||
swSensorInfo => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.5' },
|
swSensorInfo => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.5' },
|
||||||
};
|
};
|
||||||
my $oid_swSensorEntry = '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1';
|
my $oid_swSensorEntry = '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1';
|
||||||
@ -163,7 +163,7 @@ sub check {
|
|||||||
next if ($result->{swSensorStatus} =~ /absent/i &&
|
next if ($result->{swSensorStatus} =~ /absent/i &&
|
||||||
$self->absent_problem(section => 'sensor', instance => $instance));
|
$self->absent_problem(section => 'sensor', instance => $instance));
|
||||||
|
|
||||||
$result->{swSensorInfo} = centreon::plugins::misc::trim($result->{swSensorInfo});
|
$result->{swSensorInfo} = centreon::plugins::misc::trim($result->{swSensorInfo});
|
||||||
$self->{components}->{sensor}->{total}++;
|
$self->{components}->{sensor}->{total}++;
|
||||||
$self->{output}->output_add(long_msg => sprintf("%s sensor '%s' status is '%s' [instance = %s]",
|
$self->{output}->output_add(long_msg => sprintf("%s sensor '%s' status is '%s' [instance = %s]",
|
||||||
$result->{swSensorType}, $result->{swSensorInfo}, $result->{swSensorStatus}, $instance));
|
$result->{swSensorType}, $result->{swSensorInfo}, $result->{swSensorStatus}, $instance));
|
||||||
@ -178,7 +178,7 @@ sub check {
|
|||||||
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(severity => $exit2,
|
$self->{output}->output_add(severity => $exit2,
|
||||||
short_msg => sprintf("%s sensor '%s' is %s %s", $result->{swSensorType}, $result->{swSensorInfo}, $result->{swSensorValue},
|
short_msg => sprintf("%s sensor '%s' is %s %s", $result->{swSensorType}, $result->{swSensorInfo}, $result->{swSensorValue},
|
||||||
$map_unit{$result->{swSensorType}}));
|
$map_unit{$result->{swSensorType}}));
|
||||||
}
|
}
|
||||||
$self->{output}->perfdata_add(label => $result->{swSensorInfo}, unit => $map_unit{$result->{swSensorType}},
|
$self->{output}->perfdata_add(label => $result->{swSensorInfo}, unit => $map_unit{$result->{swSensorType}},
|
||||||
value => $result->{swSensorValue},
|
value => $result->{swSensorValue},
|
||||||
@ -199,8 +199,8 @@ use warnings;
|
|||||||
my %map_oper_status = (1 => 'online', 2 => 'offline', 3 => 'testing', 4 => 'faulty');
|
my %map_oper_status = (1 => 'online', 2 => 'offline', 3 => 'testing', 4 => 'faulty');
|
||||||
|
|
||||||
my $mapping_global = {
|
my $mapping_global = {
|
||||||
swFirmwareVersion => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.6' },
|
swFirmwareVersion => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.6' },
|
||||||
swOperStatus => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.7', map => \%map_oper_status },
|
swOperStatus => { oid => '.1.3.6.1.4.1.1588.2.1.1.1.1.7', map => \%map_oper_status },
|
||||||
};
|
};
|
||||||
my $oid_swSystem = '.1.3.6.1.4.1.1588.2.1.1.1.1';
|
my $oid_swSystem = '.1.3.6.1.4.1.1588.2.1.1.1.1';
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ sub check {
|
|||||||
return if ($self->check_filter(section => 'global'));
|
return if ($self->check_filter(section => 'global'));
|
||||||
|
|
||||||
my $result = $self->{snmp}->map_instance(mapping => $mapping_global, results => $self->{results}->{$oid_swSystem}, instance => '0');
|
my $result = $self->{snmp}->map_instance(mapping => $mapping_global, results => $self->{results}->{$oid_swSystem}, instance => '0');
|
||||||
return if (!defined($result->{swOperStatus}));
|
return if (!defined($result->{swOperStatus}));
|
||||||
|
|
||||||
$self->{components}->{global}->{total}++;
|
$self->{components}->{global}->{total}++;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user