Custom monitoring (Web alarm, mail alarm)

Source: Internet
Author: User

Note: Zabbix installation configuration refer to another article


1.Zabbix Client Configuration

[Email protected] ~]# cat/tmp/user.sh

#!/bin/bash

Uptime |awk ' {print $4} '

[Email protected] ~]# vim/etc/zabbix/zabbix_agentd.conf

userparameter= Login-user, /bin/bash/tmp/user.sh ( can be with the script, can follow the command , here the login-uesr is the key value, you can name it, do not and already have Key conflict )

2.Zabbix Service-side testing

[email protected] ~]# Yum install-y zabbix-get

[Email protected] ~]# zabbix_get-s 192.168.10.128-k login-user

2


3. Create Items (monitored items)

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/02/wKiom1mJ3RmRlZeqAACd75t3Kf0633.png "style=" float : none; "title=" Image 1.png "alt=" Wkiom1mj3rmrlzeqaacd75t3kf0633.png "/>


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9E/02/wKioL1mJ3RqyQ8Q3AAFOS4uK2U8734.png "style=" float : none; "title=" Image 2.png "alt=" Wkiol1mj3rqyq8q3aafos4uk2u8734.png "/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/02/wKioL1mJ3RuTF_uyAACvm6mmSTY443.png "style=" float : none; "title=" Image 3.png "alt=" Wkiol1mj3rutf_uyaacvm6mmsty443.png "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9E/02/wKiom1mJ3Rzg499kAABPUkmJpiI462.png "style=" float : none; "title=" Image 4.png "alt=" Wkiom1mj3rzg499kaabpukmjpii462.png "/>



4. Create Graphs

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9E/03/wKiom1mJ3o-gcIPLAACbi07colI283.png "style=" float : none; "title=" Image 1.png "alt=" Wkiom1mj3o-gciplaacbi07coli283.png "/>


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9E/02/wKioL1mJ3pDxnm0yAADCVkLKyz4386.png "style=" float : none; "title=" Image 2.png "alt=" Wkiol1mj3pdxnm0yaadcvklkyz4386.png "/>


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9E/03/wKiom1mJ3pCyXXeoAABCC2I4sbU811.png "style=" float : none; "title=" Image 3.png "alt=" Wkiom1mj3pcyxxeoaabcc2i4sbu811.png "/>


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/03/wKiom1mJ3pGQJvbRAAB75IU9-gw484.png "style=" float : none; "title=" Image 4.png "alt=" Wkiom1mj3pgqjvbraab75iu9-gw484.png "/>


5. CREATE trigger triggers (web alarm)

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/9E/02/wKioL1mJ3zDTql-TAADaUGv4pYs726.png "style=" float : none; "title=" Image 5.png "alt=" Wkiol1mj3zdtql-taadaugv4pys726.png "/>


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9E/02/wKioL1mJ3zGQCjpLAAGjxdvW6TE531.png "style=" float : none; "title=" Image 6.png "alt=" Wkiol1mj3zgqcjplaagjxdvw6te531.png "/>


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9E/03/wKiom1mJ3zGiaZRKAABRXsSO12s105.png "style=" float : none; "title=" Image 7.png "alt=" Wkiom1mj3zgiazrkaabrxsso12s105.png "/>


650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9E/02/wKioL1mJ3zKAWbFMAAAyneyzDm8959.png "style=" float : none; "title=" Image 8.png "alt=" Wkiol1mj3zkawbfmaaayneyzdm8959.png "/>



6. Email Alert settings:action


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9E/03/wKiom1mJ37GSr9LpAACktyJ46dE980.png "style=" float : none; "title=" Image 9.png "alt=" Wkiom1mj37gsr9lpaacktyj46de980.png "/>


650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9E/03/wKiom1mJ37Gj9oLSAACXHJxCX_o811.png "style=" float : none; "title=" Image 10.png "alt=" Wkiom1mj37gj9olsaacxhjxcx_o811.png "/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/02/wKioL1mJ37LjqsO-AAB9o_jZPSc493.png "style=" float : none; "title=" Image 11.png "alt=" Wkiol1mj37ljqso-aab9o_jzpsc493.png "/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9E/03/wKiom1mJ37PwVcN7AAB_jbUqdgM767.png "style=" float : none; "title=" Image 12.png "alt=" Wkiom1mj37pwvcn7aab_jbuqdgm767.png "/>


650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9E/02/wKioL1mJ37OAvyihAABxnflb3v4783.png "style=" float : none; "title=" Image 13.png "alt=" Wkiol1mj37oavyihaabxnflb3v4783.png "/>



Set up a script to send messages

Set the alert script path

[Email protected] ~]# vim/etc/zabbix/zabbix_server.conf

Alertscriptspath=/usr/lib/zabbix/alertscripts

[Email protected] ~]# cd/usr/lib/zabbix/alertscripts

[[email protected] alertscripts]# cat sendmail.sh actually here should write the Send mail script, here into the test

echo "$ $" >>/tmp/test If /tmp/test appears, the message is sent successfully .



650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/03/wKiom1mJ4HSgF9uJAAC0Nnd4T7Q789.png "style=" float : none; "title=" Image 14.png "alt=" Wkiom1mj4hsgf9ujaac0nnd4t7q789.png "/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9E/03/wKioL1mJ4HXwYi-1AABsMuB1YAA598.png "style=" float : none; "title=" Image 15.png "alt=" Wkiol1mj4hxwyi-1aabsmub1yaa598.png "/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9E/03/wKiom1mJ4HWQSMu-AADV49ktMn8416.png "style=" float : none; "title=" Image 16.png "alt=" Wkiom1mj4hwqsmu-aadv49ktmn8416.png "/>


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9E/03/wKioL1mJ4HbQwbzcAABHyvHYZ5g680.png "style=" float : none; "title=" Image 17.png "alt=" Wkiol1mj4hbqwbzcaabhyvhyz5g680.png "/>


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/03/wKioL1mJ4HbQTcSRAABuJ3d0w0c969.png "style=" float : none; "title=" Image 18.png "alt=" Wkiol1mj4hbqtcsraabuj3d0w0c969.png "/>


650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/03/wKiom1mJ4IehRhopAAA1cqdJr3M918.png "style=" float : none; "title=" Image 19.png "alt=" Wkiom1mj4iehrhopaaa1cqdjr3m918.png "/>


650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/03/wKioL1mJ4Iiy-iiQAABscwHErps244.png "style=" float : none; "title=" Image 20.png "alt=" Wkiol1mj4iiy-iiqaabscwherps244.png "/>


Sent successfully

[Email protected] alertscripts]# cat/tmp/test

Original event id:400*:* unknown*): *unknown* loginuser>2



This article is from the "Feng" blog, make sure to keep this source http://fengxiaoli.blog.51cto.com/12104465/1954658

Custom monitoring (Web alarm, mail alarm)

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.