show CPE stats instead of (unused) poll
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 5 Jul 2011 17:57:33 +0000 (19:57 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 5 Jul 2011 17:57:33 +0000 (19:57 +0200)
lib/APKPM/Model.pm
public/redis.html

index 0fce41b..2005957 100644 (file)
@@ -8,12 +8,14 @@ sub redis_status {
        my $redis = Redis->new;
 
        my $status;
-       foreach my $p ( qw(poll ZTEDSLAM ZTEMSAN) ) {
+       foreach my $p ( qw(ZTEDSLAM ZTEMSAN CPE) ) {
                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->{poll}->{$1}->{$3} += $status->{$k};
+                       } elsif ( $k =~ m/^CPE\.(.+)/ ) {
+                               $status->{poll}->{CPE}->{$1} = $status->{$k};
                        }
                }
        }
index 144ce0b..752a265 100644 (file)
     RedisCntl.$inject = ['$xhr','$defer'];
   </script>
   <div ng:controller="RedisCntl">
-<h1>ADSL</h1>
-{{response.status['poll.start']}} -
-{{response.status['poll.finish']}}
-<table>
-<tr><th colspan=2>queued</th><td>{{response.status['poll.queued']}}</td></tr>
-<tr><th rowspan=2>ping</th><th>OK</th><td>{{response.status['poll.ping.ok']}}</td></tr>
-<tr><th>ERROR</th><td>{{response.status['poll.ping.error']}}</td></tr>
-<tr><th colspan=2>ADSL</th><td>{{response.status['poll.adsl.ok']}}</td></tr>
-</table>
+<h1>CPE</h1>
+{{response.status['CPE.start']}} -
+{{response.status['CPE.finish']}}
+<pre>{{response.status.poll.CPE}}</pre>
 
 <h1>ZTEDSLAM</h1>
 {{response.status['ZTEDSLAM.poll.start']}} -