Giter VIP home page Giter VIP logo

snmp_exporter's Introduction

Prometheus SNMP Exporter

This exporter is the recommended way to expose SNMP data in a format which Prometheus can ingest.

To simply get started, it's recommended to use the if_mib module with switches, access points, or routers using the public_v2 auth module, which should be a read-only access community on the target device.

Note, community strings in SNMP are not considered secrets, as they are sent unencrypted in SNMP v1 and v2c. For secure access, SNMP v3 is required.

Concepts

While SNMP uses a hierarchical data structure and Prometheus uses an n-dimnensional matrix, the two systems map perfectly, and without the need to walk through data by hand. snmp_exporter maps the data for you.

Prometheus

Prometheus is able to map SNMP index instances to labels. For example, the ifEntry specifies an INDEX of ifIndex. This becomes the ifIndex label in Prometheus.

If an SNMP entry has multiple index values, each value is mapped to a separate Prometheus label.

SNMP

SNMP is structured in OID trees, described by MIBs. OID subtrees have the same order across different locations in the tree. The order under 1.3.6.1.2.1.2.2.1.1 (ifIndex) is the same as in 1.3.6.1.2.1.2.2.1.2 (ifDescr), 1.3.6.1.2.1.31.1.1.1.10 (ifHCOutOctets), etc. The numbers are OIDs, the names in parentheses are the names from a MIB, in this case IF-MIB.

Mapping

Given a device with an interface at number 2, a partial snmpwalk return looks like:

1.3.6.1.2.1.2.2.1.1.2 = INTEGER: 2         # ifIndex for '2' is literally just '2'
1.3.6.1.2.1.2.2.1.2.2 = STRING: "eth0"     # ifDescr
1.3.6.1.2.1.31.1.1.1.1 = STRING: "eth0"    # IfName
1.3.6.1.2.1.31.1.1.1.10.2 = INTEGER: 1000  # ifHCOutOctets, 1000 bytes
1.3.6.1.2.1.31.1.1.1.18.2 = STRING: ""     # ifAlias

snmp_exporter combines all of this data into:

ifHCOutOctets{ifAlias="",ifDescr="eth0",ifIndex="2",ifName="eth0"} 1000

Scaling

A single instance of snmp_exporter can be run for thousands of devices.

Usage

Installation

Binaries can be downloaded from the Github releases page and need no special installation.

We also provide a sample systemd unit file.

Running

Start snmp_exporter as a daemon or from CLI:

./snmp_exporter

Visit http://localhost:9116/snmp?target=192.0.0.8 where 192.0.0.8 is the IP or FQDN of the SNMP device to get metrics from. Note that this will use the default transport (udp), default port (161), default auth (public_v2) and default module (if_mib). The auth and module must be defined in the snmp.yml file.

For example, if you have an auth named my_secure_v3 for walking ddwrt, the URL would look like http://localhost:9116/snmp?auth=my_secure_v3&module=ddwrt&target=192.0.0.8.

