Use the SNMP Agent Check to:
To use the SNMP checks, edit the snmp.yaml file in your conf.d directory as follows:
init_config: #You can specify an additional folder for your custom mib files (python format) mibs_folder: /path/to/your/mibs/folder instances: # SNMP v1-v2 configuration - ip_address: localhost port: 161 community_string: public snmp_version: 2 # Only required for snmp v1, will default to 2 timeout: 1 # second, by default retries: 5 enforce_mib_constraints: true # if set to false we will not check the values # returned meet the MIB constraints. Defaults to True. tags: - location:front metrics: - MIB: UDP-MIB symbol: udpInDatagrams - MIB: TCP-MIB symbol: tcpActiveOpens - OID: 18.104.22.168.22.214.171.124 name: tcpPassiveOpens
For each device that you want to monitor, you need to specify at least an ip_address and an authentication method. If not specified, a default port of 161 will be assumed.
For more details about configuring this integration refer to the following file(s) on GitHub:
Our agent allows you to monitor the SNMP Counters and Gauge of your choice. Specify for each device the metrics that you want to monitor in the
metrics subsection using one of the following methods:
metrics: - MIB: UDP-MIB symbol: udpInDatagrams
metrics: - OID: 126.96.36.199.188.8.131.52 name: tcpActiveOpens
The name here is the one specified in the MIB but you could use any name.
metrics: - MIB: IF-MIB table: ifTable symbols: - ifInOctets metric_tags: - tag: interface column: ifDescr
This allows you to gather information on all the table’s row, as well as to specify tags to gather.
symbols list to specify the metric to gather and the
metric_tags list to specify the name of the tags and the source to use.
In this example the agent would gather the rate of octets received on each interface and tag it with the interface name (found in the ifDescr column), resulting in a tag such as
metrics: - MIB: IP-MIB table: ipSystemStatsTable symbols: - ipSystemStatsInReceives metric_tags: - tag: ipversion index: 1
You can also gather tags based on the indices of your row, in case they are meaningful. In this example, the first row index contains the ip version that the row describes (ipv4 vs. ipv6)
To use your own MIB with the stackstate-agent, you need to convert them to the pysnmp format. This can be done using the
build-pysnmp-mibs script that ships with pysnmp.
It has a dependency on
smidump, from the libsmi2ldbl package so make sure it is installed. Make also sure that you have all the dependencies of your MIB in your mib folder or it won’t be able to convert your MIB correctly.
$ build-pysnmp-mibs -o YOUR-MIB.py YOUR-MIB.mib
where YOUR-MIB.mib is the MIB you want to convert.
Put all your pysnmp mibs into a folder and specify this folder’s path in
snmp.yaml file, in the