This is my config:
1) I can send mail with the command like 'echo "Zabbix test" | mailx -v -s "test" [email protected]' from the zabbix server , with the "zabbix" user.
2) I edit my zabbix_server.conf, I'm sure the AlertScriptsPath is right and its group and user are also 'zabbix'
3) This is my script 'sendmail.sh':
#!/bin/bash
messages=`echo $3 | tr '\r\n' '\n'`
subject=`echo $2 | tr '\r\n' '\n'`
echo "${messages}" | mail -s "${subject}" $1 >>/tmp/sendmail.log 2>&1
4) I create media type with the type 'script', its name is 'sendmail.sh', its parameters are '{ALERT.SENDTO}','{ALERT.SUBJECT}','{ALERT.MESSAGE }'.
5) add user's (admin) media type.
6) edit configuration->actions -> action, condition is 'trigger severity >= warning'
7) edit configuration->actions -> operations: send message to users: Admin (Zabbix Administrator) via all media
8) edit configuration->actions -> recovery operations: send message to users: Admin (Zabbix Administrator) via all media
When I stopped one of zabbix-agent, reports -> action log remind me that mail's status is "sent", but in fact I can't receive any mail.
1) I can send mail with the command like 'echo "Zabbix test" | mailx -v -s "test" [email protected]' from the zabbix server , with the "zabbix" user.
2) I edit my zabbix_server.conf, I'm sure the AlertScriptsPath is right and its group and user are also 'zabbix'
3) This is my script 'sendmail.sh':
#!/bin/bash
messages=`echo $3 | tr '\r\n' '\n'`
subject=`echo $2 | tr '\r\n' '\n'`
echo "${messages}" | mail -s "${subject}" $1 >>/tmp/sendmail.log 2>&1
4) I create media type with the type 'script', its name is 'sendmail.sh', its parameters are '{ALERT.SENDTO}','{ALERT.SUBJECT}','{ALERT.MESSAGE }'.
5) add user's (admin) media type.
6) edit configuration->actions -> action, condition is 'trigger severity >= warning'
7) edit configuration->actions -> operations: send message to users: Admin (Zabbix Administrator) via all media
8) edit configuration->actions -> recovery operations: send message to users: Admin (Zabbix Administrator) via all media
When I stopped one of zabbix-agent, reports -> action log remind me that mail's status is "sent", but in fact I can't receive any mail.
Comment