Sometimes, I need monitor if server A can ping to server B, or check the server B tcp port status from server A.
Does anyone have a well method?
Does anyone have a well method?
ping -q -c1 host.example.com >/dev/null && echo 1 || echo 0
UserParameter=user.pingto[*],ping -q -c1 $1 >/dev/null && echo 1 || echo 0

UserParameter=pingto[*],ping -n 1 $1 > NUL && echo 1 || echo 0
Comment