enhance typo

This commit is contained in:
garnier-quentin 2020-04-03 14:57:02 +02:00
parent 58685519fc
commit e565cb8008
4 changed files with 60 additions and 43 deletions

View File

@ -45,14 +45,23 @@ sub check_psu {
$self->absent_problem(section => 'psu', instance => $options{instance}));
$self->{components}->{psu}->{total}++;
$self->{output}->output_add(long_msg => sprintf("power supply '%s' status is %s.",
$self->{output}->output_add(
long_msg => sprintf(
"power supply '%s' status is %s.",
$options{instance}, $options{state}
));
)
);
my $exit = $self->get_severity(section => 'psu', value => $options{state});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power supply '%s' status is %s",
$options{instance}, $options{state}));
$self->{output}->output_add(
severity => $exit,
short_msg => sprintf(
"Power supply '%s' status is %s",
$options{instance},
$options{state}
)
);
}
}

View File

@ -36,8 +36,8 @@ sub set_system {
psu => [
['statePowerOn', 'OK'],
['statePowerOff', 'CRITICAL'],
['powerNotInstalled', 'OK'],
],
['powerNotInstalled', 'OK']
]
};
$self->{components_path} = 'hardware::kvm::avocent::acs::6000::snmp::mode::components';
@ -56,8 +56,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class;
$options{options}->add_options(arguments =>
{
$options{options}->add_options(arguments => {
});
return $self;

View File

@ -27,7 +27,7 @@ my %map_states = (1 => 'statePowerOn', 2 => 'statePowerOff', 9999 => 'powerNotIn
my $mapping = {
acsPowerSupplyStatePw1 => { oid => '.1.3.6.1.4.1.10418.26.2.1.8.2', map => \%map_states },
acsPowerSupplyStatePw2 => { oid => '.1.3.6.1.4.1.10418.26.2.1.8.3', map => \%map_states },
acsPowerSupplyStatePw2 => { oid => '.1.3.6.1.4.1.10418.26.2.1.8.3', map => \%map_states }
};
my $oid_acsPowerSupply = '.1.3.6.1.4.1.10418.26.2.1.8';
@ -45,14 +45,24 @@ sub check_psu {
$self->absent_problem(section => 'psu', instance => $options{instance}));
$self->{components}->{psu}->{total}++;
$self->{output}->output_add(long_msg => sprintf("power supply '%s' status is %s.",
$options{instance}, $options{state}
));
$self->{output}->output_add(
long_msg => sprintf(
"power supply '%s' status is %s.",
$options{instance},
$options{state}
)
);
my $exit = $self->get_severity(section => 'psu', value => $options{state});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Power supply '%s' status is %s",
$options{instance}, $options{state}));
$self->{output}->output_add(
severity => $exit,
short_msg => sprintf(
"Power supply '%s' status is %s",
$options{instance},
$options{state}
)
);
}
}

View File

@ -36,8 +36,8 @@ sub set_system {
psu => [
['statePowerOn', 'OK'],
['statePowerOff', 'CRITICAL'],
['powerNotInstalled', 'OK'],
],
['powerNotInstalled', 'OK']
]
};
$self->{components_path} = 'hardware::kvm::avocent::acs::8000::snmp::mode::components';
@ -56,8 +56,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_performance => 1);
bless $self, $class;
$options{options}->add_options(arguments =>
{
$options{options}->add_options(arguments => {
});
return $self;