前面介绍了2篇munin使用的相关文章:
ln -s /usr/share/munin/plugins/mysql_threads /etc/munin/plugins/mysql_threads ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes ln -s /usr/share/munin/plugins/mysql_innodb /etc/munin/plugins/mysql_innodb
service munin-node restart
#!/bin/sh # -*- sh -*- # vim: ft=sh if [ "$1" = "autoconf" ]; then grep -q '^Threads' /proc/$$/status && echo "yes" || echo "no" exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title Number of threads' #echo 'graph_args --base 1000 -l 0 ' echo 'graph_vlabel number of threads' echo 'graph_category processes' echo 'graph_info This graph shows the number of threads.' echo 'threads.label threads' echo 'threads.info The current number of threads.' exit 0 fi grep -s '^Threads' /proc/[0-9]*/status | awk '{ sum += $2; } END { print "threads.value", sum; }'
#!/bin/sh keyword=munin-node case $1 in (config) cat <<'EOM' graph_title MY_TITLE graph_vlabel (%) graph_args --base 1000 -l 0 graph_scale no graph_category MY_CATEGORY EOM ps aux | grep $keyword | grep -v grep | awk '{print $3,$4}' | while read cpu mem do echo "CPU.label %CPU" echo "CPU.warning 200" echo "CPU.critical 400" echo "CPU.value $cpu" echo "MEM.label %MEM" echo "MEM.warning 20" echo "MEM.critical 50" echo "MEM.value $mem" done exit 0;; esac ps aux | grep $keyword | grep -v grep | awk '{print $3,$4}' | while read cpu mem do echo "CPU.value $cpu" echo "MEM.value $mem" done
# cat munin_info [munin-node_cpu] user root
开始使用独立博客了,原文地址在这里: