In addition to having system-default monitoring items, SNMP provides a powerful feature to customize monitoring items.
The EXEC option in the snmpd.conf configuration file (in the higher version of SNMP, extend instead of exec) provides a custom monitoring feature that can add commands or script execution results to SNMP queries.
The format is:
extend |
oid |
identifier |
command or script |
|
Extend |
.1.3.6.1.4.1.2021.45 |
Dhcp1 |
/home/scripts/dhcp.sh |
Alive_status |
Explain:
Extend |
Extended feature options available with snmpd.conf |
Oid |
This OID is custom, usually using the idle oid (. 1.3.6.1.4.1.2021.xx), or it can overwrite the OID already defined |
Identifier |
Identifiers to differentiate between different extension items
|
command or Script |
The execution result of the command or script, added to the SNMP query (similar to the given, var=123) |
Key value |
Custom key value, the key value to be filled in when adding SNMP monitoring entries in Zabbix is this |
After customizing in snmpd.conf, restart the SNMP service for it to take effect.
You can obtain the results of the SNMP query for the custom extension by using the following command query on another server, proving that it is valid:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9A/C1/wKioL1laF_DTUQt1AACu3wxveA0102.png "title=" Pictures _ 20170703175918.png "style=" float:left;width:720px;height:188px; "width=" 720 "height=" 188 "border=" 0 "hspace=" 0 " Vspace= "0" alt= "wkiol1laf_dtuqt1aacu3wxvea0102.png"/>
This article is from the "12400094" blog, please be sure to keep this source http://12410094.blog.51cto.com/12400094/1944160
extend--custom monitoring of SNMP under Linux