Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make getMongoData.js compatible with mongosh #130

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions getMongoData/getMongoData.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function printInfo(message, command, section, printCapture, commandParameters) {
function printServerInfo() {
section = "server_info";
printInfo('Shell version', version, section);
printInfo('Shell hostname', hostname, section);
printInfo('Shell hostname', typeof hostname !== "undefined" ? hostname : os.hostname, section);
printInfo('db', function(){return db.getName()}, section);
printInfo('Server status info', function(){return db.serverStatus()}, section);
printInfo('Host info', function(){return db.hostInfo()}, section);
Expand All @@ -277,7 +277,7 @@ function printReplicaSetInfo() {
printInfo('Replica set config', function(){return rs.conf()}, section);
printInfo('Replica status', function(){return rs.status()}, section);
printInfo('Replica info', function(){return db.getReplicationInfo()}, section);
printInfo('Replica slave info', function(){return db.printSlaveReplicationInfo()}, section, true);
printInfo('Replica slave info', db.printSlaveReplicationInfo.deprecated ? function(){return db.printSecondaryReplicationInfo()} : function(){return db.printSlaveReplicationInfo()}, section, true);
}

function printUserAuthInfo() {
Expand Down Expand Up @@ -580,7 +580,7 @@ if (! _printJSON) {
print("getMongoData.js version " + _version);
print("================================");
}
var _host = hostname();
var _host = typeof hostname !== "undefined" ? hostname() : os.hostname();

try {
printServerInfo();
Expand Down