Skip to content

millerjmatos/mongodb-atlas-zbx

 
 

Repository files navigation

MongoDB Atlas Zabbix Monitoring Template

Monitor MongoDB Atlas clusters directly in Zabbix using the official MongoDB Atlas API

Features

  • Automated discovery of clusters, nodes, and metrics
  • Real-time monitoring of cluster status and availability
  • CPU, memory, disk I/O, and network utilization per cluster
  • Pre-configured items ready for Zabbix triggers and dashboards

Prerequisites

  1. Zabbix Server 6.x or higher
  2. MongoDB Atlas account with active API access
  3. API keys with Organization Member or Project Read Only permissions
  4. Network access from Zabbix server to https://cloud.mongodb.com/api/atlas/v2

Configuration

  1. Generate a MongoDB Atlas API key:
# Access MongoDB Atlas Console
# Navigate to: Organization Settings > Access Manager > API Keys
# Click "Create API Key"
# Assign permissions: Project Read Only (minimum required)
# Save Public Key and Private Key
  1. Configure the host in Zabbix:
  • Host name: MongoDB Atlas - [Project Name]
  • Groups: Cloud Resources or Databases
  • Interfaces: not required - API-based monitoring
  1. Set the required macros at host level - recommended over template level for better security and flexibility:
Macro Value Description
{$ATLAS.API.PUBLIC_KEY} your-public-key MongoDB Atlas API Public Key
{$ATLAS.API.PRIVATE_KEY} your-private-key MongoDB Atlas API Private Key
{$ATLAS.PROJECT_ID} project-id MongoDB Atlas Project ID
{$ORG.ID} organization-id MongoDB Atlas Organization ID
{$URL.BASE} https://cloud.mongodb.com/api/atlas/v2 MongoDB Atlas API Base URL

Usage

Available Metrics

Cluster metrics:

  • Cluster state (IDLE, CREATING, UPDATING, DELETING)
  • Node count and distribution
  • MongoDB version

Performance metrics:

  • CPU utilization (%)
  • Memory usage (bytes)
  • Disk IOPS (read/write)
  • Network throughput (bytes/sec)

Database operations:

  • Operations per second (insert, query, update, delete)
  • Query execution time (ms)
  • Active connections
  • Replication lag (seconds)

Discovery Rules

The template includes Low-Level Discovery (LLD) for clusters, nodes, and databases with active operations. Discovery runs every 1 hour by default - adjust in template settings if needed.

Creating Triggers

Example trigger for high CPU usage:

Name: High CPU utilization on {HOST.NAME}
Expression: last(/MongoDB Atlas Template/atlas.cpu.usage)>80
Severity: Warning

Considerations

This template builds on previous work from this fork, which adapted the original source. The main contribution here is updating the templates to MongoDB Atlas API v2, as the previous version became incompatible with the current API.


Created by Muller Matos

Releases

No releases published

Packages

 
 
 

Contributors