From 97b59fcdd5c5cc4bf7081d0acbbff1a697170ac7 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 15 Nov 2011 14:37:51 +0000 Subject: [PATCH] 2011-11-15 Sergio Martin * util/pandora_manage.pl: Changed cli function to pandora function to reuse it in future git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5137 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/util/pandora_manage.pl | 11 +++++++++++ 2 files changed, 16 insertions(+) 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