sysUpTime
snmptrap -v 2c -c zbx2022 192.168.31.207:10162 0 linkUp ifIndex.1 i 1 ifAdminStatus.1 i up ifOperStatus.1 i up ifDescr s eth0
EVENT heartbeatNotification .1.3.6.1.4.1.3902.4101.4.2.1.1 "Status Events" Normal
FORMAT ZBXTRAP $aA "云桌面平台-NMS系统与北向网管心跳检查,$N:$1"
read host read ip vars=datetime=$(date "+%F %T") while read oid val do date=`echo $oid |grep sysUpTimeInstance` if [[ "$date" != "" ]];then val=`echo $val | sed 's/:/ days,/'` fi if [ "$vars" = "" ] then vars="$oid = $val" else oid=$(echo $oid |awk -F[:]+ '{print $2}') vars="$vars, \n$oid = $val" fi done
EVENT ztestoragealarmNew .1.3.6.1.4.1.3902.2904.1.2.1.4.1.1 "Status Events" Normal
FORMAT ZBXTRAP $ar $N "alarmuuid:$+4,severity:$p1($9),$12 $p2"