Skip to content

Instantly share code, notes, and snippets.

View akira-kurogane's full-sized avatar

Akira Kurogane akira-kurogane

View GitHub Profile
@akira-kurogane
akira-kurogane / checkAllVersions.js
Last active February 12, 2016 02:35 — forked from normgraham/checkAllVersions.js
This script traverses all the hosts in a sharded cluster; collects cmdLineOpts, buildInfo, hostInfo, and serverStatus, and makes some basic checks. To use it, save the script on one of your machines and execute it with the following command, ensuring that $HOST and $PORT specify one of your mongos processes: {code} mongo --host $HOST --port $PO…
var checkAllVersions = function (verbose) {
var equalOrLaterVersion = function (v1, v2) {
return (v1[0] > v2[0]) ||
(v1[0] == v2[0] && v1[1] > v2[1]) ||
(v1[0] == v2[0] && v1[1] == v2[1] && v1[2] >= v2[2]);
}
var getHostInfo = function (info) {
try {