2014-05-30 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/Config.pm
	  lib/PandoraFMS/DataServer.pm: Ignore the agent group coming from the XML
	  if autocreate_group is set.

	* util/recon_scripts/snmp-recon.pl: Changed the default value for a
	  router-less scan.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10045 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2014-05-30 10:01:23 +00:00
parent 3a4ec99fe5
commit 73494d9f82
4 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2014-05-30 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Config.pm
lib/PandoraFMS/DataServer.pm: Ignore the agent group coming from the XML
if autocreate_group is set.
* util/recon_scripts/snmp-recon.pl: Changed the default value for a
router-less scan.
2014-05-28 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/ReconServer.pm: Fixed wrong order in

View File

@ -275,7 +275,7 @@ sub pandora_load_config {
# Snmpget for snmpget system command (optional)
$pa_config->{"snmpget"} = "/usr/bin/snmpget";
$pa_config->{'autocreate_group'} = 2;
$pa_config->{'autocreate_group'} = -1;
$pa_config->{'autocreate'} = 1;
# max log size (bytes)

View File

@ -296,13 +296,17 @@ sub process_xml_data ($$$$$) {
# Get OS, group and description
my $os = pandora_get_os ($dbh, $data->{'os_name'});
my $group_id = -1;
$group_id = get_group_id ($dbh, $data->{'group'}) if (defined ($data->{'group'}));
if ($group_id == -1) {
$group_id = $pa_config->{'autocreate_group'};
if (! defined (get_group_name ($dbh, $group_id))) {
logger($pa_config, "Group id $group_id does not exist (check autocreate_group config token)", 3);
return;
my $group_id = $pa_config->{'autocreate_group'};
if (! defined (get_group_name ($dbh, $group_id))) {
if (defined ($data->{'group'}) && $data->{'group'} ne '') {
$group_id = get_group_id ($dbh, $data->{'group'});
if (! defined (get_group_name ($dbh, $group_id))) {
logger($pa_config, "Group " . $data->{'group'} . " does not exist.", 3);
return;
}
} else {
logger($pa_config, "Group id $group_id does not exist (check autocreate_group config token).", 3);
return;
}
}

View File

@ -877,7 +877,7 @@ update_recon_task($DBH, $TASK_ID, 15);
# Find devices.
message("[2/6] Searching for switches and end hosts...");
if ($ROUTER ne '0.0.0.0') {
if (defined($ROUTER) && $ROUTER ne '') {
foreach my $router (keys(%VISITED_ROUTERS)) {
arp_cache_discovery($router);
}