zabbix主动
PidFile=/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
#Server=192.168.20.27
ServerActive=192.168.20.27:10051
#Hostname=rongxin01
HostnameItem=system.hostname
EnableRemoteCommands=1
LogRemoteCommands=1
RefreshActiveChecks=60
BufferSize=10000
StartAgents=5
MaxLinesPerSecond=200
Timeout=30
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
LoadModulePath=/usr/local/zabbix/share/zabbix/modules
mail报警
停止sendmail或postfix
/etc/init.d/sendmail stop
chkconfig sendmail off
tar –zxf mailx-12.5.tar.gz
make && make install UCBINSTALL=/usr/bin/install
cp /usr/local/bin/mailx /bin/mail
vi /etc/nail.rc
set [email protected]
set smtp=smtp://smtp.sina.cn:25
set smtp-auth-user= [email protected]
set smtp-auth-password= test001
测试 echo "this is test" | mail -v -s "subject" [email protected]
vim /etc/zabbix/zabbix_server.conf
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts
vim /usr/local/zabbix/alertscripts/sendmail.sh
#!/bin/bash
echo "$3" | /bin/mail -s "$2" $1
2、sendEmail
#!/bin/bash
export [email protected]
export zabbixemailto=$1 (发送多人的话,每个人用空格隔开)
export zabbixsubject=$2
export zabbixbody=$3
export smtpserver=smtp.ym.163.com
export [email protected]
export smtppass=123qwe
/usr/local/bin/sendEmail -o tls=no -f $smtpemailfrom -t $zabbixemailto -u $zabbixsubject
-m $zabbixbody -s $smtpserver:25 -xu $smtplogin -xp $smtppass