2011-02-18 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/Core.pm: Verify that there is a data server running
	  when computing server stats. Thanks to Tadashi Kaneda.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3921 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2011-02-18 11:42:56 +00:00
parent 1446e03579
commit 4414864c68
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2011-02-18 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Verify that there is a data server running
when computing server stats. Thanks to Tadashi Kaneda.
2011-02-16 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DataServer.pm: Do not update the module description

View File

@ -2094,11 +2094,12 @@ sub pandora_self_monitoring ($$) {
my $free_disk_spool = disk_free ($pa_config->{"incomingdir"});
my $my_data_server = get_db_value ($dbh, "SELECT id_server FROM tserver WHERE server_type = 0 AND name = '".$pa_config->{"servername"}."'");
my $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;");
if (!defined($agents_unknown)){
$agents_unknown = 0;
}
# 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 = 0 if (!defined($agents_unknown));
}
my $queued_modules = get_db_value ($dbh, "SELECT SUM(queued_modules) FROM tserver WHERE name = '".$pa_config->{"servername"}."'");