怎么用hostmonitor监控linux

怎么用hostmonitor监控linux,第1张

<pre t="code" l="bash">#!/bin/sh

if [ $# -ge 1 ]

then

OS=`uname`

case $OS in

AIX)PCOUNT=`vmstat|tail -1|awk '{print $4*4}'`

Linux) PfreeMem=`free -m | awk 'NR==3{print $4}'`Ptotal=`free -m | awk 'NR==2{print $2}'`PCOUNT=`echo "($PfreeMem*100/$Ptotal)"|bc`

FreeBSD)PCOUNT=`vmstat|tail -1|awk '{print $5}'`

NetBSD) PCOUNT=`vmstat|tail -1|awk '{print $5}'`

OpenBSD)PCOUNT=`vmstat|tail -1|awk '{print $5}'`

SunOS) PCOUNT=`vmstat|tail -1|awk '{print $5}'`

*) echo 'ScriptRes:Unknown:script is not designed for '$OS

exit

esac

if [ $PCOUNT -le $1 ]

then

echo "ScriptRes:Bad:"$PCOUNT"%"

else

echo "ScriptRes:Ok:"$PCOUNT"%"

fi

else

echo 'ScriptRes:Unknown:not enough parameters specified'

fi

还真没试验过,可能会把 MBR 里面的 grub 覆盖了。但 grub 重新装到 MBR 里面就行了。他的设置不受影响。 Linux 最少 10G 。不然真不够用。 你的 gnost 是基于全硬盘还是基于分区? 好像 ghost 备份 Linux 有点问题。

hostmonitor怎么实现网页监控

1234567891011121314151617181920212223    #!/<a href="https://www.baidu.com/s?wd=bin&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPhw9uWuhm1T3mW64uhfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWD1rHD3rjfLrjmdnj0knHRsr0" target="_blank" class="baidu-highlight">bin</a>/shif [ $# -ge 1 ]then  <a href="https://www.baidu.com/s?wd=OS&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPhw9uWuhm1T3mW64uhfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWD1rHD3rjfLrjmdnj0knHRsr0" target="_blank" class="baidu-highlight">OS</a>=`uname`  case $<a href="https://www.baidu.com/s?wd=OS&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPhw9uWuhm1T3mW64uhfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWD1rHD3rjfLrjmdnj0knHRsr0" target="_blank" class="baidu-highlight">OS</a> in    <a href="https://www.baidu.com/s?wd=AIX&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPhw9uWuhm1T3mW64uhfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWD1rHD3rjfLrjmdnj0knHRsr0" target="_blank" class="baidu-highlight">AIX</a>)    PCOUNT=`vmstat|tail -1|awk '{print $4*4}'`    Linux)  PfreeMem=`free -m | awk 'NR==3{print $4}'`Ptotal=`free -m | awk 'NR==2{print $2}'`PCOUNT=`echo "($PfreeMem*100/$Ptotal)"|bc`    FreeBSD)PCOUNT=`vmstat|tail -1|awk '{print $5}'`    NetBSD) PCOUNT=`vmstat|tail -1|awk '{print $5}'`    OpenBSD)PCOUNT=`vmstat|tail -1|awk '{print $5}'`    Sun<a href="https://www.baidu.com/s?wd=OS&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPhw9uWuhm1T3mW64uhfk0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnWD1rHD3rjfLrjmdnj0knHRsr0" target="_blank" class="baidu-highlight">OS</a>)  PCOUNT=`vmstat|tail -1|awk '{print $5}'`    *) echo 'ScriptRes:Unknown:script is not designed for '$OS       exit  esac  if [ $PCOUNT -le $1 ]  then    echo "ScriptRes:Bad:"$PCOUNT"%"  else    echo "ScriptRes:Ok:"$PCOUNT"%"  fielse  echo 'ScriptRes:Unknown:not enough parameters specified'fi


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7114648.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-01
下一篇 2023-04-01

发表评论

登录后才能评论

评论列表(0条)

保存