代码拉取完成,页面将自动刷新
#!/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 }'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。