Docs Menu

mongostat Behavior, Access, and Usage

mongostat automatically creates FIPS-compliant connections to a mongod/mongos that is configured to use FIPS mode.

In order to connect to a mongod that enforces authorization with the --auth option, specify the --username and --password options, and the connecting user must have the serverStatus privilege action on the cluster resources.

Important

Starting in MongoDB 8.0, to use mongostat to connect to a sharded cluster, the user must also have the directShardOperations role.

The built-in role clusterMonitor provides the serverStatus privilege as well as other privileges. To create a role with just the privilege to run mongostat, see Create a Role to Run mongostat.