thecamels-zabbix/bin/swap_enabled.sh

8 lines
200 B
Bash
Raw Normal View History

2016-05-02 09:29:00 +02:00
#!/bin/bash
swap=$(free -m | grep -i swap | awk '{ print $2 }')
if [ "$swap" != "0" ]; then
echo '{"data":[{"{#TOTAL}":"total", "{#FREE}":"free", "{#PFREE}":"pfree", "{#PUSED}":"pused" } ]}'
fi