2018-4-16 Linux Learning Notes

Source: Internet
Author: User

19.12 Adding custom monitoring items
  • Ideas:
    Client provisioning scripts Get data--server-side monitoring data collected with Zabbix_get Authentication Client->zabbix Management Interface Configuration Monitoring Entry->zabbix management interface configuration to graphical->zabbix management interface Configuration alarm (if required)

  • requirements: Monitor the number of 80-port connections for a web and plot.

  • The implementation is divided into two steps:
  • (1) Zabbix Monitoring Center to create a monitoring project
  • For the first step, you need to define the script to the client:
    vim/usr/local/sbin/estab.sh
  • Add the following:
    ------------------------------------------------------------------
    #!/bin/bash
    #获取80端口并发连接数
    Netstat-ant |grep ': |grep-c established
    ------------------------------------------------------------------
  • Let the user have permission to execute the script
    chmod 755/usr/local/sbin/estab.sh

  • Edit the configuration file on the client
    vim/etc/zabbix/zabbix_agentd.conf//Increase
    Unsafeuserparameters=1//means using a custom script
    userparameter=my.estab.count[*],/usr/local/sbin/estab.sh
  • Note: The above 1 sentence of the custom monitoring key is My.estab.count, the following [*] inside the script parameters, if no parameters can be omitted, the script is/usr/local/sbin/estab.sh
  • Restart Zabbix-agent Service
    Systemctl Restart Zabbix-agent

  • (2) Graphic display for the monitoring project
  • First to the server authentication, execute the command:
    Zabbix_get-s 192.168.168.130-p 10050-k ' My.estab.count '
  • Then add monitoring items in the Zabbix Monitoring Center (browser) configuration:
    Create a monitoring entry, configuration--host---(CENTOS_02) Monitoring item
    Key-Value Write My.estab.countP2
  • After you add the item, go to "monitoring", "latest data" to see if the item you just added has data. You can add graphics with the data:
    Create a drawing, centos_02, configuration, host-
  • Create a trigger to alert:
    Create trigger with host--, centos_02 Trigger


Set the alarm when the number of connections >200

19.13/19.14 Configuring the message Alarm 19.15 Test alarm 19.16 Non-email problem handling

2018-4-16 Linux Learning Notes

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.