For MongoDB replica set & sharding aware
Member health via replSetGetStatus, oplog window in hours, sharding balancer status, query monitoring with currentOp and profiler, WiredTiger cache + concurrent transactions tracking.
Member health via replSetGetStatus, oplog window in hours, sharding balancer status, query monitoring with currentOp and profiler, WiredTiger cache + concurrent transactions tracking.
db.currentOp() output: active commands, ns (namespace), microsecs_running, lock dependencies, secs_running, planSummary.
get_diag_current_opsget_active_queriesget_blocking_sessionsSlow queries from system.profile (above slowOpThresholdMs), planSummary (COLLSCAN warning), keysExamined / nreturned ratio.
get_diag_profilerget_profiler_summary(db)Profiler data grouped by command type (find/aggregate/insert/update/delete), average duration and total call count.
get_top_queriesExecution plan via explain('executionStats'): stage tree (IXSCAN, COLLSCAN, FETCH, SORT), totalKeysExamined, totalDocsExamined.
get_execution_plan$indexStats aggregation: per-index "accesses" count, never-used indexes, most frequently used indexes.
get_diag_index_statsdb.serverStatus(): ops, asserts, connections, network, opcounters, mem, extra_info. Composite health score.
get_diag_server_statusget_health_checkMember list, state (PRIMARY/SECONDARY/ARBITER/RECOVERING), health, uptime, optimeDate, pingMs. Election history, sync source.
get_replica_set_statusDifference between oldest and newest timestamp in local.oplog.rs — window in hours. Insufficient window breaks initial sync.
get_oplog_windowDifference between primary and secondary optime (seconds), per-member secondaryDelay, lag warning / critical thresholds.
get_replication_statusActive connections, available, totalCreated, ssl-only ratio, user / app distribution, max connections usage.
get_connection_detailConfig server, shards, mongos router, chunk distribution, balanced or not (variance %), database-shard assignments.
get_sharding_statusIs balancer running, last round migration count, failed migrations, operations exceeding the balancer window.
collstats: shard key distribution, chunk count per collection, indexes, storage size, document count. dbstats: per-DB totals.
get_diag_collection_statsget_diag_db_statscacheSizeGB, bytes used, dirty bytes, eviction frequency, target dirty ratio, eviction workers, modified pages evicted by application threads.
get_diag_wt_cacheWiredTiger ticket system: read tickets (out / available), write tickets, queue length. Ticket exhaustion = throughput cap.
get_wt_concurrent_transactionsWiredTiger compression ratio, on-disk size vs uncompressed size, journal size, checkpoint duration.
get_storage_metricsdbPath drive fullness, file count, biggest files, growth trend. Configured disk metrics for Atlas.
get_disk_volumesget_database_filesget_io_latency(hours)Is authentication enabled, TLS required, localhost auth bypass check, root role usage, are there users in default DBs?
get_security_checksdb.system.users: user list, assigned roles, db scope, mechanism (SCRAM-SHA-1, SCRAM-SHA-256, x.509). Custom role definitions.
get_diag_users_rolesget_logins_securityMongoDB Enterprise audit log: connection events, authcheck, authorization failures, schema changes. Last N events with filter.
get_audit_logs(limit)Locks from currentOp, waitingForLock = true, lock dependencies, queue lengths (Global/Database/Collection).
get_active_waitsget_query_wait_stats| Capability | Description | Command / Source |
|---|---|---|
| Performance & Query | ||
| currentOp | Active operations | db.currentOp() |
| Profiler | system.profile slow ops | db.system.profile |
| Top queries | Command type grouping | profiler aggregation |
| Explain | executionStats stage tree | cursor.explain() |
| Index stats | $indexStats accesses | $indexStats |
| Server status | opcounters, network, mem | serverStatus |
| Replica Set | ||
| Replica set status | Members + state | replSetGetStatus |
| Oplog window | Time calculation | local.oplog.rs |
| Replication lag | Per-member optime diff | replSetGetStatus |
| Connection detail | Active / available | connPoolStats |
| Sharding | ||
| Sharding status | Cluster map + chunks | sh.status() |
| Balancer | Migration history | config.actionlog |
| Collection stats | collstats per collection | collStats |
| DB stats | Per-DB totals | dbStats |
| WiredTiger | ||
| WT cache | Cache fill, dirty, eviction | serverStatus.wiredTiger.cache |
| Concurrent transactions | Read/write tickets | concurrentTransactions |
| Storage metrics | Compression + journal | serverStatus |
| I/O latency | Disk read/write latency | OS metrics |
| Security | ||
| Security checks | Auth + TLS + root role | composite |
| Users & roles | SCRAM, x.509, custom roles | db.system.users |
| Audit log | Enterprise audit | auditLog destination |
| Active waits | currentOp lock waits | currentOp |
Replica set, sharded cluster, Atlas — every MongoDB topology on one platform.