Build Zabbix mail alarm under Linux

Source: Internet
Author: User
Tags email account

First, the introduction of environmental construction


Hostname Ip Zabbix version System version
Service side Webserver 192.168.1.20 zabbix2.2 CentOS 6.6
Client Hpf-linux 192.168.1.110 zabbix2.2 CentOS 6.6



Second, use the external email account to send alarm mail settings:

1. Close SendMail or Postfix

When using an external mailbox account, you do not need to start sendmail or postfix, and if you use an external mailbox to send alert messages at SendMail or Postfix startup, the external mailbox configuration information will be read first.

[[email protected] ~]#/etc/init.d/sendmail Stop

[[email protected] ~]#/etc/init.d/postfix Stop


2. Install test Mail Sending tool MAILX

[ [email protected]  ~]#   yum install mailx 

[ [email protected]  ~]#  vi/etc/mail.rc  // at the end of the file, add the following

Set from=[email protected]  smtp=smtp.163.com

set  smtp-auth-user=XXXX@163.com  smtp-auth-password=***********

set smtp-auth=login

[email protected] ~]# echo "Zabbix test Mail" |mail-s "Zabbix" [email protected ]


650) this.width=650; "title=" 1.png "alt=" wkiom1wjzpcboqtmaaejrcaijyc313.jpg "src=" http://s3.51cto.com/wyfs02/M00/ 6e/d8/wkiom1wjzpcboqtmaaejrcaijyc313.jpg "/>


XXXX@163.com mailbox for Zabbix send mail to use the mailbox, in order to use this mailbox must open the SMTP service of this mailbox;

[email protected] e-mail inbox, that is, the service side of the alarm to send the alarm information to the operator information;


3, the browser configuration Zabbix server-side mail alarm:

Create a warning medium type: Management-Warning media type-Create media type


650) this.width=650; "title=" 2.png "alt=" wkiom1wjzw7sulitaarrb_fzuja003.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 6e/d8/wkiom1wjzw7sulitaarrb_fzuja003.jpg "/>


Create the name of the script:


650) this.width=650; "title=" 3.png "alt=" wkiol1wjaklc1udsaank8cgq6c0387.jpg "src=" http://s3.51cto.com/wyfs02/M00/ 6e/d5/wkiol1wjaklc1udsaank8cgq6c0387.jpg "/>


Set Zabbix user Alarm email Address:

Configuration-User-admin (Zabbix Administrator)


650) this.width=650; "title=" 4.png "alt=" wkiom1wjaldwoproaarsj1vhiqo846.jpg "src=" http://s3.51cto.com/wyfs02/M01/ 6e/d8/wkiom1wjaldwoproaarsj1vhiqo846.jpg "/>

650) this.width=650; "title=" 5.png "alt=" wkiol1wjaqhz9kl2aapafblvq_g069.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 6e/d5/wkiol1wjaqhz9kl2aapafblvq_g069.jpg "/>


650) this.width=650; "title=" 6.png "style=" Float:none; "alt=" wkiom1wjauadt0nhaae1z9eugbw765.jpg "src=" http:/ S3.51cto.com/wyfs02/m02/6e/d8/wkiom1wjauadt0nhaae1z9eugbw765.jpg "/>


Set Zabbix action to trigger an alarm: configuration-action-Create action


650) this.width=650; "title=" 7.png "style=" Float:none; "alt=" wkiol1wjawdhfceyaauk5gb_kpo964.jpg "src=" http:/ S3.51cto.com/wyfs02/m01/6e/d5/wkiol1wjawdhfceyaauk5gb_kpo964.jpg "/>

650) this.width=650; "title=" 8.png "style=" Float:none; "alt=" wkiom1wjaufwfntnaaskduyhyai711.jpg "src=" http:/ S3.51cto.com/wyfs02/m01/6e/d8/wkiom1wjaufwfntnaaskduyhyai711.jpg "/>


4, the service side configuration Zabbix Monitoring services:

Add Zabbix server-side mail Send script:

[[email protected] ~]# vi/etc/zabbix_server.conf//Find Alertscriptspath to change it as follows

alertscriptspath=/usr/share/zabbix/bin///If the Yum installed Zabbix does not have a bin directory, it needs to be created manually

[email protected] ~]# vi/usr/share/zabbix/bin/sendmail.sh

#!/bin/sh

echo "$ $" | Mail-s "$" $


[email protected] ~]# chmod a+x /usr/share/zabbix/bin/sendmail.sh

[email protected] ~]# chown Zabbix:zabbix /usr/share/zabbix/bin/sendmail.sh

5, Test Zabbix alarm:

[[email protected] ~]#/etc/init.d/zabbix-agent stop
Shutting down Zabbix agent: [OK]
[[email protected] ~]# Date
Wednesday, June 24, 2015 01:02:35 CST


Wait a minute. An error warning will appear on the browser monitor:

650) this.width=650; "title=" 9.png "style=" Float:none; "alt=" wkiol1wjawdbrkjqaaimgq4qxkq914.jpg "src=" http:/ S3.51cto.com/wyfs02/m00/6e/d5/wkiol1wjawdbrkjqaaimgq4qxkq914.jpg "/>


Wait a minute. The message will be received:


650) this.width=650; "title=" 10.png "style=" Float:none; "alt=" wkiol1wjawgaeizpaakh4qhxk_o916.jpg "src=" http:/ S3.51cto.com/wyfs02/m02/6e/d5/wkiol1wjawgaeizpaakh4qhxk_o916.jpg "/>

650) this.width=650; "title=" 11.png "style=" Float:none; "alt=" wkiom1wjauidguefaakkpj0iooo514.jpg "src=" http:/ S3.51cto.com/wyfs02/m00/6e/d8/wkiom1wjauidguefaakkpj0iooo514.jpg "/>




This article is from the "Bread" blog, make sure to keep this source http://9950284.blog.51cto.com/9940284/1664781

Build Zabbix mail alarm under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.