Hi everyone
I build this bash script for monitor zfs pool and receive an email when the occupied space is more or equal then 80%.
This is the script:
As you can see the command retrive the % space occupied by the zfs pool:

But in the WebUI is not correspoding:

How the WebUI showme 82.71% instead of the 44%?
Thanks.
I build this bash script for monitor zfs pool and receive an email when the occupied space is more or equal then 80%.
This is the script:
Code:
#!/bin/bash
# Managed by Ansible
THRESHOLD=80
EMAIL="proxmox@mydomain.tld"
HOSTNAME=$(hostname)
# Fetch ZFS pool data: Name and Capacity (percentage)
zpool list -H -o name,cap | while read -r NAME CAP; do
# Remove the % symbol for numerical comparison
USAGE=${CAP%\%}
if [ "$USAGE" -ge "$THRESHOLD" ]; then
SUBJECT="ZFS Alert: Pool '$NAME' usage at $USAGE% on $HOSTNAME"
BODY="WARNING: ZFS pool '$NAME' on server $HOSTNAME has reached $USAGE% capacity.
Threshold set to: $THRESHOLD%
Recommended action: Free up space or add more disks to the pool soon."
echo "$BODY" | mail -s "$SUBJECT" "$EMAIL"
fi
done

But in the WebUI is not correspoding:

How the WebUI showme 82.71% instead of the 44%?
Thanks.

