3-3 告警推到Syslog
最后更新于:2022-04-02 07:41:15
#### 告警脚本推送的syslog服务器(udp_send.sh )
```shell
#!/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中定义
##### 备注:以“;”隔离开,便于程序分析,看开发了
';