系统集成系统维护aix 6

AIX 健康检查脚本

各位 大神,请解释一下脚本都是什么意思?



RC=0

unset result
result=`uptime | grep days | awk '{print $3}'`
if [ ! -z "${result}" ] ; then
        if [ ${result} -gt 8000 ] ; then
                echo "System is up over 8000 days; this is a sign of a corrupt /etc/utmp file."
                RC=1
        fi
fi

if [ ${RC} -eq 0 ] ; then
        result=`who -r`
        if [ -z "${result}" ] ; then
                echo "Unable to determine run-level with the who -r command."
                echo "This is a sign of a corrupt /etc/utmp file."
                RC=1
        fi
fi

return ${RC}
参与15

14同行回答

xindahaixindahai系统运维工程师耀泰明德
回复 2# csuyuanwei     O(∩_∩)O谢谢显示全部
回复 2# csuyuanwei


    O(∩_∩)O谢谢收起
系统集成 · 2012-10-25
浏览1341
koalcakoalca软件开发工程师koalca
用户登录和退出登录的记录存放在/etc/utmp这里,提示你相关审计档案已经过期。显示全部
用户登录和退出登录的记录存放在/etc/utmp这里,提示你相关审计档案已经过期。收起
政府机关 · 2012-10-16
浏览1330
xiaoyu19861016xiaoyu19861016软件开发工程师青岛科技公司
高手   不过这脚本用在哪方面显示全部
高手   不过这脚本用在哪方面收起
互联网服务 · 2012-10-12
浏览1418
csuyuanweicsuyuanwei软件开发工程师ibm
前段是检测系统已经运行了8000天以上,就显示提示【System is up over 8000 days; this is a sign of a corrupt /etc/utmp file.】,结束脚本,并且返回值为1.后一段是前一段测试如果不大于8000天(返回值等于0时),检测当前进程的运行级别,如果结果为空(result的值为空),就显示提示信...显示全部
前段是检测系统已经运行了8000天以上,就显示提示【System is up over 8000 days; this is a sign of a corrupt /etc/utmp file.】,结束脚本,并且返回值为1.

后一段是前一段测试如果不大于8000天(返回值等于0时),检测当前进程的运行级别,如果结果为空(result的值为空),就显示提示信息【Unable to determine run-level with the who -r command.】【echo "This is a sign of a corrupt /etc/utmp file.】,结束脚本,并且返回值为1.收起
IT咨询服务 · 2012-10-07
浏览1416

提问者

xindahai
系统运维工程师耀泰明德
擅长领域: 服务器数据库AIX

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2012-10-05
  • 关注会员:1 人
  • 问题浏览:11118
  • 最近回答:2012-11-19
  • X社区推广