Get the MongoDB database statistic to a local CSV file
Project description
Mostats 📊
Get the MongoDB database statistic e.g : database name, collection, index size, and collection size to a local CSV file.
New version support multiple server instance and getting additional host information, uptime, total number of command, read, getmore, command, insert, and summarise the cluster report. Host information will be save as cluster-info.csv on the same folder
mostats -u "mongodb+srv://username:password@cluster1.cluster.mongodb.net/" -m True
Install
Run this command, please choose pip or pip3
pip3 install mostats
pip install mostats
How to use
Please check on the guide below:
usage: getCluster.py [-h] [-u URL [URL ...]] [-c CSV] [-n NAME [NAME ...]] [-m MOREINFO]
Get the MongoDB database statistic to a local CSV file
options:
-h, --help show this help message and exit
-u URL [URL ...], --url URL [URL ...]
MongoDB cluster URL, default is "mongodb://127.0.0.1". Example:
"mongodb+srv://<<username>>:<<password>>@cluster.zqqqy.mongodb.net/?retryWrites=true&w=majority". For multiple server
please use the space and "" to seperate
example:"mongodb+srv://<<username>>:<<password>>@cluster1.zqqqy.mongodb.net/?retryWrites=true&w=majority"
"mongodb+srv://<<username>>:<<password>>@cluster2.zqqqy.mongodb.net/?retryWrites=true&w=majority"
-c CSV, --csv CSV CSV filename, default "cluster-data.csv"
-n NAME [NAME ...], --name NAME [NAME ...]
Cluster name, default value first subdomain example: mongodb+srv://clustername.cl0.mongodb.net will be clustername. For
multiple server please use the space and "" to seperate example:"cluster1" "cluster2"
-m MOREINFO, --moreinfo MOREINFO
Getting the host information, uptime, total number of command, read, and insert
Example
For MongoDB Atlas please leave the cluster name empty
mostats -u "mongodb+srv://username:password@cluster0.cluster.mongodb.net/?retryWrites=true&w=majority" -c "cluster-info.csv"
Specify custom cluster name for MongoDB Community or Enterprise Edition installation only when MongogDB installed without FQDN
mostats -u "mongodb+srv://username:password@cluster0.cluster.mongodb.net/?retryWrites=true&w=majority" -c "cluster-info.csv"
Getting more host information on multiple cluster with custom cluster name. Please leave it empty when getting the data from MongoDB atlas
mostats -u "mongodb+srv://username:password@cluster1.cluster.mongodb.net/" "mongodb+srv://username:password@cluster2.cluster.mongodb.net/" -n "Cluster 1" "Cluster 2" -m True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file mostats-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: mostats-1.0.6-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8cad53c66dc64aa7a18768681e0efcfc71d3564baf4046da1bdfd6b77f51a85 |
|
MD5 | cb6d30c088a999a50235c3e5c2077525 |
|
BLAKE2b-256 | 4abe1c14c743d822b0c9ef2f0556899246de61b1ef85d072f6a902d88b544868 |