From ca71a9ebb131ef1201df5153326570babc3277b7 Mon Sep 17 00:00:00 2001 From: vgilc Date: Thu, 16 Aug 2012 11:55:18 +0000 Subject: [PATCH] 2012-08-16 Vanessa Gil * util/recon_scripts/snmpdevices.pl: Added several communities to recon scripts. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6865 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ .../util/recon_scripts/snmpdevices.pl | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 7e6a50621d..1828c644a8 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2012-08-16 Vanessa Gil + + * util/recon_scripts/snmpdevices.pl: Added several communities + to recon scripts. + 2012-08-10 Miguel de Dios * lib/PandoraFMS/PredictionServer.pm: changed for the SLA service diff --git a/pandora_server/util/recon_scripts/snmpdevices.pl b/pandora_server/util/recon_scripts/snmpdevices.pl index e3ace43657..42bca49a3f 100755 --- a/pandora_server/util/recon_scripts/snmpdevices.pl +++ b/pandora_server/util/recon_scripts/snmpdevices.pl @@ -205,11 +205,21 @@ for (my $i = 1; $net_addr <= $net_addr->broadcast; $i++, $net_addr++) { $resp = ""; - # Obtain SNMP response - $resp = get_snmp_response ($target_timeout, $target_community, $addr); + my @community_list = split (",", $target_community); + my $community_validate = 0; + my $community; + + foreach $community (@community_list) { + $resp = get_snmp_response ($target_timeout, $community, $addr); + + if ($resp ne "") { + $community_validate = 1; + $target_community = $community; + last; + } + } - # No valid SNMP response. - if ($resp eq ""){ + if ($community_validate eq 0) { next; }