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

* lib/PandoraFMS/Core.pm: Fixed the query to get the number of unknown
	  agents. Thanks to Koichiro.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4392 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2011-05-30 16:53:42 +00:00
parent 735ee37bef
commit 10d2bd9b7c
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-05-30 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Fixed the query to get the number of unknown
agents. Thanks to Koichiro.
2011-05-30 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Config.pm,

View File

@ -2304,11 +2304,18 @@ sub pandora_self_monitoring ($$) {
# Number of unknown agents
my $agents_unknown = 0;
if (defined ($my_data_server)) {
$agents_unknown = get_db_value ($dbh, "SELECT * FROM tagente_estado, tagente WHERE tagente.disabled =0 AND tagente.id_agente = tagente_estado.id_agente AND running_by = $my_data_server AND utimestamp < NOW() - (current_interval * 2) limit 10;");
$agents_unknown = get_db_value ($dbh, "SELECT COUNT(DISTINCT tagente_estado.id_agente)
FROM tagente_estado, tagente, tagente_modulo
WHERE tagente.disabled = 0 AND tagente.id_agente = tagente_estado.id_agente
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND tagente_modulo.disabled = 0
AND running_by = $my_data_server
AND utimestamp > 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,24,100)
AND (UNIX_TIMESTAMP(NOW()) - tagente_estado.utimestamp) >= (tagente_estado.current_interval * 2)");
$agents_unknown = 0 if (!defined($agents_unknown));
}
my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'");
my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'");
if (!defined($queued_modules)){
$queued_modules = 0;