Zabbix Agent integration on SME Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
607 B

#!/bin/bash
PATH=$PATH:/usr/sbin:/usr/local/sbin
snapshot_max_alloc(){
MAX_PERCENT=0
for PERCENT in $(lvdisplay | grep % | sed -e 's/ Allocated to snapshot //g' -e 's/%//g'); do
if [[ "$PERCENT" > "$MAX_PERCENT" ]]; then
MAX_PERCENT=$PERCENT
fi
done
echo "$MAX_PERCENT"
}
snapshots(){
echo $(lvdisplay | grep % | wc -l)
}
lv(){
echo $(lvdisplay | grep 'LV Name' | wc -l)
}
vg(){
echo $(vgdisplay | grep 'VG Name' | wc -l)
}
case $1 in
snapshot_max_alloc|snapshots|lv|vg)
$1
;;
*)
echo 'ZBX_NOTSUPPORTED'
esac