aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/nms.js')
-rw-r--r--web/js/nms.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/js/nms.js b/web/js/nms.js
index 36ff97f..bdea1b6 100644
--- a/web/js/nms.js
+++ b/web/js/nms.js
@@ -395,6 +395,8 @@ function initNMS() {
nmsData.registerSource("snmp","/api/read/snmp");
nmsData.registerSource("smanagement","/api/read/switches-management");
nmsData.registerSource("oplog", "/api/read/oplog");
+ setInterval(nmsUpdateNavbarGraph, 10000);
+ nmsUpdateNavbarGraph();
nmsOplog.init();
}
@@ -612,6 +614,19 @@ function restoreSettings()
}
/*
+ * Updates a simple legend-free graph, located on the navbar.
+ *
+ * The idea is to give a general "feeling" of the event. And that it's
+ * neat.
+ *
+ * The timer-thing to bust a cache divides by 10 seconds, so updating more
+ * than once every 10 seconds is pointless.
+ */
+function nmsUpdateNavbarGraph() {
+ var img = document.getElementById("navbar-graph");
+ img.src = "/render/?target=movingAverage(averageSeries(ping.*.ipv4),%225min%22)&target=secondYAxis(averageSeries(perSecond(snmp.*.*.{ifHCInOctets,ifHCOutOctets})))&bgcolor=%23ffffff00&width=600&height=20&format=svg&from=-60min&until=now&graphOnly=true&somerandomthing=" + Math.floor(new Date().getTime() / 10000);
+}
+/*
* Test if the entire path specified in the arrary "ar" exists under the
* specified root.
*