zabbix/脚本/disk_monitor.sh
2025-04-22 09:59:34 +08:00

16 lines
310 B
Bash

#!/bin/bash
case "$1" in
usage)
df -h | grep "$2" | awk '{print $5}' | tr -d '%'
;;
iops_read)
iostat -d -k | grep "$2" | awk '{print $4}'
;;
iops_write)
iostat -d -k | grep "$2" | awk '{print $5}'
;;
*)
echo "Usage: $0 {usage <mount_point>|iops_read <device>|iops_write <device>}"
;;
esac