diff --git a/hardware/ups/alpha/snmp/mode/alarms.pm b/hardware/ups/alpha/snmp/mode/alarms.pm index 2ab9142cb..83d3345db 100644 --- a/hardware/ups/alpha/snmp/mode/alarms.pm +++ b/hardware/ups/alpha/snmp/mode/alarms.pm @@ -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; } diff --git a/hardware/ups/alpha/snmp/mode/batterystatus.pm b/hardware/ups/alpha/snmp/mode/batterystatus.pm index 7db604316..a5d1ef679 100644 --- a/hardware/ups/alpha/snmp/mode/batterystatus.pm +++ b/hardware/ups/alpha/snmp/mode/batterystatus.pm @@ -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; diff --git a/hardware/ups/alpha/snmp/plugin.pm b/hardware/ups/alpha/snmp/plugin.pm index e19ef0174..0cc496cee 100644 --- a/hardware/ups/alpha/snmp/plugin.pm +++ b/hardware/ups/alpha/snmp/plugin.pm @@ -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; }