Nagios Configuration check_traffic Module (Server side)

Source: Internet
Author: User

  1. Install packages
    Yum-y Install net-snmp*
    Chconfig Nrpe on
    Chconfig SNMPD on
    Chkconfig Nagios on
  2. Modify the SNMP parameters, vi/etc/snmp/snmpd.conf (can back up the snmpd.conf, modify the following localhost-ip as the server IP, save this file)
    com2sec notconfiguser localhost-ip publicgroup notconfiggroup v1 notconfigusergroup notConfigGroup v2c Notconfiguserview SystemView included.1.3.6.1.2.1.1view SystemView included.1.3.6.1.2.1.25.1.1Access Notconfiggroup""Any Noauth exact and none Noneview all included.1                                thesyslocation Unknown (Edit/etc/snmp/snmpd.conf) syscontact Root<[email protected]> (configure/etc/snmp/snmp.local.conf)
    snmpd.conf
  3. Copy check_traffic.sh to/usr/lib64/nagios/plugins/check_traffic.sh
    check_traffic.sh file GitHub:https://github.com/cloved/check_traffic/blob/master/check_traffic.sh
    wget Https://github.com/cloved/check_traffic/archive/master.zip

  4. Give execute permission and test:
    chmod +x check_traffic.sh
    ./check_traffic.sh-v 2c-c public-h your_ip-i 2-w 1200,1500-c 1700,1800-k–b
    ./check_traffic.sh-v 2c-c Public-h your_ip–l

  5. example:
    ./check_traffic.sh-v 2c-c public-h your_ip-n eth0-w 8,7-c 16,14-m-B
    -v SNMP version
    -c authentication information
    -h host IP
    -n network card
    -w 8,7   downstream/upstream traffic exceeding 8,7 Mbit/s warning
    -c 16,14 downlink/upstream traffic exceeds 16,14 Mbit/s critical
    -m MB
    -b bits

  6. Edit the/etc/nagios/objects/command.cfg file, append:

    ' check_traffic ' command definitiondefine command{        command_name    check_traffic        command_line    $USER 1$/check _traffic. sh -v 2c-c public-h $HOSTADDRESS $-I $ARG 1$-w $ARG 2$-C $ARG 3$-M-b        }
    Check _traffic Code
  7. Edit/etc/nagios/objects/localhost.cfg File

     define service{use local -service; Name of service template to use host_name localhost service_description Ch Eck_trafffic Check_command check_traffic ! 2 ! 12 , 15 !        20 ,  1   Normal_           Check_interval  5   Retry_interval  1  }  
    localhost.cfg

    and modify the IP address in the Localhost.cfg file (127.0.0.1) to the native IP!!!!!!! (Pit me for 2 days)

  8. Delete temporary files
    /var/tmp/check_traffic_${host}_${interface}.hist_dat file
  9. Restarting the Nagios service
  10. Refer to some of the links below:
    http://2860664.blog.51cto.com/2850664/1567068

Nagios Configuration check_traffic Module (Server side)

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.