Reducing Duplicate VM Alerts in Zabbix for Proxmox Nodes
To prevent multiple Proxmox nodes from sending alerts about the same VM, you'll need to modify your Zabbix template configuration. Here are the best approaches:
Option 1: Use Item Prototypes with Conditional Triggers
-
Edit your Proxmox template in Zabbix
-
Modify the item prototypes that collect VM metrics:
- Add a condition to only collect data from the node where the VM is running
- Use a discovery rule that checks
pve2-vm-status or similar to identify running VMs
-
Create triggers with host conditions:
Option 2: Use Low-Level Discovery with Host Filtering
- Create a discovery rule that identifies VMs running on each node
- Add a filter to only process VMs where the node is the primary host
- Configure triggers to only fire when the condition is met on the primary node
Option 3: Use Zabbix Actions with Conditions
- Create a single action for VM alerts
- Add conditions to the action:
- "Host group" = "Proxmox Nodes"
- "Application" = "Proxmox VMs"
- "Host name" = "The specific node running the VM" (you'll need to dynamically set this)
Implementation Example
For the first option, you might modify your template like this:
-
Discovery rule (for VMs):
Key: proxmox.vm.discovery
Type: Zabbix agent
Preprocessing: JSONPath '$.data[*].vmid'
-
Item prototype (for VM status):
Key: proxmox.vm.status[{#VMID}]
Type: Zabbix agent
Preprocessing: JSONPath '$.data[?(@.vmid=={#VMID})].status'
-
Trigger prototype:
{Template:proxmox.vm.status[{#VMID}].last(0)}=0
Then add a condition to the trigger:
{Template:proxmox.vm.status[{#VMID}].last(0)}<>{Template:proxmox.vm.status[{#VMID}].last(0),#1}
This ensures only one node (the one where the VM is running) will trigger the alert.
Would you like me to elaborate on any of these approaches or provide more specific configuration details for your setup?