mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-25 06:46:29 +02:00
2012-04-23 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm, lib/PandoraFMS/PluginServer.pm: Simplified the calculation of time_left to make sure it is always positive. Fixes bug #3519099. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6094 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
41d449e5fb
commit
e80812047c
@ -1,3 +1,10 @@
|
|||||||
|
2012-04-23 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/NetworkServer.pm,
|
||||||
|
lib/PandoraFMS/WMIServer.pm,
|
||||||
|
lib/PandoraFMS/PluginServer.pm: Simplified the calculation of
|
||||||
|
time_left to make sure it is always positive. Fixes bug #3519099.
|
||||||
|
|
||||||
2012-04-20 Ramon Novoa <rnovoa@artica.es>
|
2012-04-20 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* lib/PandoraFMS/Core.pm: Merged from 4.0 branch. Do not try to reset
|
* lib/PandoraFMS/Core.pm: Merged from 4.0 branch. Do not try to reset
|
||||||
|
@ -92,7 +92,7 @@ sub data_producer ($) {
|
|||||||
my $network_filter = enterprise_hook ('get_network_filter', [$pa_config]);
|
my $network_filter = enterprise_hook ('get_network_filter', [$pa_config]);
|
||||||
|
|
||||||
if ($pa_config->{'pandora_master'} == 0) {
|
if ($pa_config->{'pandora_master'} == 0) {
|
||||||
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try
|
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
|
||||||
FROM tagente, tagente_modulo, tagente_estado
|
FROM tagente, tagente_modulo, tagente_estado
|
||||||
WHERE server_name = ?
|
WHERE server_name = ?
|
||||||
AND tagente_modulo.id_agente = tagente.id_agente
|
AND tagente_modulo.id_agente = tagente.id_agente
|
||||||
@ -103,9 +103,9 @@ sub data_producer ($) {
|
|||||||
'AND tagente_modulo.disabled = 0
|
'AND tagente_modulo.disabled = 0
|
||||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||||
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
|
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
|
||||||
ORDER BY tagente_modulo.flag DESC, time_left DESC, tagente_estado.last_execution_try ASC ', $pa_config->{'servername'});
|
ORDER BY tagente_modulo.flag DESC, time_left ASC, tagente_estado.last_execution_try ASC ', $pa_config->{'servername'});
|
||||||
} else {
|
} else {
|
||||||
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.last_execution_try, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try
|
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.last_execution_try, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
|
||||||
FROM tagente, tagente_modulo, tagente_estado
|
FROM tagente, tagente_modulo, tagente_estado
|
||||||
WHERE ((server_name = ?) OR (server_name = ANY(SELECT name FROM tserver WHERE status = 0)))
|
WHERE ((server_name = ?) OR (server_name = ANY(SELECT name FROM tserver WHERE status = 0)))
|
||||||
AND tagente_modulo.id_agente = tagente.id_agente
|
AND tagente_modulo.id_agente = tagente.id_agente
|
||||||
@ -116,7 +116,7 @@ sub data_producer ($) {
|
|||||||
. (defined ($network_filter) ? $network_filter : ' ') .
|
. (defined ($network_filter) ? $network_filter : ' ') .
|
||||||
'AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
'AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||||
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
|
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
|
||||||
ORDER BY tagente_modulo.flag DESC, time_left DESC, tagente_estado.last_execution_try ASC', $pa_config->{'servername'});
|
ORDER BY tagente_modulo.flag DESC, time_left ASC, tagente_estado.last_execution_try ASC', $pa_config->{'servername'});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $row (@rows) {
|
foreach my $row (@rows) {
|
||||||
|
@ -89,7 +89,7 @@ sub data_producer ($) {
|
|||||||
my @rows;
|
my @rows;
|
||||||
|
|
||||||
if ($pa_config->{'pandora_master'} != 1) {
|
if ($pa_config->{'pandora_master'} != 1) {
|
||||||
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try
|
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
|
||||||
FROM tagente, tagente_modulo, tagente_estado
|
FROM tagente, tagente_modulo, tagente_estado
|
||||||
WHERE server_name = ?
|
WHERE server_name = ?
|
||||||
AND tagente_modulo.id_agente = tagente.id_agente
|
AND tagente_modulo.id_agente = tagente.id_agente
|
||||||
@ -98,9 +98,9 @@ sub data_producer ($) {
|
|||||||
AND tagente_modulo.disabled = 0
|
AND tagente_modulo.disabled = 0
|
||||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||||
AND (tagente_modulo.flag = 1 OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
|
AND (tagente_modulo.flag = 1 OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
|
||||||
ORDER BY tagente_modulo.flag DESC, time_left DESC, last_execution_try ASC', $pa_config->{'servername'});
|
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'});
|
||||||
} else {
|
} else {
|
||||||
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try
|
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
|
||||||
FROM tagente, tagente_modulo, tagente_estado
|
FROM tagente, tagente_modulo, tagente_estado
|
||||||
WHERE ((server_name = ?) OR (server_name = ANY(SELECT name FROM tserver WHERE status = 0)))
|
WHERE ((server_name = ?) OR (server_name = ANY(SELECT name FROM tserver WHERE status = 0)))
|
||||||
AND tagente_modulo.id_agente = tagente.id_agente
|
AND tagente_modulo.id_agente = tagente.id_agente
|
||||||
@ -109,7 +109,7 @@ sub data_producer ($) {
|
|||||||
AND tagente_modulo.id_plugin != 0
|
AND tagente_modulo.id_plugin != 0
|
||||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||||
AND (tagente_modulo.flag = 1 OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
|
AND (tagente_modulo.flag = 1 OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
|
||||||
ORDER BY tagente_modulo.flag DESC, time_left DESC, last_execution_try ASC', $pa_config->{'servername'});
|
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $row (@rows) {
|
foreach my $row (@rows) {
|
||||||
|
@ -89,7 +89,7 @@ sub data_producer ($) {
|
|||||||
my @rows;
|
my @rows;
|
||||||
|
|
||||||
if ($pa_config->{'pandora_master'} != 1) {
|
if ($pa_config->{'pandora_master'} != 1) {
|
||||||
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try
|
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
|
||||||
FROM tagente, tagente_modulo, tagente_estado
|
FROM tagente, tagente_modulo, tagente_estado
|
||||||
WHERE server_name = ?
|
WHERE server_name = ?
|
||||||
AND tagente_modulo.id_agente = tagente.id_agente
|
AND tagente_modulo.id_agente = tagente.id_agente
|
||||||
@ -99,9 +99,9 @@ sub data_producer ($) {
|
|||||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||||
AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()
|
AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()
|
||||||
OR tagente_modulo.flag = 1)
|
OR tagente_modulo.flag = 1)
|
||||||
ORDER BY tagente_modulo.flag DESC, time_left DESC, last_execution_try ASC', $pa_config->{'servername'});
|
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'});
|
||||||
} else {
|
} else {
|
||||||
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, UNIX_TIMESTAMP() - tagente_estado.current_interval - tagente_estado.last_execution_try AS time_left, last_execution_try
|
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
|
||||||
FROM tagente, tagente_modulo, tagente_estado, tserver
|
FROM tagente, tagente_modulo, tagente_estado, tserver
|
||||||
WHERE ((server_name = ?) OR (server_name = ANY(SELECT name FROM tserver WHERE status = 0)))
|
WHERE ((server_name = ?) OR (server_name = ANY(SELECT name FROM tserver WHERE status = 0)))
|
||||||
AND tagente_modulo.id_agente = tagente.id_agente
|
AND tagente_modulo.id_agente = tagente.id_agente
|
||||||
@ -110,7 +110,7 @@ sub data_producer ($) {
|
|||||||
AND tagente_modulo.id_modulo = 6
|
AND tagente_modulo.id_modulo = 6
|
||||||
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
||||||
AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP() OR tagente_modulo.flag = 1 )
|
AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP() OR tagente_modulo.flag = 1 )
|
||||||
ORDER BY tagente_modulo.flag DESC, time_left DESC, last_execution_try ASC', $pa_config->{'servername'});
|
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'});
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $row (@rows) {
|
foreach my $row (@rows) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user