diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 9a27f31f04..a82e57483a 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2011-09-01 Sergio Martin + + * util/pandora_manage.pl + util/recon_scripts/snmpdevices.pl: Fixed entities conversions + 2011-08-30 Tomas Palacios * pandora_server/pandora_server_installer: Added missing Perl Socket6 references. diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 8a6270b9af..976fb36f66 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -1219,7 +1219,7 @@ sub pandora_manage_main ($$$) { my $configuration_data = ""; - my $policy_id = enterprise_hook('get_policy_id',[$dbh, $policy_name]); + my $policy_id = enterprise_hook('get_policy_id',[$dbh, safe_input($policy_name)]); exist_check($policy_id,'policy',$policy_name); my $ret = enterprise_hook('pandora_add_policy_queue', [$dbh, $conf, $policy_id, 'apply']); @@ -1237,7 +1237,7 @@ sub pandora_manage_main ($$$) { my $configuration_data = ""; - my $policy_id = enterprise_hook('get_policy_id',[$dbh, $policy_name]); + my $policy_id = enterprise_hook('get_policy_id',[$dbh, safe_input($policy_name)]); exist_check($policy_id,'policy',$policy_name); # Flag as disabled the policy alerts diff --git a/pandora_server/util/recon_scripts/snmpdevices.pl b/pandora_server/util/recon_scripts/snmpdevices.pl index 3f6ad6f998..373d105a1f 100755 --- a/pandora_server/util/recon_scripts/snmpdevices.pl +++ b/pandora_server/util/recon_scripts/snmpdevices.pl @@ -67,21 +67,6 @@ sub show_help { exit; } -########################################################################## -# Return the ID of the agent with the given IP. -########################################################################## -sub get_agent_from_addr ($$) { - my ($dbh, $ip_address) = @_; - - return 0 if (! defined ($ip_address) || $ip_address eq ''); - - my $agent_id = get_db_value ($dbh, 'SELECT id_agent FROM taddress, taddress_agent, tagente - WHERE tagente.id_agente = taddress_agent.id_agent - AND taddress_agent.id_a = taddress.id_a - AND ip = ?', $ip_address); - return (defined ($agent_id)) ? $agent_id : -1; -} - ########################################################################## # Get SNMP response. ########################################################################## @@ -288,6 +273,7 @@ for (my $i = 1; $net_addr <= $net_addr->broadcast; $i++, $net_addr++) { # Remove forbidden caracters $interface =~ s/\"|\n|\<|\>|\&|\[|\]//g; + $agent_id = pandora_create_agent (\%conf, $conf{'servername'}, 'Interface'.$interface, $addr, $target_group, 0, 11, '', 300, $dbh); process_module_snmp ($dbh, $target_community, $addr, ".1.3.6.1.2.1.2.2.1.8.$ax", "interface", "$interface Status", "remote_snmp_proc", "Operative status for $interface at position $ax. IP Address: $ip_address", $conf);