To remove the line breaks in the description.

Example:

          '.1.3.6.1.2.1.47.1.1.1.1.2.4954' => 'FixedModule-1 Port-5',
          '.1.3.6.1.2.1.47.1.1.1.1.2.21598' => 'PowerSupply-1 Sensor-1
',
          '.1.3.6.1.2.1.47.1.1.1.1.2.4953' => 'FixedModule-1 Port-4',
          '.1.3.6.1.2.1.47.1.1.1.1.2.149' => 'Nexus5020 Chassis',
This commit is contained in:
Jean-Baptiste 2016-12-22 12:54:17 +01:00
parent ef2a29eee2
commit 53a16dacd8
1 changed files with 3 additions and 0 deletions

View File

@ -123,6 +123,9 @@ sub snmp_execute {
push @{$self->{request}}, { oid => $oid_entPhysicalDescr }, { oid => $oid_ciscoEnvMonPresent };
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
foreach my $k (keys(%{$self->{results}->{$oid_entPhysicalDescr}})) {
$self->{results}->{$oid_entPhysicalDescr}->{$k} =~ s/^\s+|\s+$|[\n\r]+//g;
}
$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'));