aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms-map-handlers.js
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-21 13:31:11 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-21 13:31:11 +0200
commit0900959bea04ba2c489b4ed521701429d9785193 (patch)
tree465389c3871b495f909b0d98c16bc87df007615a /web/js/nms-map-handlers.js
parentcdc3d60d5e7baa09afba42bb19ae7ed9723d03ff (diff)
Expose handler-data/combo data in infobox
Fixes #15 Still lots of things that _should_ be done, but this is the groundwork needed for a combined map. Theoretically, all map handlers should just expose getInfo somehow now.
Diffstat (limited to 'web/js/nms-map-handlers.js')
-rw-r--r--web/js/nms-map-handlers.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/js/nms-map-handlers.js b/web/js/nms-map-handlers.js
index 46ab672..d32849d 100644
--- a/web/js/nms-map-handlers.js
+++ b/web/js/nms-map-handlers.js
@@ -74,6 +74,7 @@ var handler_cpu = {
var handler_combo = {
init:comboInit,
+ getInfo:comboInfo,
tag:"combo",
name:"Aggregated health"
};
@@ -411,14 +412,17 @@ function snmpUpdater() {
}
function snmpInfo(sw) {
var ret = { description: "SNMP data", switch: sw, why: "No data" };
- if (nmsData.snmp.snmp[sw] == undefined || nmsData.snmp.snmp[sw].misc == undefined) {
+ if (nmsData.snmp == undefined || nmsData.snmp.snmp == undefined || nmsData.snmp.snmp[sw] == undefined || nmsData.snmp.snmp[sw].misc == undefined) {
ret.score = 800;
ret.why = "No data";
+ ret.value = "No data";
} else if (nmsData.snmp.snmp[sw].misc.sysName[0] != sw) {
ret.score = 300;
ret.why = "SNMP sysName doesn't match Gondul sysname";
+ ret.value = ret.why;
} else {
ret.score = 0;
+ ret.value = "SNMP freshly updated";
nmsMap.setSwitchColor(sw, green);
}
return ret;
@@ -474,6 +478,7 @@ function comboInfo(sw) {
}
} catch(e) {}
}
+ worst.description = "Worst: " + worst.description;
return worst;
}