enh indentation

This commit is contained in:
garnier-quentin 2019-10-04 08:21:11 +02:00
parent f5149b5f52
commit 7306eacc61
3 changed files with 14 additions and 15 deletions

View File

@ -48,9 +48,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
bless $self, $class;
$options{options}->add_options(arguments =>
{
});
$options{options}->add_options(arguments => {});
return $self;
}

View File

@ -100,12 +100,11 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments =>
{
"unknown-status:s" => { name => 'unknown_status', default => '%{status} =~ /unknown/i' },
"warning-status:s" => { name => 'warning_status', default => '%{status} =~ /batteryLow/i' },
"critical-status:s" => { name => 'critical_status', default => '%{status} =~ /batteryDepleted/i' },
});
$options{options}->add_options(arguments => {
'unknown-status:s' => { name => 'unknown_status', default => '%{status} =~ /unknown/i' },
'warning-status:s' => { name => 'warning_status', default => '%{status} =~ /batteryLow/i' },
'critical-status:s' => { name => 'critical_status', default => '%{status} =~ /batteryDepleted/i' },
});
return $self;
}
@ -133,9 +132,11 @@ my $oid_upsBattery = '.1.3.6.1.4.1.7309.6.1.2';
sub manage_selection {
my ($self, %options) = @_;
my $snmp_result = $options{snmp}->get_table(oid => $oid_upsBattery,
nothing_quit => 1);
my $snmp_result = $options{snmp}->get_table(
oid => $oid_upsBattery,
nothing_quit => 1
);
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => '0');
$result->{upsBatteryVoltage} *= 0.1;
$result->{upsBatteryChargingCurrent} *= 0.1;

View File

@ -29,9 +29,9 @@ sub new {
$self->{version} = '0.1';
%{$self->{modes}} = (
'battery-status' => 'hardware::ups::alpha::snmp::mode::batterystatus',
'alarms' => 'hardware::ups::alpha::snmp::mode::alarms',
);
'alarms' => 'hardware::ups::alpha::snmp::mode::alarms',
'battery-status' => 'hardware::ups::alpha::snmp::mode::batterystatus',
);
return $self;
}