Merge pull request #569 from jben94/env_cisco_PhysDesc
To remove the line breaks in the description.
This commit is contained in:
commit
1b129b785f
|
@ -24,6 +24,7 @@ use base qw(centreon::plugins::templates::hardware);
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use centreon::plugins::misc;
|
||||
|
||||
sub set_system {
|
||||
my ($self, %options) = @_;
|
||||
|
@ -123,6 +124,9 @@ sub snmp_execute {
|
|||
|
||||
push @{$self->{request}}, { oid => $oid_entPhysicalDescr }, { oid => $oid_ciscoEnvMonPresent };
|
||||
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
|
||||
while (my ($key, $value) = each %{$self->{results}->{$oid_entPhysicalDescr}}) {
|
||||
$self->{results}->{$oid_entPhysicalDescr}->{$key} = centreon::plugins::misc::trim($value);
|
||||
}
|
||||
$self->{output}->output_add(long_msg => sprintf("Environment type: %s",
|
||||
defined($self->{results}->{$oid_ciscoEnvMonPresent}->{$oid_ciscoEnvMonPresent . '.0'}) && defined($map_type_mon{$self->{results}->{$oid_ciscoEnvMonPresent}->{$oid_ciscoEnvMonPresent . '.0'}} ) ?
|
||||
$map_type_mon{$self->{results}->{$oid_ciscoEnvMonPresent}->{$oid_ciscoEnvMonPresent . '.0'}} : 'unknown'));
|
||||
|
|
|
@ -314,8 +314,8 @@ sub trim {
|
|||
|
||||
# Sometimes there is a null character
|
||||
$value =~ s/\x00$//;
|
||||
$value =~ s/^[ \t]+//;
|
||||
$value =~ s/[ \t]+$//;
|
||||
$value =~ s/^[ \t\n]+//;
|
||||
$value =~ s/[ \t\n]+$//;
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue