加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
smf 787 Bytes
一键复制 编辑 原始数据 按行查看 历史
Thomas Merkel 提交于 2017-05-10 11:45 . Fix warning, error for smf services
#!/bin/sh
if [ "$1" = "autoconf" ]; then
echo 'yes'
exit 0
fi
if [ "$1" = "config" ]; then
cat <<EOF
graph_title SMF Services
graph_category processes
graph_scale no
graph_vlabel services
graph_args --base 1000 -l 0
graph_info Number of SMF services per state
online.label online
disabled.label disabled
maintenance.label maintenance
maintenance.warning 0
degraded.label degraded
degraded.warning 0
offline.label offline
legacy_run.label legacy_run
uninitialized.label uninitialized
EOF
exit 0
fi
svcs -a -o state,nstate | awk '
NR > 1 {
a[$1]++
}
BEGIN {
a["degraded"] = 0
a["disabled"] = 0
a["maintenance"] = 0
a["offline"] = 0
a["online"] = 0
a["uninitialized"] = 0
a["legacy_run"] = 0
}
END {
for(k in a) {
print k ".value", a[k]
}
}'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化