Zabbix Mail Alarm--sendmail

Source: Internet
Author: User
Tags email account

With a few mail alarm software, feeling or sendmail timely, stable.

One, Zabbix server server configuration:

1.1 Path to send mail script:

123 [[email protected]_server etc]# cat zabbix_server.conf | grep alertscripts # AlertScriptsPath=${datadir}/zabbix/alertscripts AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts


1.2 sendmail software Download installation:

I am using SendEmail, if your system comes with mail can be sent to send a successful e-mail, you can refer to my other article, centos5.x & centos6.x using the Mail command to send e-mail and how to forge the sender:/http pynliu.blog.51cto.com/5027391/1608916.


SendEmail; http://caspian.dotconf.net/menu/Software/SendEmail/#download

Unzip and put it in any directory, I put it in the/usr/local/zabbix/share/zabbix/alertscripts directory

12 [[email protected]_server alertscripts]# lssendEmail-v1.56


1.3 Zabbix Alarm message will be transmitted over three variables, all in the Zabbix_web interface configuration. are: Recipient mail, alarm subject and alarm content, and $ $ $ in script

Write script SendMail and give executable permission

12345678 [[email protected]_server alertscripts]# chmod a+x sendmail.sh [[email protected]_server alertscripts]# cat sendmail.sh #!/bin/bash# $1 sendmail address# $2 sendmail subject# $3 contentSENDMAIL=/usr/local/zabbix/share/zabbix/alertscripts/sendEmail-v1.56/sendEmail$SENDMAIL -f [email protected] -t "$1"-s xxx.benguo.cn -u "$2"-m "$3">> /dev/null

Note: [email protected] is the sender's mailbox, is a forged sender, can be defined as long as it is not recognized as a spam mailbox on the line.

Explanation:
-F means the sender's mailbox
-T indicates the recipient's mailbox
(email and email, try not to use the same email account, error-prone)
-S indicates the domain name or IP of the SMTP server
-U represents the subject of the message
-xu represents the user name for SMTP authentication
-XP represents the password for SMTP authentication (note that this password seems to be limited, for example, I cannot be correctly identified with D!5neyland)
-M indicates the contents of the message


Second, the following is the configuration on the Zabbix Web:

2.1 Configure the "Warning media type" to create the media type:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/19/wKioL1THdtiChJcAAAKQm_YBqBQ934.jpg "title=" Qq20150127192524.jpg "style=" width:725px;height:165px; "alt=" Wkiol1thdtichjcaaakqm_ybqbq934.jpg "height=" 165 " Hspace= "0" border= "0" vspace= "0" width= "650"/>

Note that the script name should be the same as the one written on the server.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/1C/wKiom1THdlDyzYdoAAGkvJtbYLQ026.jpg "title=" Qq20150127192800.jpg "style=" width:725px;height:265px; "alt=" Wkiom1thdldyzydoaagkvjtbylq026.jpg "height=" 265 " Hspace= "0" border= "0" vspace= "0" width= "650"/>


2.2 User settings:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/19/wKioL1THeH2RaheFAAN9D6L2yIY808.jpg "style=" width : 725px;height:366px; "title=" qq20150127193204.jpg "alt=" wkiol1theh2rahefaan9d6l2yiy808.jpg "height=" 366 "hspace=" 0 "border=" 0 "vspace=" 0 "width=" 650 "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/1C/wKiom1THd5_xsxAvAAMbTbpzs0w425.jpg "style=" width : 725px;height:474px; "title=" qq20150127193335.jpg "alt=" wkiom1thd5_xsxavaambtbpzs0w425.jpg "height=" 474 "hspace=" 0 "border=" 0 "vspace=" 0 "width=" 650 "/>

The degree of warning is the severity of the trigger.


Third, create the action

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/19/wKioL1THeZejzaCZAALsh4TK_Cc150.jpg "title=" Qq20150127193820.jpg "style=" width:725px;height:350px; "alt=" wkiol1thezejzaczaalsh4tk_cc150.jpg "height=" 350 " Hspace= "0" border= "0" vspace= "0" width= "650"/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/19/wKioL1THehShjnJtAAKh-qXN22c190.jpg "style=" width : 725px;height:507px; "title=" qq20150127193912.jpg "alt=" wkiol1thehshjnjtaakh-qxn22c190.jpg "height=" 507 "hspace=" 0 "border=" 0 "vspace=" 0 "width=" 650 "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/1C/wKiom1THeTXj21BrAAKxqrmgv9s114.jpg "style=" width : 725px;height:350px; "title=" qq20150127193928.jpg "alt=" wkiom1thetxj21braakxqrmgv9s114.jpg "height=" "hspace=" 0 "border=" 0 "vspace=" 0 "width=" 650 "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/59/19/wKioL1THehTxONtGAALnEKzVI6A123.jpg "style=" width : 725px;height:352px; "title=" qq20150127194022.jpg "alt=" wkiol1thehtxontgaalnekzvi6a123.jpg "height=" 352 "hspace=" 0 "border=" 0 "vspace=" 0 "width=" 650 "/>


Four, add complete, will follow the trigger to implement the alarm

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/59/1C/wKiom1THecWAMyhlAAFJ_GAFHO0846.jpg "title=" Qq20150127194230.jpg "alt=" Wkiom1thecwamyhlaafj_gafho0846.jpg "/>


This article is from the It Dick thread blog, so be sure to keep this source http://68686789.blog.51cto.com/10438688/1693678

Zabbix Mail Alarm--sendmail

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.