Skip to main content
Version: 26.01

DB Viewer - Mongostat Read

Endpoint​

/o/db/mongostat

Overview​

Returns the server statistics reported by the MongoDB mongostat tool, connected with the settings of the main Countly database.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

Requires global admin access.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

Read mongostat output​

/o/db/mongostat?api_key=YOUR_API_KEY

Response​

Success Response​

[
["insert", "query", "update", "delete"],
["*0", "*0", "*0", "*0"]
]

Response Fields​

FieldTypeDescription
(root array)ArrayOne row per line of tool output. Each row is an array of strings, split on whitespace.

Error Responses​

  • 401
{
"result": "User does not have right"
}

Behavior​

  • Runs mongostat on the server and returns its first output.