Zabbix using SNMP to customize key

Source: Internet
Author: User
Tags snmp snmp oid snmpwalk

1, configuration/etc/snmp/snmpd.conf file to add the following configuration, configuration after restarting the SNMPD service takes effect

Extend. 1.3.6.1.4.1.2021.52 regnum39/etc/snmp/scripts/regnum.sh regnum39 extend. 1.3.6.1.4.1.2021.52 regnum40/etc/ snmp/scripts/regnum.sh regnum40 extend. 1.3.6.1.4.1.2021.52 totalregnum/etc/snmp/scripts/regnum.sh Totalregnum

Where. 1.3.6.1.4.1.2021.52 is a custom oid,regnum39 is the key name,/etc/snmp/scripts/regnum.sh is a custom script to get the numeric value, and the subsequent regnum39 is the regnum.sh parameter


2, Zabbix-server Use the following command to obtain the corresponding specific value

[[email protected] etc]# snmpwalk -v 2c -c public 10.84.10.166 . 1.3.6.1.4.1.2021.52  #10.84.10.166 for the host that modified the snmpd.conf file above Ipucd-snmp-mib::ucdavis.52.1.0 = integer:  3UCD-SNMP-MIB::ucdavis.52.2.1.2.8.114.101.103.110.117.109.51.57 = STRING:  "/etc/snmp/ scripts/regnum.sh "ucd-snmp-mib::ucdavis.52.2.1.2.8.114.101.103.110.117.109.52.48 = string: "/ Etc/snmp/scripts/regnum.sh "ucd-snmp-mib::ucdavis.52.2.1.2.11.116.111.116.97.108.114.101.103.110.117.109 =  STRING:  "/etc/snmp/scripts/regnum.sh" ucd-snmp-mib::ucdavis.52.2.1.3.8.114.101.103.110.117.109.51.57  = STRING:  "Regnum39" ucd-snmp-mib::ucdavis.52.2.1.3.8.114.101.103.110.117.109.52.48 =  STRING:  "REGNUM40" ucd-snmp-mib::ucdavis.52.2.1.3.11.116.111.116.97.108.114.101.103.110.117.109  = STRING:  "Totalregnum" ucd-snmp-mib::ucdavis.52.2.1.4.8.114.101.103.110.117.109.51.57 =   "" Ucd-snmp-mib::ucdavis.52.2.1.4.8.114.101.103.110.117.109.52.48 =  "" Ucd-snmp-mib:: ucdavis.52.2.1.4.11.116.111.116.97.108.114.101.103.110.117.109 =  "" UCD-SNMP-MIB:: Ucdavis.52.2.1.5.8.114.101.103.110.117.109.51.57 = integer: 5ucd-snmp-mib:: Ucdavis.52.2.1.5.8.114.101.103.110.117.109.52.48 = integer: 5ucd-snmp-mib:: Ucdavis.52.2.1.5.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 5ucd-snmp-mib:: Ucdavis.52.2.1.6.8.114.101.103.110.117.109.51.57 = integer: 1ucd-snmp-mib:: Ucdavis.52.2.1.6.8.114.101.103.110.117.109.52.48 = integer: 1ucd-snmp-mib:: Ucdavis.52.2.1.6.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 1ucd-snmp-mib:: Ucdavis.52.2.1.7.8.114.101.103.110.117.109.51.57 = integer: 1ucd-snmp-mib:: Ucdavis.52.2.1.7.8.114.101.103.110.117.109.52.48 = integer: 1ucd-snmp-mib:: ucdavis.52.2.1.7.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 1uCd-snmp-mib::ucdavis.52.2.1.20.8.114.101.103.110.117.109.51.57 = integer: 4ucd-snmp-mib:: Ucdavis.52.2.1.20.8.114.101.103.110.117.109.52.48 = integer: 4ucd-snmp-mib:: Ucdavis.52.2.1.20.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 4ucd-snmp-mib:: Ucdavis.52.2.1.21.8.114.101.103.110.117.109.51.57 = integer: 1ucd-snmp-mib:: Ucdavis.52.2.1.21.8.114.101.103.110.117.109.52.48 = integer: 1ucd-snmp-mib:: Ucdavis.52.2.1.21.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 1ucd-snmp-mib:: ucdavis.52.3.1.1.8.114.101.103.110.117.109.51.57 = string:  "664" UCD-SNMP-MIB:: ucdavis.52.3.1.1.8.114.101.103.110.117.109.52.48 = string:  "662" UCD-SNMP-MIB:: ucdavis.52.3.1.1.11.116.111.116.97.108.114.101.103.110.117.109 = string:  "1326" UCD-SNMP-MIB:: ucdavis.52.3.1.2.8.114.101.103.110.117.109.51.57 = string:  "664" UCD-SNMP-MIB:: Ucdavis.52.3.1.2.8.114.101.103.110.117.109.52.48 = string:  "662" Ucd-snmp-mib:: ucdavis.52.3.1.2.11.116.111.116.97.108.114.101.103.110.117.109 = string:  "1326" UCD-SNMP-MIB:: Ucdavis.52.3.1.3.8.114.101.103.110.117.109.51.57 = integer: 1ucd-snmp-mib:: Ucdavis.52.3.1.3.8.114.101.103.110.117.109.52.48 = integer: 1ucd-snmp-mib:: Ucdavis.52.3.1.3.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 1ucd-snmp-mib:: Ucdavis.52.3.1.4.8.114.101.103.110.117.109.51.57 = integer: 0ucd-snmp-mib:: Ucdavis.52.3.1.4.8.114.101.103.110.117.109.52.48 = integer: 0ucd-snmp-mib:: Ucdavis.52.3.1.4.11.116.111.116.97.108.114.101.103.110.117.109 = integer: 0ucd-snmp-mib:: ucdavis.52.4.1.2.8.114.101.103.110.117.109.51.57.1 = string:  "664"  # REGNUM39 output value ucd-snmp-mib::ucdavis.52.4.1.2.8.114.101.103.110.117.109.52.48.1 = string:  "662"   #regnum40输出的值UCD-snmp-mib::ucdavis.52.4.1.2.11.116.111.116.97.108.114.101.103.110.117.109.1 = string:  "1326"   #totalregnum输出的值 


3. Add item to Zabbix web interface

Note The SNMP OID gets the second half of the Oid+snmpwalk in the snmpd.conf configuration file

For example

Regnum39 The SNMP OID for this key is. 1.3.6.1.4.1.2021.52.4.1.2.8.114.101.103.110.117.109.51.57.1

REGNUM40 The SNMP OID for this key is. 1.3.6.1.4.1.2021.52.4.1.2.8.114.101.103.110.117.109.52.48.1

Totalregnum The SNMP OID for this key is. 1.3.6.1.4.1.2021.52.4.1.2.11.116.111.116.97.108.114.101.103.110.117.109.1

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/8B/BE/wKioL1hXmVayoMXxAABs-oeBhGU953.png-wh_500x0-wm_3 -wmp_4-s_1729161096.png "title=" Image.png "alt=" Wkiol1hxmvayomxxaabs-oebhgu953.png-wh_50 "/>


650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" background:transparent url ("/e/u261/ Lang/zh-cn/images/localimage.png ") no-repeat scroll center;border:1px solid rgb (221,221,221);" alt= "Spacer.gif"/>

Zabbix using SNMP to customize key

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.