windows下端口脚本检测
rem 如果citrix tcp1494端口不通,则重启
服务器 rem ****************************************************
title Citrix状态检测,端口TCP1494
DATE=%date:~0,10% %time%
cls
netstat -an | find "LIST" | find /c "0:1494"
@echo off
www.atcpu.com if not errorlevel 1 goto exit
echo Citrix不正常,需要重新启动
服务器!!
rem 若不正常,写入日志
echo citrix服务不正常,时间 %DATE% >> citrixstatus.log
shutdown /f /r
:exit
echo Citrix状态ok!
netstat -an | find "LIST" 这里的find过滤区分大小写,标识查找带有监听字符串(LISTENING)的行