2009-04-20 Ramon Novoa <rnovoa@artica.es>

* 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.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1630 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2009-04-20 09:44:24 +00:00
parent b3274ec1af
commit 4e4c63acf3
3 changed files with 25 additions and 17 deletions

View File

@ -1,3 +1,11 @@
2009-04-20 Ramon Novoa <rnovoa@artica.es>
* 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 <slerena@artica.es>
* bin/tentacle_server: Added to repo.

View File

@ -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);
}
}
}

View File

@ -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);