datereport echo "----------------------------------------------------">>datereport #检查超过75%分区 echo "over 75%" >>datereport echo "--------------------------------------" />
红联Linux门户
Linux帮助

linux日常检查的shell

发布时间:2008-09-26 21:05:24来源:红联作者:oniprbl
#!/bin/bash
echo "$HOSTNAME" >datereport
echo "----------------------------------------------------">>datereport
#检查超过75%分区
echo "over 75%" >>datereport
echo "---------------------------------------------------">>datereport
df -h |grep '[7-9][5-9]%'>>datereport
echo -e "-----------------------------------------------\n">>datereport
#检查服务启动情况
echo "service status">>datereport
echo "----------------------------------------------------">>datereport
service dhcpd status >>datereport
echo -e "--------------------------------------------------\n">>datereport
#显示用户最后登陆时间
echo "user login last time" >>datereport
echo "------------------------------------------------------">>datereport
lastlog | grep -v \* >>datereport
echo -e "--------------------------------------------------\n">>datereport
#查看内存使用情况
free >>datereport
echo -e "--------------------------------------------------\n">>datereport
vmstat >>datereport
echo -e "----------------------------------------------------\n">>datereport

发邮件给管理员
mail -s day-report user
文章评论

共有 0 条评论