天天看点

检测网络脚本

#!/bin/bash

if [ -z "$1" ]

then

  echo "No hostname given."

  exit 3

fi

hostname=$1

if [ $state -eq 100 ]

  echo "CRITICAL - Network is Unreachable. $state"

  exit 1

elif [ $state -eq 0 ]

  echo "OK - Network is OK."

  exit 0

else

  echo "UNKOWN - Network is UNKNOW."

exit 3

~

~本文转自 luoguo 51CTO博客,原文链接:http://blog.51cto.com/luoguoling/964573