From 54b238ab4fa253b31ad317618fddbb1826b7ce8a Mon Sep 17 00:00:00 2001 From: darode Date: Wed, 9 Jan 2013 16:28:05 +0000 Subject: [PATCH] 2013-01-09 Dario Rodriguez * lib/PandoraFMS/NetworkServer.pm: Added log traces to inform about the problem of undefined return of snmpget command. MERGED FROM 4.0.3 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7405 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 7 +++++++ pandora_server/lib/PandoraFMS/NetworkServer.pm | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index c13de0bbb1..bd18f668ac 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2013-01-09 Dario Rodriguez + + * lib/PandoraFMS/NetworkServer.pm: Added log traces to inform + about the problem of undefined return of snmpget command. + + MERGED FROM 4.0.3 + 2013-01-09 Dario Rodriguez * lib/PandoraFMS/NetworkServer.pm: Controlled an error if output of diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index 79a1bf7118..5c3d09371f 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -266,9 +266,9 @@ next_pair: # Set commands for SNMP checks depending on OS type ############################################################################### -sub pandora_snmp_get_command ($$$$$$$$$$) { +sub pandora_snmp_get_command ($$$$$$$$$$$) { - my ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, $snmp3_security_level, $snmp3_extra, $snmp_port) = @_; + my ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, $snmp3_security_level, $snmp3_extra, $snmp_port, $pa_config) = @_; my $output = ""; @@ -316,6 +316,7 @@ sub pandora_snmp_get_command ($$$$$$$$$$) { return $output; } } else { + logger ($pa_config,"[ERROR] Undefined value returned SNMP query. Is the server out of memory?" , 0); return ""; } } @@ -373,7 +374,7 @@ sub pandora_query_snmp ($$$) { # SNMP v1, v2 and v2c call if ($snmp_version ne '3'){ - $output = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, "", "", $snmp_port); + $output = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, "", "", $snmp_port, $pa_config); if (defined ($output) && $output ne ""){ $module_result = 0; $module_data = $output; @@ -395,7 +396,7 @@ sub pandora_query_snmp ($$$) { $snmp3_extra = " -a $snmp3_auth_method -u $snmp3_auth_user -A $snmp3_auth_pass -x $snmp3_privacy_method -X $snmp3_privacy_pass "; } - $output = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, $snmp3_security_level, $snmp3_extra, $snmp_port); + $output = pandora_snmp_get_command ($snmpget_cmd, $snmp_version, $snmp_retries, $snmp_timeout, $snmp_community, $snmp_target, $snmp_oid, $snmp3_security_level, $snmp3_extra, $snmp_port, $pa_config); if (defined ($output) && $output ne ""){ $module_result = 0; $module_data = $output;