本文共 846 字,大约阅读时间需要 2 分钟。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | [root@yz shell] # cat pingsmtpexmail.sh #!/bin/bash echo "" >> /etc/zabbix/shell/pingsmtpexmail .log echo "" >> /etc/zabbix/shell/pingsmtpexmail .log echo "===========================================================================" >> /etc/zabbix/shell/pingsmtpexmail .log date '+%Y-%m-%d %H:%M:%S' >> /etc/zabbix/shell/pingsmtpexmail .log ping -c 3 -W 3 $1 &>> /etc/zabbix/shell/smtpexmailping .log if [ $? - eq 0 ] then echo 1 else echo 2 fi [root@yz shell] # cat ../zabbix_agentd.d/ cert_check.conf ping .conf pingsmtpexmail.conf tcp_status.conf userparameter_mysql.conf [root@yz shell] # cat ../zabbix_agentd.d/pingsmtpexmail.conf UserParameter=smtpexmail[*], bash /etc/zabbix/shell/pingsmtpexmail .sh $1 [root@yz shell] # |