aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/ping-json2.pl
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2015-04-14 16:53:41 +0200
committerKristian Lyngstol <kristian@bohemians.org>2015-04-14 16:53:41 +0200
commit7337ac7e744e978ae93a9cd28a08fea728627287 (patch)
treece6872884feec738eef5862df0f7135e4277eaf9 /web/nms.gathering.org/ping-json2.pl
parente082f5ddb4735ec783a499b6b0066c3459e14618 (diff)
NMS: ooops. Re-fix SQL that I broke to fix
Diffstat (limited to 'web/nms.gathering.org/ping-json2.pl')
-rwxr-xr-xweb/nms.gathering.org/ping-json2.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/nms.gathering.org/ping-json2.pl b/web/nms.gathering.org/ping-json2.pl
index e2b29ae..e46140a 100755
--- a/web/nms.gathering.org/ping-json2.pl
+++ b/web/nms.gathering.org/ping-json2.pl
@@ -16,7 +16,7 @@ my $when =" updated > " . $now . " - '15 secs'::interval and updated < " . $now
my %json = ();
-my $q = $dbh->prepare("SELECT DISTINCT updated,switch,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE $when ORDER BY updated DESC;");
+my $q = $dbh->prepare("SELECT DISTINCT ON (updated, sysname) updated,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE $when ORDER BY updated DESC;");
$q->execute();
while (my $ref = $q->fetchrow_hashref()) {
$json{'switches'}{$ref->{'sysname'}}{'latency'} = $ref->{'latency_ms'};