• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >windows > linux 巡检报告

linux 巡检报告

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含linux服务器巡检报告,linux巡检脚本,linux巡检命令,linux巡检,linux巡检手册等服务器相关知识,网友希望可以进行参考

#!/bin/bash
echo -e resin集群巡检"\n" >> /opt/xunjian/xunjian.txt
echo -e wap集群"\n" >> /opt/xunjian/xunjian.txt
a=`cat /opt/xunjian/wap.txt`
t=`cat /opt/xunjian/touch.txt`
w=`cat /opt/xunjian/webkit.txt`
b=`date +%Y-%m-%d-%H:%M`
f=$(date +%d'\'\ %H:%M|awk -F "" '{OFS=""}{$NF="";print}')
for i in $a
do
c=`ssh $i "w|grep -oP '(?<=load average: )\d...(?=, )'"`
d=`ssh $i "df -h|grep -w /|awk '{print $4}'"`
total=`ssh $i "free -m|grep -w Mem"|awk '{print $2}'`
userd=`ssh $i "free -m|grep -w Mem"|awk '{print $3}'`
mem=`echo "scale=2;$userd/$total"|bc`
mount=`ssh $i "mount|grep -w 192.168.0.70|wc -l"`
resin=`ssh $i "ps -ef|grep resin|grep -v grep|wc -l"`
rooterror=`ssh $i "grep $f /www/youyuan.com.1/logs/root-error.log|egrep '(500error|500错误)'|wc -l"`
if [ $mount -lt 5 ]; then
hangshu=error
else
hangshu=good
fi
if [ $resin -lt 2 ]; then
jincheng=error
else
jincheng=good
fi
echo -e $i"\t"yanchao"\t"$b"\t"$c"\t"$d"\t"$mem"\t"$hangshu"\t"$jincheng"\t"$rooterror"\n" >> /opt/xunjian/xunjian.txt

done
echo -e touch集群"\n" >> /opt/xunjian/xunjian.txt
for tt in $t
do
c=`ssh $tt "w|grep -oP '(?<=load average: )\d...(?=, )'"`
d=`ssh $tt "df -h|grep -w /|awk '{print $4}'"`
total=`ssh $tt "free -m|grep -w Mem"|awk '{print $2}'`
userd=`ssh $tt "free -m|grep -w Mem"|awk '{print $3}'`
mem=`echo "scale=2;$userd/$total"|bc`
mount=`ssh $tt "mount|grep -w 192.168.0.70|wc -l"`
resin=`ssh $tt "ps -ef|grep resin|grep -v grep|wc -l"`
rooterror=`ssh $tt "grep $f /www/youyuan.com.1/logs/root-error.log|egrep '(500error|500错误)'|wc -l"`
if [ $mount -lt 5 ]; then
hangshu=error
else
hangshu=good
fi
if [ $resin -lt 2 ]; then
jincheng=error
else
jincheng=good
fi
echo -e $tt"\t"yanchao"\t"$b"\t"$c"\t"$d"\t"$mem"\t"$hangshu"\t"$jincheng"\t"$rooterror"\n" >> /opt/xunjian/xunjian.txt

done
echo -e webkit集群"\n" >> /opt/xunjian/xunjian.txt
for ww in $w
do
c=`ssh $ww "w|grep -oP '(?<=load average: )\d...(?=, )'"`
d=`ssh $ww "df -h|grep -w /|awk '{print $4}'"`
total=`ssh $ww "free -m|grep -w Mem"|awk '{print $2}'`
userd=`ssh $ww "free -m|grep -w Mem"|awk '{print $3}'`
mem=`echo "scale=2;$userd/$total"|bc`
mount=`ssh $ww "mount|grep -w 192.168.0.70|wc -l"`
resin=`ssh $ww "ps -ef|grep resin|grep -v grep|wc -l"`
rooterror=`ssh $ww "grep $f /www/youyuan.com.1/logs/root-error.log|egrep '(500error|500错误)'|wc -l"`
if [ $mount -lt 5 ]; then
hangshu=error
else
hangshu=good
fi
if [ $resin -lt 2 ]; then
jincheng=error
else
jincheng=good
fi
echo -e $ww"\t"yanchao"\t"$b"\t"$c"\t"$d"\t"$mem"\t"$hangshu"\t"$jincheng"\t"$rooterror"\n" >> /opt/xunjian/xunjian.txt

done



结果

resin集群巡检

服务器ip 巡检人 巡检日期 负载 磁盘空间 io使用率 内存使用率 图片挂载是否正常 resin进程是否正常 root-error.log日志500错

wap集群

192.168.0.132 yanchao 2013-09-22-16:23 0.27 /dev/sda1 531G 35G 470G 7% / .59 good good 4

192.168.0.41 yanchao 2013-09-22-16:23 0.09 /dev/sda3 381G 39G 324G 11% / .72 good good 1

192.168.0.43 yanchao 2013-09-22-16:23 0.21 /dev/sda3 381G 81G 281G 23% / .64 good good 7

192.168.0.42 yanchao 2013-09-22-16:23 0.29 /dev/sda3 381G 44G 318G 13% / .58 good good 4

192.168.0.51 yanchao 2013-09-22-16:23 0.57 /dev/sda3 381G 34G 329G 10% / .60 good good 5

192.168.0.126 yanchao 2013-09-22-16:23 0.13 /dev/sda1 531G 13G 491G 3% / .37 good good 0

192.168.0.127 yanchao 2013-09-22-16:23 0.00 /dev/sda1 531G 11G 494G 3% / .41 good good 0

touch集群

192.168.0.211 yanchao 2013-09-22-16:23 0.08 /dev/sda1 531G 18G 486G 4% / .50 good good 0

192.168.0.44 yanchao 2013-09-22-16:23 0.26 /dev/sda3 381G 66G 296G 19% / .65 good good 0

192.168.0.130 yanchao 2013-09-22-16:23 0.09 /dev/sda1 531G 22G 483G 5% / .66 good good 0

192.168.0.131 yanchao 2013-09-22-16:23 0.05 /dev/sda1 531G 17G 487G 4% / .48 good good 0

webkit集群

192.168.0.23 yanchao 2013-09-22-16:23 1.45 1.6T 1011G 505G 67% / .55 good good 1

192.168.0.53 yanchao 2013-09-22-16:23 0.04 /dev/sda3 366G 46G 302G 13% / .82 good good 0

192.168.0.123 yanchao 2013-09-22-16:23 0.00 /dev/sda1 531G 31G 474G 7% / .54 good good 1

192.168.0.128 yanchao 2013-09-22-16:23 0.01 /dev/sda1 531G 24G 480G 5% / .51 good good 0

本文出自 “expect批量同步数据” 博客,请务必保留此出处http://4249964.blog.51cto.com/4239964/1300178

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • linux 巡检报告

相关文章

  • 重启IIS怎么重启?重启iis命令详解
  • Windows 2003远程桌面连接登陆操作方法详解
  • windows2003系统中一些基本设置使用技巧
  • Windows Server 2008网络性能
  • windows下定时cmd命令行运行php文件实例
  • Redis 默认配置精简及注释说明
  • WINDOWS SERVER 2003恢复默认权限设置
  • [趣图]恋爱就像TCP连接一样,是不可靠的
  • 即时通讯开发平台AnyChat 的性能优势
  • iis“Microsoft JET Database Engine(0x80004005)未指定错误”

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 配置和工具提升Windows 2003系统安全
    • IIS服务器不支持flv文件解决方法
    • history高级应用7
    • 解决dell服务器无法识别4G内存办法
    • Windows IIS 7.5伪静态中文URL地址404错误问题
    • Win7 64位操作系统下配置PHP+MySql+Apache环境
    • 搭建基于Corosync+DRBD的高可用MySQL集群
    • 浅谈WINDOWS环境下VPN服务器的设置
    • VMware虚拟机中激活Windows Server 2008的方法
    • iis配置php无法上传文件解决办法

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有