To configure a different transport and/or port, use the syntax [transport://]host[:port].

For example, to scrape a device using tcp on port 1161, the URL would look like http://localhost:9116/snmp?auth=my_secure_v3&module=ddwrt&target=tcp%3A%2F%2F192.0.0.8%3A1161.

Note that URL encoding should be used for target due to the : and / characters. Prometheus encodes query parameters automatically and manual encoding is not necessary within the Prometheus configuration file.

Metrics concerning the operation of the exporter itself are available at the endpoint http://localhost:9116/metrics.

Multi-Module Handling

The multi-module functionality allows you to specify multiple modules, enabling the retrieval of information from several modules in a single scrape. The concurrency can be specified using the snmp-exporter option --snmp.module-concurrency (the default is 1).

Note: This implementation does not perform any de-duplication of walks between different modules.

There are two ways to specify multiple modules. You can either separate them with a comma or define multiple params_module. The URLs would look like this:

For comma separation:

http://localhost:9116/snmp?module=if_mib,arista_sw&target=192.0.0.8

For multiple params_module:

http://localhost:9116/snmp?module=if_mib&module=arista_sw&target=192.0.0.8

Configuration

The default configuration file name is snmp.yml and should not be edited by hand. If you need to change it, see Generating configuration.

The default snmp.yml file covers a variety of common hardware walking them using SNMP v2 GETBULK.

The --config.file parameter can be used multiple times to load more than one file. It also supports glob filename matching, e.g. snmp*.yml.

The --config.expand-environment-variables parameter allows passing environment variables into some fields of the configuration file. The username, password & priv_password fields in the auths section are supported. Defaults to disabled.

Duplicate module or auth entries are treated as invalid and can not be loaded.

Prometheus Configuration

The URL params target, auth, and module can be controlled through relabelling.

Example config:

scrape_configs:
  - job_name: 'snmp'
    static_configs:
      - targets:
        - 192.168.1.2  # SNMP device.
        - switch.local # SNMP device.
        - tcp://192.168.1.3:1161  # SNMP device using TCP transport and custom port.
    metrics_path: /snmp
    params:
      auth: [public_v2]
      module: [if_mib]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9116  # The SNMP exporter's real hostname:port.

  # Global exporter-level metrics
  - job_name: 'snmp_exporter'
    static_configs:
      - targets: ['localhost:9116']

You could pass username, password & priv_password via environment variables of your choice in below format. If the variables exist in the environment, they are resolved on the fly otherwise the string in the config file is passed as-is.

This requires the --config.expand-environment-variables flag be set.

auths:
  example_with_envs:
    community: mysecret
    security_level: SomethingReadOnly
    username: ${ARISTA_USERNAME}
    password: ${ARISTA_PASSWORD}
    auth_protocol: SHA256
    priv_protocol: AES
    priv_password: ${ARISTA_PRIV_PASSWORD}

Similarly to blackbox_exporter, snmp_exporter is meant to run on a few central machines and can be thought of like a "Prometheus proxy".

TLS and basic authentication

The SNMP Exporter supports TLS and basic authentication. This enables better control of the various HTTP endpoints.

To use TLS and/or basic authentication, you need to pass a configuration file using the --web.config.file parameter. The format of the file is described in the exporter-toolkit repository.

Note that the TLS and basic authentication settings affect all HTTP endpoints: /metrics for scraping, /snmp for scraping SNMP devices, and the web UI.

Generating configuration

Most use cases should be covered by our default configuration. If you need to generate your own configuration from MIBs, you can use the generator.

Use the generator if you need to customize which objects are walked or use non-public MIBs.

Large counter value handling

In order to provide accurate counters for large Counter64 values, the exporter will automatically wrap the value every 2^53 to avoid 64-bit float rounding. Prometheus handles this gracefully for you and you will not notice any negative effects.

If you need to disable this feature for non-Prometheus systems, use the command line flag --no-snmp.wrap-large-counters.

Once you have it running

It can be opaque to get started with all this, but in our own experience, snmp_exporter is honestly the best way to interact with SNMP. To make it easier for others, please consider contributing back your configurations to us. snmp.yml config should be accompanied by generator config. For your dashboard, alerts, and recording rules, please consider contributing them to https://github.com/prometheus/snmp_exporter/tree/main/snmp-mixin.

snmp_exporter's People

Contributors

babinskiy avatar beorn7 avatar bjk-soundcloud avatar brian-brazil avatar buroa avatar candlerb avatar carlosedp avatar conr avatar daenney avatar dependabot[bot] avatar gebn avatar gouthamve avatar hhromic avatar jayme-github avatar jcollie avatar mjtrangoni avatar pierref avatar prombot avatar richih avatar roidelapluie avatar rustybower avatar savetherbtz avatar sebastien-coavoux avatar servak avatar sgissi avatar simonpasquier avatar superq avatar tomhughes avatar weidongkl avatar xxzk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snmp_exporter's Issues

Help/Directions needed

I would need some directions on how to accomplish the following (I've read through the README but it's not clear how to generate the config sections).

We are using few fortinet devices: we have one fortinet fortigate (a firewall) and 3 forti AP (access points managed through the fortigate).

I would like to query few of the attributes of the fgWcWtpSessionEntry table (search for oid 1.3.6.1.4.1.12356.101.14.4.4.1 at http://www.oidview.com/mibs/12356/FORTINET-FORTIGATE-MIB.html ).
The table definition can be seen at https://github.com/librenms/librenms/blob/master/mibs/FORTINET-FORTIGATE-MIB.mib#L6125-L6148

The problem is that the index is not an increasing counter but some sort of enumeration.

Example, the following are the IDs of the APs connected (last part of the serial redacted):

$ snmpwalk -v 2c -c public $IP 1.3.6.1.4.1.12356.101.14.4.4.1.1
SNMPv2-SMI::enterprises.12356.101.14.4.4.1.1.1.16.70.80.51.50.48.67.51.88.49.54.48.48.48.48.54.55 = STRING: "FP320C3X16000XXX"
SNMPv2-SMI::enterprises.12356.101.14.4.4.1.1.1.16.70.80.51.50.48.67.51.88.49.54.48.48.48.49.50.57 = STRING: "FP320C3X16000YYY"
SNMPv2-SMI::enterprises.12356.101.14.4.4.1.1.1.16.70.80.51.50.48.67.51.88.49.54.48.48.48.51.51.53 = STRING: "FP320C3X16000ZZZ"

So, to start simple, I wanted to retrieve the number of wireless clients connected per AP

$ snmpwalk -v 2c -c public $IP 1.3.6.1.4.1.12356.101.14.4.4.1.17
SNMPv2-SMI::enterprises.12356.101.14.4.4.1.17.1.16.70.80.51.50.48.67.51.88.49.54.48.48.48.48.54.55 = Gauge32: 10
SNMPv2-SMI::enterprises.12356.101.14.4.4.1.17.1.16.70.80.51.50.48.67.51.88.49.54.48.48.48.49.50.57 = Gauge32: 4
SNMPv2-SMI::enterprises.12356.101.14.4.4.1.17.1.16.70.80.51.50.48.67.51.88.49.54.48.48.48.51.51.53 = Gauge32: 4

According to the above, I defined the following section in the snmp.yml

fn_fg_test:
  walk:
    - 1.3.6.1.2.1.1.3
    - 1.3.6.1.4.1.12356.101.14.4.4.1.1
    - 1.3.6.1.4.1.12356.101.14.4.4.1.17
  metrics:
    - name: sysUpTime
      oid: 1.3.6.1.2.1.1.3
    - name: fgWcWtpSessionWtpStationCount
      oid: 1.3.6.1.4.1.12356.101.14.4.4.1.17
      indexes:
        - labelname: fgWcWtpSessionWtpId
          type: String
      lookups:
        - labels: [fgWcWtpSessionWtpId]
          labelname: fgWcWtpSessionWtpId
          oid: 1.3.6.1.4.1.12356.101.14.4.4.1.1

This results in an error similar to what's described in issue #64:

An error has occurred during metrics gathering:

2 error(s) occurred:
* collected metric fgWcWtpSessionWtpStationCount untyped:<value:10 >  was collected before with the same name and label values
* collected metric fgWcWtpSessionWtpStationCount untyped:<value:4 >  was collected before with the same name and label values

It seems that the exporter is not able to walk through all the children of the main OID. Or I'm doing something wrong.

Any help/direction would be greatly appreciated.

Go port regression: Completely fails on duplicate name and label values

The Python version would soldier on, the Go port simply returns on HTTP:

# curl localhost:48919/snmp?target=sw1-openstack.mgmt.space.net 
An error has occurred during metrics gathering:

64 error(s) occurred:
* collected metric ifOutOctets label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifSpeed label:<name:"ifDescr" value:"" > untyped:<value:1e+09 >  was collected before with the same name and label values
* collected metric ifMtu label:<name:"ifDescr" value:"" > untyped:<value:1500 >  was collected before with the same name and label values
* collected metric ifOutNUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:494551 >  was collected before with the same name and label values
* collected metric ifHCInBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInNUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:2422 >  was collected before with the same name and label values
* collected metric ifConnectorPresent label:<name:"ifDescr" value:"" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifInErrors label:<name:"ifDescr" value:"" > untyped:<value:4715 >  was collected before with the same name and label values
* collected metric ifOutNUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInDiscards label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifSpeed label:<name:"ifDescr" value:"" > untyped:<value:1e+09 >  was collected before with the same name and label values
* collected metric ifLinkUpDownTrapEnable label:<name:"ifDescr" value:"" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifHCOutMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:325117 >  was collected before with the same name and label values
* collected metric ifMtu label:<name:"ifDescr" value:"" > untyped:<value:1500 >  was collected before with the same name and label values
* collected metric ifLinkUpDownTrapEnable label:<name:"ifDescr" value:"" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifHCOutMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifAdminStatus label:<name:"ifDescr" value:"" > untyped:<value:2 >  was collected before with the same name and label values
* collected metric ifInOctets label:<name:"ifDescr" value:"" > untyped:<value:4.131201868e+09 >  was collected before with the same name and label values
* collected metric ifOutMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCInMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOperStatus label:<name:"ifDescr" value:"" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifHCOutUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCInBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutDiscards label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutQLen label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifPromiscuousMode label:<name:"ifDescr" value:"" > untyped:<value:2 >  was collected before with the same name and label values
* collected metric ifPromiscuousMode label:<name:"ifDescr" value:"" > untyped:<value:2 >  was collected before with the same name and label values
* collected metric ifOutErrors label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifConnectorPresent label:<name:"ifDescr" value:"" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifHCInOctets label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInDiscards label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutOctets label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:2.82319329e+08 >  was collected before with the same name and label values
* collected metric ifInUnknownProtos label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:2.82319329e+08 >  was collected before with the same name and label values
* collected metric ifHCInMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInUnknownProtos label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInNUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutOctets label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifAdminStatus label:<name:"ifDescr" value:"" > untyped:<value:2 >  was collected before with the same name and label values
* collected metric ifInOctets label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOperStatus label:<name:"ifDescr" value:"" > untyped:<value:2 >  was collected before with the same name and label values
* collected metric ifOutErrors label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutDiscards label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCInOctets label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHighSpeed label:<name:"ifDescr" value:"" > untyped:<value:40000 >  was collected before with the same name and label values
* collected metric ifHCInUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:2.07949316e+08 >  was collected before with the same name and label values
* collected metric ifHCInUcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutQLen label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutBroadcastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHighSpeed label:<name:"ifDescr" value:"" > untyped:<value:40000 >  was collected before with the same name and label values
* collected metric ifOutMulticastPkts label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutOctets label:<name:"ifDescr" value:"" > untyped:<value:3.61357623422e+11 >  was collected before with the same name and label values
* collected metric ifInErrors label:<name:"ifDescr" value:"" > untyped:<value:0 >  was collected before with the same name and label values
# 

while the process itself prints nothing on CLI.

TypeError & Library mismatch

Hi,

I am trying to run snmp_exporter on Ubuntu 16.04 LTS and running into several issues.

First issue:

Exception happened during processing of request from ('****_', 55329)
Traceback (most recent call last):
File "/usr/lib/python3.5/socketserver.py", line 600, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python3.5/dist-packages/snmp_exporter/http.py", line 70, in
handler = lambda *args, *_kwargs: SnmpExporterHandler(config_path, _args, *_kwargs)
File "/usr/local/lib/python3.5/dist-packages/snmp_exporter/http.py", line 25, in init
BaseHTTPRequestHandler.init(self, _args, *_kwargs)
File "/usr/lib/python3.5/socketserver.py", line 681, in init
self.handle()
File "/usr/lib/python3.5/http/server.py", line 422, in handle
self.handle_one_request()
File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request
method()
File "/usr/local/lib/python3.5/dist-packages/snmp_exporter/http.py", line 64, in do_GET
""")
File "/usr/lib/python3.5/socket.py", line 593, in write
return self._sock.send(b)
TypeError: a bytes-like object is required, not 'str'

Which means that in file http.py the self.wfile.write() functions need to be rewritten so that the variables will be byte encoded using for example: self.wfile.write(traceback.format_exc().encode(encoding='utf_8')) on line 54.

Second issue

sudo pip3 install netsnmp-py

Error:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/snmp_exporter/http.py", line 46, in do_GET
output = collect_snmp(config[module], params['address'][0])
File "/usr/local/lib/python3.5/dist-packages/snmp_exporter/collector.py", line 120, in collect_snmp
for oid, value in values:
File "/usr/local/lib/python3.5/dist-packages/snmp_exporter/collector.py", line 23, in walk_oids
session = netsnmp.Session(Version=2, DestHost=host, RemotePort=port,
AttributeError: module 'netsnmp' has no attribute 'Session'

And the error is correct, netsnmp-py does not have a function called session.
It could be the wrong library, there is no other library i can find in PIP that has netsnmp in the name.
The netsnmp-python package in ubuntu 16.04 LTS is only for python 2.7.

At the moment i cannot use snmp_exporter.

Doesn't work with SNMPv1 devices

The exporter is great with my devices that support snmp 2c, but just times out contacting devices that only have v1 support.

pysnmp seems to support 1, 2c & 3, could you add a way of specifying the snmp version to use?

SNMP Secret

Hey Team,

Is there a way to specify a secret to the snmp_exporter ? I want to monitor a bunch of Cisco switches and they won't talk to the exporter if the secret is not provided ... Thanks.

Cheers,

ASD.

Need a way to configure listening interface

While there is a way to configure the listening port, there is currently now way to define on which interface the http server listen. It defaults to listening on all interfaces.

My usual config is to run the snmp_exporter on the same machine than promotheus, and I don't want to expose the running service all over the network, so I'd like to make it listen on 127.0.0.1 only.

Dynamic choice between different tables used to look up

Quoth the comment relating to handling LldpPortNumber (before, I mistakenly said it was dot1qPvid):

    # The indexing of local LLDP port numbers is... interesting.                
    #                                                                          
    # If the device supports the dot1dBasePortTable the dot1dBasePort          
    # numer is used, and the dot1dBasePortTable has to be used to translate    
    # to an ifIndex.                                                            
    #                                                                          
    # Otherwise the ifIndex is used directly.                                  
    #                                                                          
    # No, I have no idea who came up with this.                                
    #                                                                          
    # The exact text in the LLDP MIB for this is:                              
    #                                                                          
    # --                                                                        
    #                                                                          
    # A port number has no mandatory relationship to an                        
    # InterfaceIndex object (of the interfaces MIB, IETF RFC 2863).            
    # If the LLDP agent is a IEEE 802.1D, IEEE 802.1Q bridge, the              
    # LldpPortNumber will have the same value as the dot1dBasePort              
    # object (defined in IETF RFC 1493) associated corresponding                
    # bridge port.  If the system hosting LLDP agent is not an                  
    # IEEE 802.1D or an IEEE 802.1Q bridge, the LldpPortNumber                  
    # will have the same value as the corresponding interface's                
    # InterfaceIndex object.                                                    
    #                                                                          
    # --                                                                        
    #                                                                          
    # Note that it does not mention how one finds out whether or                
    # not the remote system is a bridge or not. From experience Arista          
    # devices seem to be bridges, and index via dot1d, while Juniper EX        
    # switches are not, even though they do have a dot1d table.

This seems to be an interesting implementation choice, and I have no idea how to handle that in the SNMP exporter, or if it's even worth it to attempt to handle it...

Multiple metrics with the same OID? (multi-CPU load case)

I have a multi-core switch I would like to monitor. I can walk the CPU tree but I do not know how to register the load for the 36 cores.

$ snmpwalk -v 2c  -c public 10.10.0.8  .1.3.6.1.2.1.25.3.3.1.2
iso.3.6.1.2.1.25.3.3.1.2.1 = INTEGER: 2
[...]
iso.3.6.1.2.1.25.3.3.1.2.36 = INTEGER: 1

I may write the individual metrics but it will be a pain to use later in prometheus because I will not have a simple way to do an avg on the many metrics.

    - name: hrProcessorLoad_1
      oid: 1.3.6.1.2.1.25.3.3.1.2.1 # the last ยซ1ยป is the core number
      type: Integer32

I would love to do something like this: to be able to mach the last OID number to a label.

    - name: hrProcessorLoad
      oid: 1.3.6.1.2.1.25.3.3.1.2.[cpu]
      type: Integer32
      indexes:
          - labelname: cpu
            type: Integer32
      lookups:
         - labels: [cpu]
           labelname: cpu
           values: 1-36 

How would you approach this issue?

How to handle strings and map them to boolean.

First of all, thanks for this exporter. It's really done wonders for us. However, I often find myself at a loss when I'm faced with strings that could be translated to a boolean value. For example, I've mapped several VMware servers, and one of the oid's describe if the VM is in a runnable state or turned off. Is it possible to map for example s/running/1/g?

IBM FC-Switches: [Errno 32] Broken pipe

I have a random issue with the IBM Fibre-Channel Switches, using a renamed but cloned default module for the snmp_exporter.

Prometheus says: Error: context deadline exceeded, and snmp_exporter log this:

Sep 01 14:11:02 hostname snmp_exporter[1991]: 192.168.139.44 - - [01/Sep/2016 14:11:02] "GET /metrics?address=switch-4.localdomain&module=brocade HTTP/1.1" 200 -
Sep 01 14:11:02 hostname snmp_exporter[1991]: 192.168.139.44 - - [01/Sep/2016 14:11:02] "GET /metrics?address=switch-4.localdomain&module=brocade HTTP/1.1" 500 -
Sep 01 14:11:02 hostname snmp_exporter[1991]: Traceback (most recent call last):
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib64/python2.7/SocketServer.py", line 568, in process_request
Sep 01 14:11:02 hostname snmp_exporter[1991]: self.finish_request(request, client_address)
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib64/python2.7/SocketServer.py", line 334, in finish_request
Sep 01 14:11:02 hostname snmp_exporter[1991]: self.RequestHandlerClass(request, client_address, self)
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib/python2.7/site-packages/snmp_exporter/http.py", line 70, in <lambda>
Sep 01 14:11:02 hostname snmp_exporter[1991]: handler = lambda *args, **kwargs: SnmpExporterHandler(config_path, *args, **kwargs)
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib/python2.7/site-packages/snmp_exporter/http.py", line 25, in __init__
Sep 01 14:11:02 hostname snmp_exporter[1991]: BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib64/python2.7/SocketServer.py", line 651, in __init__
Sep 01 14:11:02 hostname snmp_exporter[1991]: self.finish()
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib64/python2.7/SocketServer.py", line 710, in finish
Sep 01 14:11:02 hostname snmp_exporter[1991]: self.wfile.close()
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib64/python2.7/socket.py", line 279, in close
Sep 01 14:11:02 hostname snmp_exporter[1991]: self.flush()
Sep 01 14:11:02 hostname snmp_exporter[1991]: File "/usr/lib64/python2.7/socket.py", line 303, in flush
Sep 01 14:11:02 hostname snmp_exporter[1991]: self._sock.sendall(view[write_offset:write_offset+buffer_size])
Sep 01 14:11:02 hostname snmp_exporter[1991]: error: [Errno 32] Broken pipe

With 2498_24e and 2498_24g (24 Ports) it happens randomly but not always. With the 2498_f48 it happens all the time.

I saw also that the headers are shown as footers if this error happens.

How can I debug it? Or how can I fix it?

OS: CentOS Linux release 7.2.1511 (Core)
Python: from System, 2.7.5
SNMP Exporter: 0.0.6

snmp configuration file can not poll my switch

hallo i iam new in this sector
i downlload it and aplly all steps
nodes is okey
my problem is
whenn i add snmp device , it can not show anything from him and it can not even pollen
but with snmpwalk from same machine works good i do not know where the problem
please look at the photos and tell me what muss i change
thank you

1
2
3
4
snmp

docker deployment

i see Dockerfile in the project, please document docker deployment in README.md, preferrably with docker-compose example.

Walking and retrieving OIDs finished in zero

In the collector.walk:oid function there is a conditional to manipulate zeros on oids that says:

def walk_oid(session, oid):
       # [...]
        if v.iid == '0':
          yield v.tag[1:], v.val
        else:
          yield last_oid, v.val

We have a Mikrotik switch that has a oids finished in zero:

cpu-frequency: .1.3.6.1.4.1.14988.1.1.3.14.0

And this function will completely broke the crawling for that item, ignoring the parsed result and not showing in the prometheus-ready endpoint.

The simple fix was to remove the conditional but this was at the expense of almost a full day of investigation.

Is there any reason I cannot grasp why this is implemented in this way?

pulling from network device issue

Hi,

I'm trying to setup prometheus with snmp_exporter to get snmp info from one of my network devices(DDOS protection), when I sample the DDOS protector device with SNMP through the browser I get the following:
http://172.31.15.222:9116/snmp?target=172.31.15.165

TYPE ifHCInBroadcastPkts untyped

ifHCInBroadcastPkts{ifDescr="Gigabit Ethernet-25"} 5.117052e+06
ifHCInBroadcastPkts{ifDescr="Gigabit Ethernet-26"} 0

Now I just want to configure prometheus to monitor it, but I don't understand what is needed to fill in the prometheus.yml file.

Please help me!

Name or random string used as ID within OID with Netscalers

As per IRC:

These blocks encode the length of what is then used as ID.

If the server name is 31 chars in length or less, decimal ASCII values are used in the OID. At length 32 or longer, the length of the ID in the block stays at 31 and a random string is used as ID.

An, outdated, MIB can be found at http://www.circitor.fr/Mibs/Files/NS-ROOT-MIB.mib

Example of the random id: SNMPv2-SMI::enterprises.5951.4.1.3.1.1.59.31.73.78.121.115.113.50.112.51.97.106.102.117.122.120.97.99.114.116.108.49.117.114.97.122.111.50.52.101.97.98.101

FR: Custom community string

For various policy and compartmentalization reasons, we need to use different community strings for some targets. Being able to specify them in prometheus.yml and passing them onto the exporter would be a lot easier than spawning an arbitrary number of snmp exporters.

System load when using snmp_exporter

On a self-contained prometheus machine scraping half a dozen node_exporters, and pinging ~150 hosts via blackbox_exporter, load is at 0.03 to 0.14.

Adding 27 snmp targets via snmp_exporter running on the same machine which are scraped every minute increases load to 1.5. Querying the dataset every minute or so will increase load further to around 2.

VM specs:

  • 6 cores of Intel(R) Xeon(R) CPU L5640 @ 2.27GHz
  • 6 GiB RAM
  • random, reasonably fast spindle disks

With four cores and 2 GiB of RAM, and with snmp_exporter being scraped, the system started swapping about 1.5 GiB and load went to ~8; quitting the main prometheus process via ctrl-c took about three minutes.

Ditch netsnmp for another SNMP library (maybe pysnmp)

Hi there,

I love this project, and use the exporter on a few Linux boxes. However, I don't see this as a complete solution because of the problems I've had installing this on Windows (never got it to work). I'm unable to seriously consider using this in a production environment at work. The problem is purely deployment related. It seems to me that removing the dependency on netsnmp would help alleviate this problem. Perhaps another snmp module like pysnmp would be a reasonable alternative? It seems to have the exact same functionality, while being much easier (and likely) to install successfully, without requiring code to be compiled.

The hoops I had to jump through for Windows involved having the VC tool-chain installed, then getting the source for NET-SNMP, then compiling it, then jumping into a python sub-directory and trying to do make setup.py install (never worked). This isn't a shortcoming of snmp_exporter, but in NET-SNMP IMO. For that reason, I'd recommend ditching NET-SNMP since it's only holding this project back IMO.

I'd be happy to help test if someone else could take a crack at migrating to another SNMP library.

Thanks everyone,

Christopher

Implement out-of-bounds verification & error handling when accessing OIDs not retrieved before

I had this in my config

walk:
  - 1.3.6.1.4.1.9.9.13.1.3.1_.3_

metrics:
  - name: ciscoEnvMonTemperatureStatusValue
    oid: 1.3.6.1.4.1.9.9.13.1.3.1.3
    indexes:
      - labelname: measuring_point
        type: Integer32
    lookups:
      - labels: [measuring_point]
        labelname: measuring_point
        oid: 1.3.6.1.4.1.9.9.13.1.3.1.2

which lead to

ciscoEnvMonTemperatureStatusValue{measuring_point="60052"} 24.0

changing the walk to

      - 1.3.6.1.4.1.9.9.13.1.3.1

results in

ciscoEnvMonTemperatureStatusValue{measuring_point="module 5 RP inlet temperature"} 24.0

Accessing metrics which are out of bounds should arguably lead to an error, both on cli and in the scrap target site.

error when dual nic have same label

The metrics gathering fails when the device has dual nics that have the same label.

snmpwalk -v 2c -c public server123 | grep "3.6.1.2.1.2.2.1.2"
iso.3.6.1.2.1.2.2.1.2.1 = STRING: "lo"
iso.3.6.1.2.1.2.2.1.2.2 = STRING: "Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet"
iso.3.6.1.2.1.2.2.1.2.3 = STRING: "Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet"
iso.3.6.1.2.1.2.2.1.2.4 = STRING: "bond0"
iso.3.6.1.2.1.2.2.1.20.1 = Counter32: 0
iso.3.6.1.2.1.2.2.1.20.2 = Counter32: 0
iso.3.6.1.2.1.2.2.1.20.3 = Counter32: 0
iso.3.6.1.2.1.2.2.1.20.4 = Counter32: 0
iso.3.6.1.2.1.2.2.1.21.1 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.21.2 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.21.3 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.21.4 = Gauge32: 0
iso.3.6.1.2.1.2.2.1.22.1 = OID: ccitt.0
iso.3.6.1.2.1.2.2.1.22.2 = OID: ccitt.0
iso.3.6.1.2.1.2.2.1.22.3 = OID: ccitt.0
iso.3.6.1.2.1.2.2.1.22.4 = OID: ccitt.0
An error has occurred during metrics gathering:

31 error(s) occurred:
* collected metric ifSpeed label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInErrors label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutOctets label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutBroadcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHighSpeed label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1000 >  was collected before with the same name and label values
* collected metric ifHCOutMulticastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInBroadcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInOctets label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:5.55099672e+08 >  was collected before with the same name and label values
* collected metric ifOutQLen label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifInMulticastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1.1497918e+08 >  was collected before with the same name and label values
* collected metric ifConnectorPresent label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifInDiscards label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:12 >  was collected before with the same name and label values
* collected metric ifMtu label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1500 >  was collected before with the same name and label values
* collected metric ifInUcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCInUcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutMulticastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifAdminStatus label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifPromiscuousMode label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:2 >  was collected before with the same name and label values
* collected metric ifOperStatus label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1 >  was collected before with the same name and label values
* collected metric ifInNUcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1.1497918e+08 >  was collected before with the same name and label values
* collected metric ifOutNUcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutUcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1.026621e+06 >  was collected before with the same name and label values
* collected metric ifInUnknownProtos label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCInOctets label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:2.6324903448e+10 >  was collected before with the same name and label values
* collected metric ifHCInMulticastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCInBroadcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutOctets label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutUcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:1.026621e+06 >  was collected before with the same name and label values
* collected metric ifOutDiscards label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifOutErrors label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ifHCOutBroadcastPkts label:<name:"ifDescr" value:"Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet" > untyped:<value:0 >  was collected before with the same name and label values

Is this something that I can fix with a different snmp.yml config?

cannot use &snmp (type *"github.com/soniah/gosnmp".GoSNMP) as type

Hi,
I can't compile the SNMP exporter on a RHEL 7.2 machine.
When i try to go build I have the following error:
cannot use &snmp (type *"github.com/soniah/gosnmp".GoSNMP) as type *"github.com/prometheus/snmp_exporter/vendor/github.com/soniah/gosnmp".GoSNMP in argument to config.ConfigureSNMP

Impossible to add multiple labels

With the current code, it's impossible to add multiple labels, at least if they're both Integer32 (my use case is to get both interface name ("ifDescr") and interface description ("ifAlias"))

I worked around that by commenting "suboid = suboid[1:]" in collector.py line 64. I must admit I'm not 100% sure why this is here for, so no PR for this.

Thanks !

Improve handling of duplicate ifDescr in provided config

I'm testing snmp_exporter on a HP ProCurve 3500yl-48G switch with firmware K.16.01.0004 and ROM K.15.30 and noticed the following periodic warning in the Prometheus log:

time="2016-06-03T14:48:35+02:00" level=warning msg="Error on ingesting samples with different value but same timestamp" numDropped=23 source="scrape.go:470"

Turning on -log.level=debug shows the reason: There are duplicate interfaces with the name Switch loopback interface and this triggers 23 debug-level log entries:

time="2016-06-03T15:01:35+02:00" level=debug msg="Sample discarded" error="sample with repeated timestamp but different value" sample=ifAdminStatus{ifDescr="Switch loopback interface", instance="192.168.59.100", job="snmp"} => 1 @[1464958894.34] source="scrape.go:460" 
time="2016-06-03T15:01:35+02:00" level=debug msg="Sample discarded" error="sample with repeated timestamp but different value" sample=ifMtu{ifDescr="Switch loopback interface", instance="192.168.59.100", job="snmp"} => 65535 @[1464958894.34] source="scrape.go:460"
[...]

ifNumber is 54:

# snmpwalk -v2c -c public 192.168.59.100 1.3.6.1.2.1.2.1
IF-MIB::ifNumber.0 = INTEGER: 54

However, ifDescr shows 61 interface descriptions and the last eight are identical:

# snmpwalk -v2c -c public 192.168.59.100 1.3.6.1.2.1.2.2.1.2
IF-MIB::ifDescr.1 = STRING: 1
IF-MIB::ifDescr.2 = STRING: 2
[...]
IF-MIB::ifDescr.48 = STRING: 48
IF-MIB::ifDescr.49 = STRING: A1
IF-MIB::ifDescr.50 = STRING: A2
IF-MIB::ifDescr.51 = STRING: A3
IF-MIB::ifDescr.52 = STRING: A4
IF-MIB::ifDescr.578 = STRING: DEFAULT_VLAN
IF-MIB::ifDescr.4800 = STRING: Switch loopback interface
IF-MIB::ifDescr.4801 = STRING: Switch loopback interface
IF-MIB::ifDescr.4802 = STRING: Switch loopback interface
IF-MIB::ifDescr.4803 = STRING: Switch loopback interface
IF-MIB::ifDescr.4804 = STRING: Switch loopback interface
IF-MIB::ifDescr.4805 = STRING: Switch loopback interface
IF-MIB::ifDescr.4806 = STRING: Switch loopback interface
IF-MIB::ifDescr.4807 = STRING: Switch loopback interface

Is there a nice workaround to prevent these Prometheus warnings?

Multiple OctectStrings in OID

I'm trying to exports some metrics from an F5 Big-IP and I'm facing some issues.
The OID is composed as follows: <OctectString>.<OctectString>.<Integer32>

The output error complains about the integer field but I'm not sure that's the real issue.
Has this anything to do with multiple strings in the OID?

Relevant MIB Part:

ltmPoolMemberStatEntry OBJECT-TYPE                                                                                                                                                        SYNTAX  LtmPoolMemberStatEntry
        MAX-ACCESS not-accessible                                                                                                                                                         STATUS current
        DESCRIPTION
                "Columns in the ltmPoolMemberStat Table"
        INDEX {
                ltmPoolMemberStatPoolName,
                ltmPoolMemberStatNodeName,
                ltmPoolMemberStatPort
        }
        ::= { ltmPoolMemberStatTable 1 }

snmpwalk output:

$ snmpwalk -v2c -cpublic -m +F5-BIGIP-LOCAL-MIB $IP 1.3.6.1.4.1.3375.2.2.5.4.3.1.5
F5-BIGIP-LOCAL-MIB::ltmPoolMemberStatServerPktsIn."/Common/fe-err_pool"."/Common/fe-err01.prd.iad1.ccmteam.com".80 = Counter64: 0
F5-BIGIP-LOCAL-MIB::ltmPoolMemberStatServerPktsIn."/Common/fe-gui_pool"."/Common/fe-gui01.prd.iad1.ccmteam.com".3000 = Counter64: 0
F5-BIGIP-LOCAL-MIB::ltmPoolMemberStatServerPktsIn."/Common/fe-gui_pool"."/Common/fe-gui02.prd.iad1.ccmteam.com".3000 = Counter64: 0
F5-BIGIP-LOCAL-MIB::ltmPoolMemberStatServerPktsIn."/Common/fe-gui_pool"."/Common/fe-gui03.prd.iad1.ccmteam.com".3000 = Counter64: 0
F5-BIGIP-LOCAL-MIB::ltmPoolMemberStatServerPktsIn."/Common/ae-adas_pool"."/Common/ae-adas01.prd.iad1.ccmteam.com".8088 = Counter64: 436918
F5-BIGIP-LOCAL-MIB::ltmPoolMemberStatServerPktsIn."/Common/ae-adas_pool"."/Common/ae-adas02.prd.iad1.ccmteam.com".8088 = Counter64: 442651
[...]

same walk with numeric OIDs in the output

$ snmpwalk -v2c -cpublic -m +F5-BIGIP-LOCAL-MIB -On lb01a.ops.iad1.ccmteam.com 1.3.6.1.4.1.3375.2.2.5.4.3.1.5 | head
.1.3.6.1.4.1.3375.2.2.5.4.3.1.5.19.47.67.111.109.109.111.110.47.102.101.45.101.114.114.95.112.111.111.108.37.47.67.111.109.109.111.110.47.102.101.45.101.114.114.48.49.46.112.114.100.46.105.97.100.49.46.99.99.109.116.101.97.109.46.99.111.109.80 = Counter64: 0
.1.3.6.1.4.1.3375.2.2.5.4.3.1.5.19.47.67.111.109.109.111.110.47.102.101.45.103.117.105.95.112.111.111.108.37.47.67.111.109.109.111.110.47.102.101.45.103.117.105.48.49.46.112.114.100.46.105.97.100.49.46.99.99.109.116.101.97.109.46.99.111.109.3000 = Counter64: 0
.1.3.6.1.4.1.3375.2.2.5.4.3.1.5.19.47.67.111.109.109.111.110.47.102.101.45.103.117.105.95.112.111.111.108.37.47.67.111.109.109.111.110.47.102.101.45.103.117.105.48.50.46.112.114.100.46.105.97.100.49.46.99.99.109.116.101.97.109.46.99.111.109.3000 = Counter64: 0
.1.3.6.1.4.1.3375.2.2.5.4.3.1.5.19.47.67.111.109.109.111.110.47.102.101.45.103.117.105.95.112.111.111.108.37.47.67.111.109.109.111.110.47.102.101.45.103.117.105.48.51.46.112.114.100.46.105.97.100.49.46.99.99.109.116.101.97.109.46.99.111.109.3000 = Counter64: 0
.1.3.6.1.4.1.3375.2.2.5.4.3.1.5.20.47.67.111.109.109.111.110.47.97.101.45.97.100.97.115.95.112.111.111.108.38.47.67.111.109.109.111.110.47.97.101.45.97.100.97.115.48.49.46.112.114.100.46.105.97.100.49.46.99.99.109.116.101.97.109.46.99.111.109.8088 = Counter64: 436918
.1.3.6.1.4.1.3375.2.2.5.4.3.1.5.20.47.67.111.109.109.111.110.47.97.101.45.97.100.97.115.95.112.111.111.108.38.47.67.111.109.109.111.110.47.97.101.45.97.100.97.115.48.50.46.112.114.100.46.105.97.100.49.46.99.99.109.116.101.97.109.46.99.111.109.8088 = Counter64: 442651
[...]

snmp.yml

f5_bigip_test:
  walk:
    - 1.3.6.1.4.1.3375.2.2.5.4.3.1.5
  metrics:
    - name: ltmPoolMemberStatServerPktsIn
      oid: 1.3.6.1.4.1.3375.2.2.5.4.3.1.5
  indexes:
    - labelname: ltmPoolMemberStatPoolName
      type: OctectString
    - labelname: ltmPoolMemberStatNodeName
      type: OctectString
    - labelname: ltmPoolMemberStatPort
      type: Integer32

ERROR:

An error has occurred during metrics gathering:

68 error(s) occurred:
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:4.13858e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"23" > untyped:<value:276934 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"23" > untyped:<value:183433 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:7.005898e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:7.463458e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"19" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:3.013238e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.1511485908e+10 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:7.430910322e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.0531325175e+10 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:3.94953457e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.210491576e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.7430679e+07 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.143726128e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"26" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.1650705322e+10 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.39326382e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"20" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"28" > untyped:<value:164370 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.0445004952e+10 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.276381168e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"20" > untyped:<value:4.083579e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:1.562933e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:3.59882981e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:3.82690532e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.638797e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.612042e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.95958074e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"23" > untyped:<value:1.012945e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"24" > untyped:<value:54879 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"26" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"28" > untyped:<value:303171 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:1.929714e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.333835174e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.441544995e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"19" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"20" > untyped:<value:5136 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"23" > untyped:<value:1.317642e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.256083039e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"27" > untyped:<value:3.070574e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:1.583781e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.341484219e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.142374002e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.31742925e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"27" > untyped:<value:2.2037324e+07 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.3335678e+07 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:3.94342424e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.208806595e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.29889518e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:2.363761683e+09 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.22796652e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"27" > untyped:<value:7.767444e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.90924532e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.015306e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.2131262389e+10 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:1.2172364118e+10 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.65116099e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:8.706089e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"20" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.78314181e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.8087374e+07 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:3.45772371e+08 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"36" > untyped:<value:9.136654e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"19" > untyped:<value:0 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"20" > untyped:<value:436918 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"23" > untyped:<value:260173 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:1.926264e+06 >  was collected before with the same name and label values
* collected metric ltmPoolMemberStatServerPktsIn label:<name:"ltmPoolMemberStatPort" value:"31" > untyped:<value:2.2860138e+07 >  was collected before with the same name and label values

No prefix on all metrics?

I'm wondering why the metric names in snmp.yml are not prefixed with the exporter name?
Is there a specific rationale for that decision?

Allow configurable repeat value

Currently it's hardcoded to 25 which I thought would be safe given that other monitoring tools seem to use this value, however I've had a report of a switch breaking at 23. This should be made configurable per-module.

dont print all oid

Hello!
snmp-export displays not all oid.

# HELP snmp_oids_walked Number of oids walked in this scrape
# TYPE snmp_oids_walked gauge
snmp_oids_walked 16.0
# HELP SmgEOnePhyState SNMP OID 1.3.6.1.4.1.35265.1.29.7.1.2.0
# TYPE SmgEOnePhyState untyped
# HELP SmgEOnePhyState1 SNMP OID 1.3.6.1.4.1.35265.1.29.7.1.2.1
# TYPE SmgEOnePhyState1 untyped
SmgEOnePhyState1{ifDescr=""} 6.0
# HELP SmgEOnePhyState2 SNMP OID 1.3.6.1.4.1.35265.1.29.7.1.2.2
# TYPE SmgEOnePhyState2 untyped
SmgEOnePhyState2{ifDescr=""} 6.0
# HELP snmp_scrape_duration_seconds Time this SNMP scrape took, in seconds
# TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.01685190200805664

snmp.conf

default:
    community: public
    walk:
        - 1.3.6.1.4.1.35265.1.29.7.1.2
    metrics:

        - name: SmgEOnePhyState
            oid: 1.3.6.1.4.1.35265.1.29.7.1.2.0
            indexes:
                - labelname: ifDescr
                    type: Integer32

        - name: SmgEOnePhyState1
            oid: 1.3.6.1.4.1.35265.1.29.7.1.2.1
            indexes:
                - labelname: ifDescr
                    type: Integer32

        - name: SmgEOnePhyState2
            oid: 1.3.6.1.4.1.35265.1.29.7.1.2.2
            indexes:
                - labelname: ifDescr
                    type: Integer32

Here print snmpget
%snmpget -On -v 2c -c public 192.168.20.228 1.3.6.1.4.1.35265.1.29.7.1.2.0 .1.3.6.1.4.1.35265.1.29.7.1.2.0 = INTEGER: 6

Why does not appear the value of oid 1.3.6.1.4.1.35265.1.29.7.1.2.0?

P.S.
Sorry for my bad english

Normalized naming scheme

Other exporters tend to use Perl-style underscore_notation while snmp_exporter uses camlCase, e.g. ifLinkUpDownTrapEnable vs node_cpu.

Normalizing the naming scheme under One Great Scheme would be useful.

SNMP v3 support

If scraping over third-party links, the ability to encrypt and properly authenticate SNMP would be great.

s/walk:/bulkget:/ in snmp.yml

The snmp_exporter does not walk, it bulkgets. That's something I had to point out several times in internal discussions.

Supporting the old walk: while throwing a deprecation warning would be a viable upgrade path.

multi-modules prometheus snmp job configuration.

I would like to ask you for an advice/recommendation on configuring different modules at the same Prometheus job. Is it possible?
Somethings like this prometheus.yml
...

  • job_name: 'snmp'

    static_configs:

    • targets: ['sw1.localdomain', 'sw2.localdomain']
      params:
      module: [procurve]

    static_configs:

    • targets: ['fcsw1.localdomain', 'fcsw2.localdomain']
      params:
      module: [brocade]

    static_configs:

    • targets: ['ibsw1.localdomain', 'ibsw2.localdomain']
      params:
      module: [mellanox]

    relabel_configs:
    ....

metric gathering slower than snmpbulkwalk

with just snmpbulkwalk:

[andor@hostname ~]$ time snmpbulkwalk -v 2c -c community $target 1.3.6.1.2.1.2 > /dev/null

real    0m8.667s
user    0m0.066s
sys     0m0.026s
[andor@hostname ~]$ time snmpbulkwalk -v 2c -c community $target 1.3.6.1.2.1.31.1.1 > /dev/null

real    0m9.468s
user    0m0.072s
sys     0m0.016s
[andor@hostname ~]$ time snmpbulkwalk -v 2c -c community $target 1.3.6.1.2.1.1.3 > /dev/null

real    0m0.025s
user    0m0.015s
sys     0m0.005s

sum is ~18sec

with snmp_exporter with default config:

$ time curl localhost:9116/snmp?target=$target > metrics
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  363k  100  363k    0     0  14797      0  0:00:25  0:00:25 --:--:-- 76211

real    0m25.171s
user    0m0.004s
sys     0m0.016s

Add support for ignoring some OIDs to generator.yml

Some MIBs include metrics that don't really need to be included in the exporter output. It would be nice to have a "ignore" list in the generator.

For example, this OID is a pre-compute combination of two others.

ruckusWLANStatsAssocFailRate OBJECT-TYPE
    SYNTAX  Unsigned32
    UNITS
        "percentage"
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION
        "Station association fail rate. ruckusWLANStatsNumAssocFail/ruckusWLANStatsNumAssocReq"
    ::= { ruckusWLANStatsEntry 15 }

Missing data from snmp_exporter output in prometheus

Hi,

Using this command: curl localhost:9116/snmp?target=10.0.1.1&module=mikrotik_routeros
Template: #76
i get this output:

HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and processing).
TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.36220480000000005
HELP snmp_scrape_pdus_returned PDUs returned from walk.
TYPE snmp_scrape_pdus_returned gauge
snmp_scrape_pdus_returned 557
HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
TYPE snmp_scrape_walk_duration_seconds gauge
snmp_scrape_walk_duration_seconds 0.35507961200000004
HELP sysUpTime
TYPE sysUpTime untyped
sysUpTime 5.626565e+08

In Prometheus the sysUpTime value is not found, is this because the + sign is a string?

Upgrade to 0.1.0 (from previous python release) broke string data

Hi!

I just upgraded to the Go version 0.1.0.
I use this to monitor my NTP server, and after i installed the Go version some data stopped arriving into Prometheus.

This is the data that was previously working:
snmpwalk -c public -v 1 10.0.1.8 .1.3.6.1.4.1.5597.30.0.2.4.0
iso.3.6.1.4.1.5597.30.0.2.4.0 = STRING: "-0.000419"

Now with the new Go 0.1.0 version i get this output:
curl 'localhost:9116/snmp?target=10.0.1.8&module=meinberglantime'
HELP NTPRefclockOffset
TYPE NTPRefclockOffset untyped
NTPRefclockOffset 0

So something broke in the Go version that worked previously.

Adding multiple labels fails

Hi there,

I've tried to run the following configuration:

default:
  walk:
    - 1.3.6.1.2.1.2
    - 1.3.6.1.2.1.31.1.1
  metrics:
    - name: ifMtu
      oid: 1.3.6.1.2.1.2.2.1.4
      indexes:
        - labelname: ifDescr
          type: Integer32
        - labelname: ifAlias
          type: Integer32
      lookups:
        - labels: [ifDescr]
          labelname: ifDescr
          oid: 1.3.6.1.2.1.2.2.1.2
        - labels: [ifAlias]
          labelname: ifAlias
          oid: 1.3.6.1.2.1.31.1.1.1.18

I want to have two labels on the variable.
However, ifAlias stays empty.

Is that a bug or is my config wrong?

Thanks
Oliver

Doing more complex lookups

Hello, we spoke briefly about this in IRC , but I want to document the issue here properly.

We manage a large number of Meraki Access Points, which use a proprietary MIB.
Documented here by someone.

If we walk the devName table, snmpwalk returns a result like this:
MERAKI-CLOUD-CONTROLLER-MIB::devName.0.24.10.39.106.2 = STRING: Gym

This has been fixed in c423d05 with the addition of PhysAddress48 type, which will append the macaddress to the lookup.

Now, things get more complex if we're trying to reference a specific interface on the device.
An interface ID will be appended to the OID.

MERAKI-CLOUD-CONTROLLER-MIB::devInterfaceSentPkts.0.24.10.39.93.88.0 = Counter32: 75766
MERAKI-CLOUD-CONTROLLER-MIB::devInterfaceSentPkts.0.24.10.39.93.88.2 = Counter32: 280098
MERAKI-CLOUD-CONTROLLER-MIB::devInterfaceSentPkts.0.24.10.39.93.88.3 = Counter32: 607046

We can query for the devName table with a lookup like

    indexes:
      - labelname: devName
        type: PhysAddress48
        lookup: 1.3.6.1.4.1.29671.1.1.4.1.2

But if we want to also lookup something in the interface table instead, the lookup will fail:

      - labelname: devInterfaceName
        type: PhysAddress48
        lookup: 1.3.6.1.4.1.29671.1.1.5.1.3

As a temporary fix, I added PhysAddress48AddIndex as yet another type, I'm not sure if there's a better way to solve this.

Modulus for interface counters

As per our talks during/after PromCon, float64 loses precision in todays interface counters for 10G or quicker. Introducing modulus and thus artificially resetting will solve that until int64/float128 are a thing.

Implement multiple configurations similar to blackbox_exporter

Different devices are able to return different metrics. While implementing #19 would already reduce the number of required exporters significantly, a way to pass a custom capability/model label from prometheus.yml which is then mapped to a preconfigured OID set in snmp_exporter would allow to reduce the number of running exporters once again.

Timeout definition for snmp_exporter

While I can set a timeout for the scraping of the exporter, I can't set a timeout for when the snmp_exporter stops trying, internally. I can't seem to find an option within the exporter codebase, either.

Unless I am missing something, an option to have snmp_exporter jobs kill themselves after X time would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.