zabbix 内网机器通信状态

a=0
for xgip in ${xgipset[*]}
do
    let a+=1
    fping $xgip|grep alive >/dev/null
    if [ $a != 3 ];then
        if [ $? = 0  ];then
            echo  -n "$outip与$xgip正常通信,"
        else
           echo -n "$outip与$xgip不可达,"
        fi
    else
         if [ $? = 0  ];then
            echo   "$outip与$xgip正常通信,"
        else
           echo  "$outip与$xgip不可达,"
        fi
    fi

 

posted @ 2019-10-12 23:31  linux——quan  阅读(231)  评论(0编辑  收藏  举报