告警脚本推送的syslog服务器

cat udp_send.sh 

#!/bin/bash
target=$1
subject=$2
message=$3
echo '########' `date +"%F %T"` '########' >> /app/scripts/time.txt
echo $subject >> /app/scripts/time.txt
echo $message >> /app/scripts/time.txt
echo -n "$subject;$message"| nc  -u -w1 "$target" 5555

echo " " >> /app/scripts/time.txt
备注:5555 是syslog服务器的端口,IP地址在Zabbix中定义
备注:以“;”隔离开,便于程序分析,看开发了

results matching ""

    No results matching ""