Windows: MongoDB.Driver.MongoCommandException - need to login

If you enable the MongoDB monitoring on Windows, you may see this error. 

MongoDB.Driver.MongoCommandException: Command 'serverStatus' failed: need to login (response: { "errmsg" : "need to login", "ok" : 0.0 }) 
at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command) 
at MongoDB.Driver.MongoDatabase.RunCommandAs[TCommandResult](String commandName) 
at MongoDB.Driver.MongoDatabase.RunCommand(String commandName) 
at BoxedIce.ServerDensity.Agent.Checks.ExtendedMongoDBCheck.DoCheck() 
at BoxedIce.ServerDensity.Agent.Agent.DoChecks()

This will happen if you have not appended (admin) to your username in your connection string. For example, if your connection was is: 


you should replace it to be:

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.