Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix 3.0.3 email alarm

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

This zabbix mail alarm is realized by script through sendEmail, a lightweight command line smtp e-mail client.

The Linux distribution used this time is CentOS 6.5 and the Zabix version is 3.0.3.

Download sendEmail

Wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz

Configure sendEmail

[test@zabbix ~] $sudo yum-y install perl-Net-SSLeay perl-IO-Socket-SSL # installation component [test@zabbix ~] $sudo tar xf sendEmail-v1.56.tar.gz-C / usr/src/ [test@zabbix ~] $cd / usr/src/sendEmail-v1.56/ [test@zabbix sendEmail-v1.56] $lltotal 116Muhami Rwmuri Rwmuri-1 root root 13329 Sep 30 2009 CHANGELOG-rw-r--r-- 1 root root 7949 Sep 30 2009 README-rw-r--r-- 1 root root 4701 Sep 30 2009 README-BR.txt-rwxr-xr-x 1 root root 80213 Sep 30 2009 sendEmaillrwxrwxrwx 1 root root 9 Sep 30 2009 sendEmail.pl-> sendEmail-rw-r--r-- 1 root root 1229 Sep 30 2009 TODO [test@zabbix sendEmail-v1.56] $sudo cp-a sendEmail / usr/local/bin/

Add script

[test@zabbix ~] $cd / usr/local/zabbix/alertscripts/ [test@zabbix ~] $vim sendEmail.shemale tbbbuqwygqyobbga'-m "$body" [test@zabbix ~] $sudo chmod + x sendEmail.sh [test@zabbix ~] $sudo chown zabbix.zabbix sendEmail.sh

-f: sender's mailbox

-t: recipient mailbox

-u: theme

-o: option

-xu: user name

-xp: password

-m: message body

Note: QQ Mail needs to generate the authorization code under the settings and use the authorization code instead of the password to send the email successfully.

Configure the zabbix management page

Click manage-> alarm Media Type Click create Media Type on the far right

Note: after installing zabbix 3.0, you need to fill in these three parameters. 2.x is not required.

Click the Admin user to add an alarm medium

Select the sendEmail.sh script and enter the recipient's email address

Click on the user group, click on the call mode after zabbix administrator, click on it, and it is enabled.

Click Zabbix user Group-> permissions, and select add all.

Click configure-> Action Click default Action

Click configure-> Action-> Action to set the email delivery format

Alarm host: {HOSTNAME1}

Alarm time: {EVENT.DATE} {EVENT.TIME}

Alarm level: {TRIGGER.SEVERITY}

Alarm message: {TRIGGER.NAME}

Alarm item: {TRIGGER.KEY1}

Question details: {ITEM.NAME}: {ITEM.VALUE}

Current status: {TRIGGER.STATUS}: {ITEM.VALUE1}

Event ID: {EVENT.ID}

Click configure-> Action-> Action to set email delivery properties.

Note: the default step is 1-1, that is, from 1 to 1. Once the failure occurs, the sendEmail.sh script is executed to send an alarm email to the Admin user and the zabbix administrator group.

If the fault lasts for 1 hour, it will only be sent once. If you change it to 1-0, it means there is no limit. Infinite transmission

The interval is 60 seconds by default. Then 60 emails will be sent in an hour.

Test email alarm

Randomly add a host that does not exist, and the red status will be displayed after a few minutes

A few minutes later, I received an email indicating that the setting was successful.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report