Last active
May 1, 2026 00:35
-
-
Save brianschmitt/6321422fe7c315675a84d87f2bf66861 to your computer and use it in GitHub Desktop.
UDM Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mongo --quiet localhost:27117/ace --eval ' | |
| var oldest = db.event.find().sort({time:1}).limit(1).toArray()[0]; | |
| var newest = db.event.find().sort({time:-1}).limit(1).toArray()[0]; | |
| print("Oldest: " + oldest.datetime); | |
| print("Newest: " + newest.datetime); | |
| ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mongo localhost:27117/ace --eval 'db.event.deleteMany({})' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mongo --quiet localhost:27117/ace --eval ' | |
| var devices = {}; | |
| var names = {}; | |
| // Build MAC → name map | |
| db.user.find({}, { mac: 1, name: 1, hostname: 1 }).forEach(function(u) { | |
| names[u.mac] = u.name || u.hostname || "unknown"; | |
| }); | |
| // Build radio usage | |
| db.event.find( | |
| { key: "EVT_WU_Connected" }, | |
| { user: 1, radio: 1, ssid: 1 } | |
| ).forEach(function(d) { | |
| if (!devices[d.user]) { | |
| devices[d.user] = { radios: {}, ssids: {} }; | |
| } | |
| devices[d.user].radios[d.radio] = true; | |
| devices[d.user].ssids[d.ssid] = true; | |
| }); | |
| // Output | |
| for (var mac in devices) { | |
| if (devices[mac].radios["ng"] && devices[mac].radios["na"]) { | |
| print( | |
| (names[mac] || "unknown") + " | " + | |
| mac + " | BOTH BANDS | SSIDs=" + | |
| Object.keys(devices[mac].ssids).join(",") | |
| ); | |
| } | |
| } | |
| ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment