diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 6fb02a9733..155b6f7d51 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,11 @@ +2009-04-20 Ramon Novoa + + * lib/PandoraFMS/ReconServer.pm: Temporarily disabled TCP scans, the + Recon Server was too slow. Fixed a bug that reset recon tasks + when scanning large networks. + + * lib/PandoraFMS/DataServer.pm: Small fix. + 2009-04-19 Sancho Lerena * bin/tentacle_server: Added to repo. diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 042268212a..ee5afc7d8a 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -204,7 +204,7 @@ sub process_xml_data { $module_data->{'data'} = $data->{'value'}; my $data_timestamp = (defined ($data->{'timestamp'})) ? $data->{'timestamp'} : $timestamp; process_module_data ($pa_config, $module_data, $agent_name, $module_name, - $module_type, $data_timestamp, $dbh); + $module_type, $interval, $data_timestamp, $dbh); } } } diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index f8a84f1d15..c2245c8b56 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -27,7 +27,7 @@ use Thread::Semaphore; use IO::Socket::INET; use Net::Ping; use NetAddr::IP; -use POSIX qw(strftime); +use POSIX qw(strftime ceil); use PandoraFMS::Tools; use PandoraFMS::DB; @@ -86,11 +86,11 @@ sub data_producer ($) { my @rows = get_db_rows ($dbh, 'SELECT * FROM trecon_task WHERE id_recon_server = ? - AND (status = 1 OR (utimestamp + interval_sweep) < UNIX_TIMESTAMP())', $server_id); + AND (utimestamp = 0 OR (utimestamp + interval_sweep) < UNIX_TIMESTAMP())', $server_id); foreach my $row (@rows) { # Update task status - update_recon_task ($dbh, $row->{'id_rt'}, 0); + update_recon_task ($dbh, $row->{'id_rt'}, 1); push (@tasks, $row->{'id_rt'}); } @@ -122,7 +122,7 @@ sub data_consumer ($$) { for (my $i = 1, $net_addr++; $net_addr < $net_addr->broadcast; $i++, $net_addr++) { my $addr = (split(/\//, $net_addr))[0]; - update_recon_task ($dbh, $task_id, $i / ($total_hosts / 100)); + update_recon_task ($dbh, $task_id, ceil ($i / ($total_hosts / 100))); # Does the host already exist? next if (get_agent_from_addr ($dbh, $addr) > 0); @@ -132,21 +132,21 @@ sub data_consumer ($$) { if (icmp_scan ($addr, $pa_config->{'networktimeout'}) == 1) { $alive = 1; #Check for Remote Desktop & VNC (Desktop & Server machines) - } elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 3389) == 1 || - tcp_scan ($addr, $pa_config->{'networktimeout'}, 5900) == 1) { - $alive = 1; + #} elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 3389) == 1 || + # tcp_scan ($addr, $pa_config->{'networktimeout'}, 5900) == 1) { + # $alive = 1; #Check for management ports 10000 = Webmin, 161 = SNMP (Most embedded devices) - } elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 10000) == 1 || - tcp_scan ($addr, $pa_config->{'networktimeout'}, 161) == 1) { - $alive = 1; + #} elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 10000) == 1 || + # tcp_scan ($addr, $pa_config->{'networktimeout'}, 161) == 1) { + # $alive = 1; #Check for SSH & Mail (Servers and Unix machines) - } elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 22) == 1 || - tcp_scan ($addr, $pa_config->{'networktimeout'}, 25) == 1) { - $alive = 1; + #} elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 22) == 1 || + # tcp_scan ($addr, $pa_config->{'networktimeout'}, 25) == 1) { + # $alive = 1; #Check for WWW & MySQL (Webservers and systems in a DMZ) - } elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 80) == 1 || - tcp_scan ($addr, $pa_config->{'networktimeout'}, 3306) == 1) { - $alive = 1; + #} elsif (tcp_scan ($addr, $pa_config->{'networktimeout'}, 80) == 1 || + # tcp_scan ($addr, $pa_config->{'networktimeout'}, 3306) == 1) { + # $alive = 1; } next unless ($alive == 1);