From 38cd6399c0a954e8e2382877372f2ce59c34a7a9 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 28 Feb 2013 15:52:46 +0000 Subject: [PATCH] 2013-02-28 Sancho Lerena * lib/PandoraFMS/PluginServer.pm: Removed several "Use of uninitialized value in string" errors. * lib/PandoraFMS/Core.pm: Fixed more ugly notices due uninitialized vars. * util/recon_scripts/snmpdevices.pl: Fixed due new interface. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 4 ++++ pandora_server/lib/PandoraFMS/Core.pm | 5 +++++ pandora_server/util/recon_scripts/snmpdevices.pl | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index d2c81bb8b4..8cb9edb721 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -8,6 +8,10 @@ * lib/PandoraFMS/PluginServer.pm: Removed several "Use of uninitialized i value in string" errors. + * lib/PandoraFMS/Core.pm: Fixed more ugly notices due uninitialized vars. + + * util/recon_scripts/snmpdevices.pl: Fixed due new interface. + 2013-02-28 Ramon Novoa * bin/pandora_server: Undid the previous commit since forking after diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index fcad6340e9..a12fd4bec5 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1058,6 +1058,11 @@ sub pandora_process_module ($$$$$$$$$;$) { } my $last_try = ($1 == 0) ? 0 : timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); + + if (!defined($agent_status->{'datos'})){ + $agent_status->{'datos'} = ""; + } + my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0; db_do ($dbh, 'UPDATE tagente_estado diff --git a/pandora_server/util/recon_scripts/snmpdevices.pl b/pandora_server/util/recon_scripts/snmpdevices.pl index 918790e440..14e7baf2af 100755 --- a/pandora_server/util/recon_scripts/snmpdevices.pl +++ b/pandora_server/util/recon_scripts/snmpdevices.pl @@ -190,7 +190,7 @@ foreach $addr_item (@net_addr_list) { update_recon_task ($dbh, $task_id, ceil ($i / ($total_hosts / 100))); my $alive = 0; - if (pandora_ping (\%conf, $addr) == 1) { + if (pandora_ping (\%conf, $addr, 5, 2) == 1) { $alive = 1; } @@ -321,7 +321,7 @@ foreach $addr_item (@net_addr_list) { my $addr = $addr_item; my $alive = 0; - if (pandora_ping (\%conf, $addr) == 1) { + if (pandora_ping (\%conf, $addr, 5 ,2) == 1) { $alive = 1; }