diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-03-17 01:57:57 +0000 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-03-17 01:57:57 +0000 |
commit | 20afe93187d1ebec66e181b8426b66de94a52c76 (patch) | |
tree | 104433e3ee9e6afe0954f02e489995f5483c1948 | |
parent | 23bec69a289a1dc6761fab27e0a934f97d0fd186 (diff) |
NMS: Moure output hacks
-rwxr-xr-x | clients/snmpfetchng.pl | 6 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-map-handlers.js | 7 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-map.js | 10 |
3 files changed, 14 insertions, 9 deletions
diff --git a/clients/snmpfetchng.pl b/clients/snmpfetchng.pl index dd9862d..68baddd 100755 --- a/clients/snmpfetchng.pl +++ b/clients/snmpfetchng.pl @@ -20,8 +20,6 @@ our $dbh = nms::db_connect(); $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; -#my $qualification = 'sysname LIKE \'e71%\''; - my $qualification = <<"EOF"; (last_updated IS NULL OR now() - last_updated > poll_frequency) AND (locked='f' OR now() - last_updated > '15 minutes'::interval) @@ -92,7 +90,7 @@ sub inner_loop for my $refswitch (@switches) { $outstanding++; my %switch = %{$refswitch}; - $poll_todo .= "$switch{'sysname'} ($switch{'mgtip'}) "; + $poll_todo .= "$switch{'sysname'} "; $switch{'start'} = time; $qlock->execute($switch{'id'}) @@ -146,11 +144,11 @@ sub callback{ } } $sth->execute($switch{'sysname'}, JSON::XS::encode_json(\%tree2)); - mylog( "Polled $switch{'sysname'} in " . (time - $switch{'start'}) . "s. ($outstanding outstanding polls)"); $qunlock->execute($switch{'id'}) or die "Couldn't unlock switch"; $dbh->commit; $outstanding--; + mylog( "Polled $switch{'sysname'} in " . (time - $switch{'start'}) . "s. ($outstanding outstanding polls)"); } while (1) { inner_loop(); diff --git a/web/nms.gathering.org/js/nms-map-handlers.js b/web/nms.gathering.org/js/nms-map-handlers.js index f5bf9d5..fa33bad 100644 --- a/web/nms.gathering.org/js/nms-map-handlers.js +++ b/web/nms.gathering.org/js/nms-map-handlers.js @@ -346,9 +346,14 @@ function randomizeColors() } } +function discoDo() { + randomizeColors(); + setTimeout(randomizeColors,500); +} function discoInit() { - nmsData.addHandler("switches","mapHandler",randomizeColors); + nmsData.addHandler("ticker", "mapHandler", discoDo); + setNightMode(true); setLegend(1,blue,"Y"); setLegend(2,red, "M"); diff --git a/web/nms.gathering.org/js/nms-map.js b/web/nms.gathering.org/js/nms-map.js index d77016c..d855320 100644 --- a/web/nms.gathering.org/js/nms-map.js +++ b/web/nms.gathering.org/js/nms-map.js @@ -210,11 +210,13 @@ nmsMap._drawSwitchBlur = function(sw) if (nmsData.switches == undefined || nmsData.switches.switches == undefined) return; var box = this._getBox(sw); + this._c.blur.ctx.save(); this._c.blur.ctx.fillStyle = "red"; - this._c.blur.ctx.shadowBlur = 100; - this._c.blur.ctx.shadowColor = "green"; - this._drawBox(this._c.blur.ctx, box['x'],box['y'],box['width'],box['height']); - this._c.blur.ctx.shadowBlur = 0; + this._c.blur.ctx.shadowBlur = 30; + this._c.blur.ctx.shadowColor = "white"; + this._c.blur.ctx.scale(this.scale, this.scale); // FIXME + this._c.blur.ctx.fillRect(box['x'],box['y'],box['width'],box['height']); + this._c.blur.ctx.restore(); } nmsMap._drawSwitch = function(sw) { |