diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index eeff8af160..fd6460b897 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2011-11-15 Sergio Martin + + * util/pandora_manage.pl: Changed cli function to pandora function + to reuse it in future + 2011-11-15 Sancho Lerena * util/pandora_db.pl: Small optimization in module deletion. Instead diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index fbd02c1889..bad0a2f009 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -303,6 +303,17 @@ sub pandora_validate_event_filter ($$$$$$$$$) { db_do ($dbh, "UPDATE tevento SET estado = 1 WHERE estado = 0".$filter); } +############################################################################### +# Get list of all downed agents +############################################################################### +sub pandora_get_downed_agents () { + my @downed_agents = get_db_rows ($dbh, "SELECT tagente.nombre, truncate((NOW() - tagente.ultimo_contacto/60),0) as downed_time, tagente.server_name from tagente +where UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(tagente.ultimo_contacto)>(tagente.intervalo*2) +OR tagente.ultimo_contacto=0"); + + return \@downed_agents; +} + ############################################################################### ############################################################################### # PRINT HELP AND CHECK ERRORS FUNCTIONS