加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cputime 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Thomas Merkel 提交于 2017-02-16 08:06 . Fix naming in help header
#!/usr/bin/bash
# -*- sh -*-
: << =cut
=head1 NAME
cputime - Plugin to monitor CPU usage
=head1 CONFIGURATION
No configuration
=head1 AUTHOR
Unknown author
=head1 LICENSE
GPLv2
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
. $MUNIN_LIBDIR/plugins/plugin.sh
if [ "$1" = "autoconf" ]; then
if [ "$(zonename)" != "global" ]; then
echo yes
exit 0
else
echo no
exit 0
fi
fi
if [ "$1" = "config" ]; then
cat <<EOF
graph_title CPU usage
graph_info cpu time
graph_args --base 1000
graph_category system
graph_order sys user waitrq
graph_vlabel cpu time used (+) / waitrq (-) per \${graph_period}
sys.label sys
sys.min 0
sys.type DERIVE
sys.draw AREA
sys.cdef sys,1000000000,/
user.label user
user.min 0
user.draw STACK
user.type DERIVE
user.cdef user,1000000000,/
waitrq.label waitrq
waitrq.type DERIVE
waitrq.draw LINE1
waitrq.cdef waitrq,1000000000,/,-1,*
EOF
exit 0
fi
kstat -p zones:*:*:nsec_sys zones:*:*:nsec_user zones:*:*:nsec_waitrq | sed 's/.*nsec_//g' | awk '{ print $1 ".value", $2 }'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化