enh indentation
This commit is contained in:
parent
f5149b5f52
commit
7306eacc61
|
@ -48,9 +48,7 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1, no_performance => 1, no_load_components => 1);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {});
|
||||||
{
|
|
||||||
});
|
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,11 +100,10 @@ sub new {
|
||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments => {
|
||||||
{
|
'unknown-status:s' => { name => 'unknown_status', default => '%{status} =~ /unknown/i' },
|
||||||
"unknown-status:s" => { name => 'unknown_status', default => '%{status} =~ /unknown/i' },
|
'warning-status:s' => { name => 'warning_status', default => '%{status} =~ /batteryLow/i' },
|
||||||
"warning-status:s" => { name => 'warning_status', default => '%{status} =~ /batteryLow/i' },
|
'critical-status:s' => { name => 'critical_status', default => '%{status} =~ /batteryDepleted/i' },
|
||||||
"critical-status:s" => { name => 'critical_status', default => '%{status} =~ /batteryDepleted/i' },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -133,8 +132,10 @@ my $oid_upsBattery = '.1.3.6.1.4.1.7309.6.1.2';
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
my $snmp_result = $options{snmp}->get_table(oid => $oid_upsBattery,
|
my $snmp_result = $options{snmp}->get_table(
|
||||||
nothing_quit => 1);
|
oid => $oid_upsBattery,
|
||||||
|
nothing_quit => 1
|
||||||
|
);
|
||||||
|
|
||||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => '0');
|
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => '0');
|
||||||
$result->{upsBatteryVoltage} *= 0.1;
|
$result->{upsBatteryVoltage} *= 0.1;
|
||||||
|
|
|
@ -29,8 +29,8 @@ sub new {
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
%{$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;
|
return $self;
|
||||||
|
|
Loading…
Reference in New Issue