The purpose of setting the trigger is to let the monitoring service implement the alarm, how to implement the alarm, the following to configure the message alarm. E-mail is sent by the server through its own SendMail service, sometimes if the configuration is not appropriate or the service does not start, we are not outgoing mail.
Installing SendMail
[[email protected] ~]# yum install -y Mailx sendmail[[email protected] ~]# /etc/init.d/sendmail start is starting sendmail: [OK] Start sm-client: [Determine][[email protected] ~]# echo "Test mail" |mail -s "Testtest" 101****[email Protected]
Check mailbox, received mail
If it is a virtual machine, it is possible to receive the mail, but if the real machine can still be received, but it is likely in the spam mailbox.
Configure the Zabbix message alert.
[[email protected] ~]# mkdir-p/home/zabbix/bin[[email protected] ~]# Vim/home/zabbix/bin/baojing.sh#!/bin/bashecho "$ 3 "|/bin/mail-s" $1[[email protected] ~]# chmod +x/home/zabbix/bin/baojing.sh
In the/etc/zabbix_server.conf configuration file, there are parameters Alertscriptspath and externalscripts, edit it
[Email protected] ~]# vim/etc/zabbix_server.confalertscriptspath=/home/zabbix/bin/#用户自定义的 Media Types Script External scripts=/home/zabbix/bin/#用户自定义的检查的脚本 (item)
Continue configuring in the Web
(1) Create Media types: Click Administration, media types, click Create Media Type in the upper right corner, where Description fill in the custom name (in this case, baojing), Type Select Select Script,script to fill in the baojing.sh, then click Save.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/83/B0/wKioL1d6an2iSe9-AAHy3XCcUWg904.png "style=" float: none; "title=" 3.3-1.png "alt=" Wkiol1d6an2ise9-aahy3xccuwg904.png "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/B0/wKioL1d6an7weE0KAAFndSDKF_M522.png "style=" float: none; "title=" 3.3-2.png "alt=" Wkiol1d6an7wee0kaafndsdkf_m522.png "/>
(2) Create user:administration. Users, select users in the upper right corner, click Create User,alias:test1, customize name and surname, Password;group select Guest, Go back to the top. Media,type Select Baojing,send to write the mailbox to send, click Add, Last click Save.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/B1/wKiom1d6an_i2G6vAAIbj_jVykY597.png "style=" float: none; "title=" 3.3-3.png "alt=" Wkiom1d6an_i2g6vaaibj_jvyky597.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/83/B0/wKioL1d6aoCjlxNEAAFuUaRlWGY757.png "style=" float: none; "title=" 3.3-4.png "alt=" Wkiol1d6aocjlxneaafuuarlwgy757.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/83/B1/wKiom1d6aoLjbhJ5AANRaiYoy5g849.png "style=" float: none; "title=" 3.3-5.png "alt=" Wkiom1d6aoljbhj5aanraiyoy5g849.png "/>
(3) Create action:configuration. Actions, upper right corner create Actions,name custom, other default, then click the New button under operations on the right, operation Type Select Send Message,send message to select one or more user groups to send the message, send to users select our previously added test1,send only to select Baojing, click Add, Last click Save.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/83/B1/wKiom1d6aoOCSRk3AAHBFCzyqfE819.png "style=" float: none; "title=" 3.3-6.png "alt=" Wkiom1d6aoocsrk3aahbfczyqfe819.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/83/B0/wKioL1d6aoTTxmj3AAIEGq8FENk888.png "style=" float: none; "title=" 3.3-7.png "alt=" Wkiol1d6aottxmj3aaiegq8fenk888.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/83/B1/wKiom1d6aoWwfoBHAAHtNT4QHXY595.png "style=" float: none; "title=" 3.3-8.png "alt=" Wkiom1d6aowwfobhaahtnt4qhxy595.png "/>
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/83/B0/wKioL1d6aoaDLCH3AACoKZfNW2s866.png "style=" float: none; "title=" 3.3-9.png "alt=" Wkiol1d6aoadlch3aacokzfnw2s866.png "/>
This article is from the "Learn Notes for students" blog, please make sure to keep this source http://sanyisheng.blog.51cto.com/11154168/1795738
3.3 Zabbix Configuring message Alarms