diff options
-rwxr-xr-x | clients/ping.pl | 4 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 29 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-map-handlers.js | 4 |
3 files changed, 20 insertions, 17 deletions
diff --git a/clients/ping.pl b/clients/ping.pl index 27aa878..174342a 100755 --- a/clients/ping.pl +++ b/clients/ping.pl @@ -21,7 +21,7 @@ my $lq = $dbh->prepare("SELECT linknet,addr1,addr2 FROM linknets"); while (1) { # ping loopbacks my $ping = Net::Oping->new; - $ping->timeout(0.2); + $ping->timeout(0.4); $q->execute; my %ip_to_switch = (); @@ -73,7 +73,7 @@ while (1) { $dbh->commit; # ping linknets $ping = Net::Oping->new; - $ping->timeout(0.2); + $ping->timeout(0.4); $lq->execute; my @linknets = (); diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 7975bae..e3956d8 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -422,6 +422,15 @@ nmsInfoBox._searchSmart = function(id, sw) { } } } + if (nmsData.smanagement.switches[sw].ip.match(id)) { + return true; + } + if (nmsData.smanagement.switches[sw].subnet4.match(id)) { + return true; + } + if (nmsData.smanagement.switches[sw].subnet6.match(id)) { + return true; + } if (nmsData.snmp.snmp[sw].misc.sysDescr[0].match(id)) { return true; } @@ -445,20 +454,14 @@ nmsInfoBox._search = function() { if(id) { nmsMap.enableHighlights(); for(var sw in nmsData.switches.switches) { - if (id[0] == "/") { - if (nmsInfoBox._searchSmart(id.slice(1),sw)) { - matches.push(sw); - nmsMap.setSwitchHighlight(sw,true); - } else { - nmsMap.setSwitchHighlight(sw,false); - } + if(sw.indexOf(id) > -1) { + matches.push(sw); + nmsMap.setSwitchHighlight(sw,true); + } else if (nmsInfoBox._searchSmart(id,sw)) { + matches.push(sw); + nmsMap.setSwitchHighlight(sw,true); } else { - if(sw.indexOf(id) > -1) { - matches.push(sw); - nmsMap.setSwitchHighlight(sw,true); - } else { - nmsMap.setSwitchHighlight(sw,false); - } + nmsMap.setSwitchHighlight(sw,false); } } } else { diff --git a/web/nms.gathering.org/js/nms-map-handlers.js b/web/nms.gathering.org/js/nms-map-handlers.js index b1d31f0..d3becde 100644 --- a/web/nms.gathering.org/js/nms-map-handlers.js +++ b/web/nms.gathering.org/js/nms-map-handlers.js @@ -223,8 +223,8 @@ function tempUpdater() for (sw in nmsData.switches["switches"]) { var t = "white"; var temp = ""; - - if(!nmsData.snmp || !nmsData.snmp.snmp[sw]["misc"] || !nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]) + + if(!nmsData.snmp || !nmsData.snmp.snmp || ! nmsData.snmp.snmp[sw] || !nmsData.snmp.snmp[sw]["misc"] || !nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]) continue; tempObj = nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]; |