From 4b69030c295365df8ffd448288bfdb1ece991227 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Sat, 26 Mar 2016 20:21:03 +0100 Subject: NMS: Tweak caching and more --- web/nms.gathering.org/api/public/ping | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/nms.gathering.org') diff --git a/web/nms.gathering.org/api/public/ping b/web/nms.gathering.org/api/public/ping index db46b00..5d1037c 100755 --- a/web/nms.gathering.org/api/public/ping +++ b/web/nms.gathering.org/api/public/ping @@ -4,7 +4,7 @@ use strict; use warnings; use nms::web; -nms::web::setwhen('10s'); +nms::web::setwhen('15s'); my $q = $nms::web::dbh->prepare("SELECT DISTINCT ON (sysname) (now() - time) as age,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE time in (select max(time) from ping where " . $nms::web::when . " group by switch)"); @@ -32,6 +32,6 @@ while ( my $ref = $lq->fetchrow_hashref() ) { $nms::web::json{'linknets'}{$ref->{'linknet'}} = [ $ref->{'latency1_ms'}, $ref->{'latency2_ms'} ]; } -$nms::web::cc{'max-age'} = "2"; +$nms::web::cc{'max-age'} = "1"; $nms::web::cc{'stale-while-revalidate'} = "15"; finalize_output(); -- cgit v1.2.3 From f63535d994abc0db7e76869c463910c796055ab6 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Sun, 27 Mar 2016 11:56:10 +0200 Subject: NMS: Add serial no. view to inventory --- web/nms.gathering.org/index.html | 1 + web/nms.gathering.org/js/nms-info-box.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'web/nms.gathering.org') diff --git a/web/nms.gathering.org/index.html b/web/nms.gathering.org/index.html index af7776d..c33f581 100644 --- a/web/nms.gathering.org/index.html +++ b/web/nms.gathering.org/index.html @@ -131,6 +131,7 @@
  • Distro names
  • System description
  • +
  • Serial Numbers
  • Keyboard Shortcuts
  • diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 01bac94..1742ac2 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -546,7 +546,7 @@ nmsInfoBox._windowTypes.inventoryListing = { activeView: '', activeFilter: '', getTitle: function() { - return '

    Inventory listing

    '; + return '

    Inventory listing

    '; }, getContent: function() { return this.content; @@ -592,6 +592,11 @@ nmsInfoBox._windowTypes.inventoryListing = { listTitle = 'System description'; needSnmp = true; break; + case 'jnxBoxSerialNo': + if(hasSnmp) + listTitle = 'Serial Numbers'; + needSnmp = true; + break; default: listTitle = 'Distro names'; list = 'distro_name'; @@ -619,6 +624,9 @@ nmsInfoBox._windowTypes.inventoryListing = { case 'sysDescr': value = nmsData.snmp.snmp[sw]["misc"]["sysDescr"][0]; break; + case 'jnxBoxSerialNo': + value = nmsData.snmp.snmp[sw]["misc"]["jnxBoxSerialNo"][0]; + break; } } catch (e) { //console.log(e); -- cgit v1.2.3 From 51e9872f4ac5db633c12862dec951e0b91b1b132 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Thu, 31 Mar 2016 20:44:38 +0200 Subject: NMS: Fix historic review, part one The actual replay might still be bugged, but fixed-point review works. --- web/nms.gathering.org/api/public/ping | 2 +- web/nms.gathering.org/js/nms-map-handlers.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'web/nms.gathering.org') diff --git a/web/nms.gathering.org/api/public/ping b/web/nms.gathering.org/api/public/ping index 5d1037c..811708d 100755 --- a/web/nms.gathering.org/api/public/ping +++ b/web/nms.gathering.org/api/public/ping @@ -6,7 +6,7 @@ use nms::web; nms::web::setwhen('15s'); -my $q = $nms::web::dbh->prepare("SELECT DISTINCT ON (sysname) (now() - time) as age,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE time in (select max(time) from ping where " +my $q = $nms::web::dbh->prepare("SELECT DISTINCT ON (sysname) (" . $nms::web::now . " - time) as age,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE time in (select max(time) from ping where " . $nms::web::when . " group by switch)"); $q->execute(); diff --git a/web/nms.gathering.org/js/nms-map-handlers.js b/web/nms.gathering.org/js/nms-map-handlers.js index 474e8ef..a7672a3 100644 --- a/web/nms.gathering.org/js/nms-map-handlers.js +++ b/web/nms.gathering.org/js/nms-map-handlers.js @@ -373,14 +373,13 @@ function getDhcpColor(stop) function dhcpUpdater() { - var realnow = Date.now(); - var now = Math.floor(realnow / 1000); if (nmsData.dhcp == undefined || nmsData.dhcp.dhcp == undefined) { return } if (nmsData.switches == undefined || nmsData.switches.switches == undefined) { return; } + var now = nmsData.dhcp.time; try { for (var sw in nmsData.switches.switches) { var c = blue; -- cgit v1.2.3 From 3dc8afb739a03459393d3cda79bd16cefff15cae Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Thu, 31 Mar 2016 21:08:56 +0200 Subject: NMS: Update replay for tg16 dates --- web/nms.gathering.org/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/nms.gathering.org') diff --git a/web/nms.gathering.org/index.html b/web/nms.gathering.org/index.html index c33f581..d3928bb 100644 --- a/web/nms.gathering.org/index.html +++ b/web/nms.gathering.org/index.html @@ -117,7 +117,7 @@
  • DISCO
  • Travel in time
  • -
  • Replay TG
  • +
  • Replay TG
  • Toggle Night Mode
  • -- cgit v1.2.3