From ffae2082357f9550798d98644ddb0dac16f3f7c9 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Mon, 20 Jun 2011 22:43:10 +0200 Subject: [PATCH] show stats of all poll_* on one page --- public/redis.html | 11 +++++++++++ web_ui.pl | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/public/redis.html b/public/redis.html index 383981d..d9e44b2 100644 --- a/public/redis.html +++ b/public/redis.html @@ -22,6 +22,7 @@ RedisCntl.$inject = ['$xhr','$defer'];
+

ADSL

{{response.status['poll.start']}} - {{response.status['poll.finish']}} @@ -31,6 +32,16 @@
ADSL{{response.status['poll.adsl.ok']}}
+

ZTEDSLAM

+{{response.status['ZTEDSLAM.poll.start']}} - +{{response.status['ZTEDSLAM.poll.finish']}} +
{{response.status.ZTEDSLAM}}
+ +

ZTEMSAN

+{{response.status['ZTEMSAN.poll.start']}} - +{{response.status['ZTEMSAN.poll.finish']}} +
{{response.status.ZTEMSAN}}
+

 url={{url}}
diff --git a/web_ui.pl b/web_ui.pl
index 26fd711..d3ab984 100755
--- a/web_ui.pl
+++ b/web_ui.pl
@@ -187,6 +187,10 @@ get '/_redis' => sub {
 	foreach my $p ( qw(poll ZTEDSLAM ZTEMSAN) ) {
 		foreach my $k ( $redis->keys("$p.*") ) {
 			$status->{$k} = eval { $redis->scard($k) } || $redis->get($k);
+			if ( $k =~ m/^(ZTE\w+)\.(\d+\.\d+\.\d+\.\d+)\.(\w+)/ ) {
+				#$status->{$1}->{$2}->{$3} = $status->{$k};
+				$status->{$1}->{$3} += $status->{$k};
+			}
 		}
 	}
 
-- 
2.20.1