Munin - memory-easy
Aus Root-Wiki
Version vom 21. September 2014, 09:29 Uhr von Nevakee (Diskussion | Beiträge)
Code
#!/bin/bash # # Plugin for Memory # # by Marvin Huebel # http://www.nevakee.de # # # Parameters: # # config (required) # autoconf (optional - used by munin-config) # # $Log$ # #%# family=auto #%# capabilities=autoconf ALL=`free -o -b | tail -n 2 | head -1 | awk '{print $2}'` USED=`free -b | tail -n 2 | head -1 | awk '{print $3}'` FREE=`free -b | tail -n 2 | head -1 | awk '{print $4}'` SWAP=`free -o -b | tail -n 1 | head -1 | awk '{print $3}'` if [ "$1" = "autoconf" ]; then echo yes exit 0 fi if [ "$1" = "config" ]; then echo "graph_args --base 1024k -l 0 --upper-limit $ALL"; echo "graph_vlabel Bytes"; echo "graph_title Memory usage"; echo "graph_category system"; echo "graph_info This graph shows what the machine uses memory for."; echo "used.label used"; echo "used.draw AREA"; echo "used.info Memory used."; echo "free.label free"; echo "free.draw STACK"; echo "free.info Free memory."; echo "swap.label swap"; echo "swap.draw STACK"; echo "swap.info swap used."; exit 0 fi echo "used.value $USED"; echo "free.value $FREE"; echo "swap.value $SWAP"; exit 0