MongoDB
MongoDB is a document-oriented NoSQL database designed for scalability and flexibility.
Auto-Detection
Section titled “Auto-Detection”Glouton detects MongoDB by its process and listening port (default: 27017).
If auto-detected parameters are incorrect, override them manually:
sudo tee /etc/glouton/conf.d/99-mongodb.conf > /dev/null << 'EOF'service: # For a MongoDB running outside a container - type: "mongodb" address: "127.0.0.1" port: 27017
# For an additional MongoDB running outside a container - type: "mongodb" instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE" address: "127.0.0.1" port: 27018
# For a MongoDB running in a Docker container - type: "mongodb" instance: "CONTAINER_NAME" address: "172.17.0.2" port: 27017EOFCreate or edit C:\ProgramData\glouton\conf.d\99-mongodb.conf:
service: # For a MongoDB running outside a container - type: "mongodb" address: "127.0.0.1" port: 27017
# For an additional MongoDB running outside a container - type: "mongodb" instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE" address: "127.0.0.1" port: 27018
# For a MongoDB running in a Docker container - type: "mongodb" instance: "CONTAINER_NAME" address: "172.17.0.2" port: 27017Glouton automatically detects configuration changes.
Built-in Metrics
Section titled “Built-in Metrics”| Metric | Description |
|---|---|
service_status | Status of MongoDB |
mongodb_open_connections | Number of client connections to the MongoDB server |
mongodb_net_in_bytes | Network traffic received by MongoDB in bytes per second |
mongodb_net_out_bytes | Network traffic sent by MongoDB in bytes per second |
mongodb_queued_reads | Number of clients waiting to read data from MongoDB |
mongodb_queued_writes | Number of clients waiting to write data to MongoDB |
mongodb_active_reads | Number of clients performing read operations |
mongodb_active_writes | Number of clients performing write operations |
mongodb_queries | Number of queries per second |
Glouton collects MongoDB logs for analysis in Bleemeo.
Monitoring Troubleshooting
Section titled “Monitoring Troubleshooting”See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.
The Service Check is not OK
Section titled “The Service Check is not OK”The check only opens the TCP port — it sends no command — so it fails when the
port is wrong (Connection refused), when a firewall drops the packets
(connection timed out after 10 seconds), or when the configured address
cannot be parsed (Invalid TCP address). A green check proves the port is
open, and nothing more.
Metrics are Missing
Section titled “Metrics are Missing”A passing check says nothing about the metrics: they are collected separately.
Glouton connects to mongodb://<address>:<port> and reads serverStatus. It
sends no credentials, and there is no configuration key to give it any.
Reproduce what Glouton does, from the machine where the agent runs:
mongosh mongodb://127.0.0.1:27017 --quiet --eval 'db.serverStatus().ok'| What you see | Cause | Fix |
|---|---|---|
command serverStatus requires authentication |
Authentication is enabled on the server | Glouton cannot authenticate to MongoDB — contact support if you need it |
| a TLS error | TLS is required | Same limitation: the connection is plain |