舒畅 发表于 2019-1-23 08:51:28

zabbix自定义端口监控

  #!/bin/bash
  IP=172.22.1.1
  PORT=3306
  myfile='/etc/zabbix/data/index.html'
  rm -f ${myfile}
  cd /etc/zabbix/data   &&
  wget${IP}:${PORT} >/dev/null 2>&1
  if [ -f "${myfile}" ]; then
  #删除文件
  rm -f ${myfile}
  #1 表示端口能通
  echo 1
  else
  #0 表示端口不通
  echo 0
  fi
  




页: [1]
查看完整版本: zabbix自定义端口监控