• zabbix自定义SNMP监控项


      1、snmp配置自定义OID

    /etc/snmp/snmpd.conf

    com2sec notConfigUser  default      public
    group   notConfigGroup v1           notConfigUser
    group   notConfigGroup v2c          notConfigUser
    view    systemview    included   .1
    access  notConfigGroup ""      any       noauth    exact  systemview none none
    syslocation Unknown (edit /etc/snmp/snmpd.conf)
    syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
    dontLogTCPWrappersConnects yes
    extend .1.3.6.1.4.1.2021.50  zabbix_agent /bin/bash /root/zabbix_check.sh
    extend .1.3.6.1.4.1.2021.51  hadoop_QuorumPeerMain_check /bin/bash /root/hadoop_QuorumPeerMain_check.sh

    添加OID内容:

    extend .1.3.6.1.4.1.2021.50  zabbix_agent /root/zabbix_check.sh
    extend:扩展OID
    .1.3.6.1.4.1.2021.50:.1.3.6.1.4.1.2021不可变,表示用户自定义OID前缀,50用户自定义

    zabbix_agent:标示、名称。用于区分不同扩展项目

    /bin/bash /root/zabbix_check.sh:运行脚本,脚本的绝对路径
    2、zabbix_check.sh内容
    #!/bin/bash
    echo `netstat -tnlp|grep -v tcp6|grep zabbix_agent|wc -l`

    2、zabbix服务端查看

    snmpwalk -v 2c -c public 192.168.8.47 .1.3.6.1.4.1.2021.50

    内容如下:
    UCD-SNMP-MIB::ucdavis.50.1.0 = INTEGER: 1
    UCD-SNMP-MIB::ucdavis.50.2.1.2.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = STRING: "/bin/bash"
    UCD-SNMP-MIB::ucdavis.50.2.1.3.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = STRING: "/home/monitor/zabbix/app_connection_db.sh"
    UCD-SNMP-MIB::ucdavis.50.2.1.4.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = ""
    UCD-SNMP-MIB::ucdavis.50.2.1.5.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 5
    UCD-SNMP-MIB::ucdavis.50.2.1.6.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 1
    UCD-SNMP-MIB::ucdavis.50.2.1.7.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 1
    UCD-SNMP-MIB::ucdavis.50.2.1.20.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 4
    UCD-SNMP-MIB::ucdavis.50.2.1.21.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 1
    UCD-SNMP-MIB::ucdavis.50.3.1.1.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = STRING: "600"
    UCD-SNMP-MIB::ucdavis.50.3.1.2.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = STRING: "600"
    UCD-SNMP-MIB::ucdavis.50.3.1.3.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 1
    UCD-SNMP-MIB::ucdavis.50.3.1.4.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98 = INTEGER: 0
    UCD-SNMP-MIB::ucdavis.50.4.1.2.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98.1 = STRING: "600"

    完整UUID:

    ucdavis.50.3.1.2.17.97.112.112.95.99.111.110.110.101.99.116.105.111.110.95.100.98
  • 相关阅读:
    Ionic app 通知在Moto 360 Watch上显示通知(2)
    Ionic app 通知在Moto 360 Watch上显示通知(1)
    Ionic App ActionSheet布局问题
    Ionic 图片延时加载
    Ionic app 上传图片之webApi接口
    Ionic app升级插件开发
    Ionic 添加java原生代码 报support.v4不存在问题
    Ionic 中badge的应用
    Java 期末复习提纲
    win10 + VS2015 + EF6 + MySQL
  • 原文地址:https://www.cnblogs.com/xue0123/p/9673309.html
Copyright © 2020-2023  润新知