From 7185640c7992de92a0ae96a3434f6a4202f9532f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 3 Jun 2014 13:46:38 +0000 Subject: [PATCH] 2014-06-03 Ramon Novoa * util/recon_scripts/snmp-recon.pl: Create a ping module for agents that do not respond to SNMP. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10093 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 ++++ .../util/recon_scripts/snmp-recon.pl | 24 +++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index e4ec652da9..06403b35cc 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2014-06-03 Ramon Novoa + + * util/recon_scripts/snmp-recon.pl: Create a ping module for agents that do + not respond to SNMP. + 2014-06-03 Junichi Satoh * lib/PandoraFMS/Core.pm: Changed to ignore 'FF timeout' except async diff --git a/pandora_server/util/recon_scripts/snmp-recon.pl b/pandora_server/util/recon_scripts/snmp-recon.pl index b0e55094dc..ae77e99f2c 100755 --- a/pandora_server/util/recon_scripts/snmp-recon.pl +++ b/pandora_server/util/recon_scripts/snmp-recon.pl @@ -687,6 +687,18 @@ sub create_pandora_agent($) { } } + # Create a ping module. + my $module_id = get_agent_module_id($DBH, "ping", $agent_id); + if ($module_id <= 0) { + my %module = ('id_tipo_modulo' => 6, + 'id_modulo' => 2, + 'nombre' => "ping", + 'descripcion' => '', + 'id_agente' => $agent_id, + 'ip_target' => $device); + pandora_create_module_from_hash (\%CONF, \%module, $DBH); + } + # Add interfaces to the agent if it responds to SNMP. return $agent_id unless defined($COMMUNITIES{$device}); my @output = snmp_get_value_array($device, $COMMUNITIES{$device}, $IFINDEX); @@ -729,18 +741,6 @@ sub create_pandora_agent($) { pandora_create_module_from_hash (\%CONF, \%module, $DBH); } - # Create a ping module. - my $module_id = get_agent_module_id($DBH, "ping", $agent_id); - if ($module_id <= 0) { - my %module = ('id_tipo_modulo' => 6, - 'id_modulo' => 2, - 'nombre' => "ping", - 'descripcion' => '', - 'id_agente' => $agent_id, - 'ip_target' => $device); - pandora_create_module_from_hash (\%CONF, \%module, $DBH); - } - return $agent_id; }