Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* 処理時間を監視するmuninプラグイン [#c882d4a4]
** Apacheのアクセスログで処理時間を記録する [#b37b1678]
httpd.confを編集する。
LogFormat "%t %D \"%r\"" exectime
CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/ww...
** muninのプラグインを作成する [#s4c6b70e]
以下のファイルをmuninのpluginsディレクトリへ設置する。
#!/bin/sh
do_ () {
logfile/var/log/www/exectime_log.$(date +%Y%m%d)
buffer=1000
command="tail -n $buffer $logfile | awk '{sum=sum+\$...
eval $command
exit 0
}
do_config () {
echo "graph_title Average page execution time"
echo "graph_vlabel Seconds"
echo "graph_category apache"
echo "graph_args --base 1000 -l 0"
echo "graph_info Average page execution time"
echo "exec_time.label Execution time"
echo "exec_time.type GAUGE"
}
case $1 in
config|'')
eval do_$1
esac
exit $?
** 参考 [#u196001d]
http://returnfoo.com/2012/03/average-time-taken-to-serve-...
終了行:
* 処理時間を監視するmuninプラグイン [#c882d4a4]
** Apacheのアクセスログで処理時間を記録する [#b37b1678]
httpd.confを編集する。
LogFormat "%t %D \"%r\"" exectime
CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/ww...
** muninのプラグインを作成する [#s4c6b70e]
以下のファイルをmuninのpluginsディレクトリへ設置する。
#!/bin/sh
do_ () {
logfile/var/log/www/exectime_log.$(date +%Y%m%d)
buffer=1000
command="tail -n $buffer $logfile | awk '{sum=sum+\$...
eval $command
exit 0
}
do_config () {
echo "graph_title Average page execution time"
echo "graph_vlabel Seconds"
echo "graph_category apache"
echo "graph_args --base 1000 -l 0"
echo "graph_info Average page execution time"
echo "exec_time.label Execution time"
echo "exec_time.type GAUGE"
}
case $1 in
config|'')
eval do_$1
esac
exit $?
** 参考 [#u196001d]
http://returnfoo.com/2012/03/average-time-taken-to-serve-...
ページ名: