2013-01-09 Dario Rodriguez <dario.rodriguez@artica.es>
* lib/PandoraFMS/NetworkServer.pm: Controlled an error if output of SNMP command is empty and fixed several error comparing port of SNMP as numbers instead as strings. MERGED FROM 4.0.3 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7402 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b23c5ea50a
commit
328c3167ef
|
@ -1,3 +1,11 @@
|
|||
2013-01-09 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* lib/PandoraFMS/NetworkServer.pm: Controlled an error if output of
|
||||
SNMP command is empty and fixed several error comparing port of SNMP
|
||||
as numbers instead as strings.
|
||||
|
||||
MERGED FROM 4.0.3
|
||||
|
||||
2013-01-09 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* lib/PandoraFMS/NetworkServer.pm: Fixed on port 0 (Snmp polling).
|
||||
|
|
|
@ -281,7 +281,7 @@ sub pandora_snmp_get_command ($$$$$$$$$$) {
|
|||
$snmp_version = "2c";
|
||||
}
|
||||
|
||||
if (defined($snmp_port) && ($snmp_port != "161") && ($snmp_port != "") && ($snmp_port != " ") && ($snmp_port != "0")){
|
||||
if (defined($snmp_port) && ($snmp_port ne "161") && ($snmp_port ne "") && ($snmp_port ne " ") && ($snmp_port ne "0")){
|
||||
$snmp_target = $snmp_target.":".$snmp_port;
|
||||
}
|
||||
|
||||
|
@ -304,12 +304,19 @@ sub pandora_snmp_get_command ($$$$$$$$$$) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
# Remove starting & ending double quotes, to easily parse numeric data on String types
|
||||
if ($output =~ /^\"(.*)\"$/){
|
||||
return $1;
|
||||
}
|
||||
else {
|
||||
return $output;
|
||||
|
||||
# Check if output was defined because if the snmpget fails this variable will be undef
|
||||
if (defined ($output)) {
|
||||
if ($output =~ /^\"(.*)\"$/){
|
||||
return $1;
|
||||
}
|
||||
else {
|
||||
return $output;
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue