html嵌入zabbix网页,GitHub - pavkamlc/ax-zabbix-html-template: AX Zabbix Trigger Alert HTML Template...

AX Zabbix Trigger Alert HTML Template

Default Zabbix trigger email alerts is not too attractive. Some tips on how to fix this and do something similar to it:

Alert email:

c6714cf326a7c050ed150ac6a18a0b69.png

Recovery email:

749768c11f8a79fcd79342e7d17ef5f9.png

Instalation

Install sendEmail

$ sudo apt-get install sendemail

Find AlertScriptsPath in Zabbix configuration file:

$ cat /etc/zabbix/zabbix_server.conf | grep AlertScriptsPath

### Option: AlertScriptsPath

# AlertScriptsPath=${datadir}/zabbix/alertscripts

AlertScriptsPath=/usr/lib/zabbix/alertscripts

$cd /usr/lib/zabbix/alertscripts

Create new alert script:

$ sudo nano html_email.sh

Paste following or simmilar content, don't forget to fill it with your real SMTP data.

#!/bin/sh

export smtpemailfrom=zabbix@yourdomain.com

export zabbixemailto="$1"

export zabbixsubject="$2"

export zabbixbody="$3"

export smtpserver=localhost # or your SMTP server

export smtplogin=SMTP_LOGIN

export smtppass=SMTP_PASSWORD

/usr/bin/sendEmail -f $smtpemailfrom -t $zabbixemailto -u $zabbixsubject \-m $zabbixbody -s $smtpserver:25 -o tls=no \-o message-content-type=html

Login to your Zabbix GUI and go to Administration -> Media Types -> Email

Change type to Script and put 'html_email.sh' into script name.

Add next script parameters and click Update:

{ALERT.SENDTO}

{ALERT.SUBJECT}

{ALERT.MESSAGE}

Open Email alert action tab: Configuration -> Action -> Event source [Triggers] -> Report problems to Zabbix administrators

Copy/paste to Operations Default message content from file templates/alert.html and to Recovery operations from templates/recovery.html

Click Update.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值