diff options
author | Joachim Tingvold <joachim@tingvold.com> | 2015-04-16 21:10:37 +0200 |
---|---|---|
committer | Joachim Tingvold <joachim@tingvold.com> | 2015-04-16 21:10:37 +0200 |
commit | 7147d88f6e3c15a2cce29fc39484280964ac81bc (patch) | |
tree | caefcba543049bb263335601b47116e52d685434 /web/nms.gathering.org/mbd-status.pl | |
parent | cf10d6ed33446032a86c9d58b964c5fbda121550 (diff) | |
parent | 7337ac7e744e978ae93a9cd28a08fea728627287 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/mbd-status.pl')
-rwxr-xr-x | web/nms.gathering.org/mbd-status.pl | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/web/nms.gathering.org/mbd-status.pl b/web/nms.gathering.org/mbd-status.pl deleted file mode 100755 index d37781f..0000000 --- a/web/nms.gathering.org/mbd-status.pl +++ /dev/null @@ -1,44 +0,0 @@ -#! /usr/bin/perl -use CGI; -use DBI; -use lib '../../include'; -use nms; -my $cgi = CGI->new; - -my $dbh = nms::db_connect(); -print $cgi->header(-type=>'text/html; charset=utf-8', -refresh=>'10; ' . CGI::url()); - -print <<"EOF"; -<html> - <head> - <title>MBD status</title> - </head> - <body> - <h1>MBD status</h1> - - <p>Spill søkt etter siste 15 minutter:</p> - - <table> - <tr> - <th>Beskrivelse</th> - <th>Aktive servere</th> - </tr> -EOF - -my $q = $dbh->prepare('select description,sum(active_servers) as active_servers from (select distinct on (game,port) * from mbd_log where ts >= now() - \'10 minutes\'::interval order by game,port,ts desc ) t1 group by description order by sum(active_servers) desc, description;'); -$q->execute(); -while (my $ref = $q->fetchrow_hashref()) { - print <<"EOF"; - <tr> - <td>$ref->{'description'}</td> - <td>$ref->{'active_servers'}</td> - </tr> -EOF -} -$dbh->disconnect; - -print <<"EOF"; - </table> - </body> -</html> -EOF |