+ Enhance cisco standard hardware mode (some cases)

This commit is contained in:
garnier-quentin 2015-11-24 11:51:27 +01:00
parent eecc69a63f
commit 514d2a0d66
2 changed files with 8 additions and 1 deletions

View File

@ -56,6 +56,11 @@ sub check {
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_cefcPhysicalStatus}, instance => $instance);
my $physical_descr = $self->{results}->{$oid_entPhysicalDescr}->{$oid_entPhysicalDescr . '.' . $instance};
if (!defined($physical_descr)) {
$self->{output}->output_add(long_msg => sprintf("skipped instance '%s': no description", $instance));
next;
}
next if ($self->check_exclude(section => 'physical', instance => $instance));
$self->{components}->{physical}->{total}++;

View File

@ -64,7 +64,7 @@ sub check {
$self->{output}->output_add(long_msg => sprintf("Temperature '%s' status is %s [instance: %s] [value: %s C]",
$result->{ciscoEnvMonTemperatureStatusDescr}, $result->{ciscoEnvMonTemperatureState},
$instance, $result->{ciscoEnvMonTemperatureStatusValue}));
$instance, defined($result->{ciscoEnvMonTemperatureStatusValue}) ? $result->{ciscoEnvMonTemperatureStatusValue} : '-'));
my $exit = $self->get_severity(section => 'temperature', value => $result->{ciscoEnvMonTemperatureState});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
@ -72,6 +72,8 @@ sub check {
$result->{ciscoEnvMonTemperatureStatusDescr}, $result->{ciscoEnvMonTemperatureState}));
}
next if (!defined($result->{ciscoEnvMonTemperatureStatusValue}));
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{ciscoEnvMonTemperatureStatusValue});
if ($checked == 0) {
my $warn_th = undef;