Monitoring LVM Thin Volume Pool using Zabbix

From Notes_Wiki
Revision as of 06:04, 3 May 2025 by Kamal (talk | contribs)

Home > Debian > Proxmox virtual environment > Monitoring LVM Thin Volume Pool using Zabbix

We can Monitor LVM Thin Volume Pool using Zabbix custom script

Create a new script in zabbix folder

# nano /etc/zabbix/script.sh

Script

#!/bin/bash

# Get LVM thin pool usage
disk_usage=$(sudo lvdisplay -v /dev/ssdvg/ssdlv | grep "Allocated pool data" | awk '{print $4}' | tr -d '%')

# Output the numeric value
echo "$disk_usage"

# Check if usage exceeds threshold (e.g., 80%)
if (( $(echo "$disk_usage > 80" | bc -l) )); then
    exit 1
fi

exit 0