SNMP Exporter showing UNKNOWN module

1,318 views
Skip to first unread message

Aliff Ashraf

unread,
Nov 21, 2022, 1:06:33 AM11/21/22
to Prometheus Users
HI all,

Appreciate if anyone can help or leave an input. As per title my SNMP exporter state is DOWN and when clicked it is showing unknown with error "server returned HTTP status 400 Bad Request".

I tried to capture snmp to my router (target 192.168.1.253) for testing but it seems not working.

Below is my SNMP yml :-

router:
  version: 2
  auth:
    community: onecommunity


  walk:
  - 1.3.6.1.2.1.1.3 # sysUpTime
  - 1.3.6.1.2.1.31.1 # ifHCInOctets
  - 1.3.6.1.2.1.2.2.1.10 # ifInOctets
  - 1.3.6.1.2.1.2.2.1.16
  - 1.3.6.1.2.1.31.1.1.1

  metrics:
  - name: ifHCInOctets
    oid: 1.3.6.1.2.1.31.1.1.1.6
    type: counter
    indexes:
    - labelname: interface
      type: gauge
    lookups:
      - labels: [interface]
        oid: 1.3.6.1.2.1.2.2.1.2
        labelname: DisplayString
      - labels: [interface]
        oid: 1.3.6.1.2.1.31.1.1.1.18
        labelname: alias

Below is my prometheus yml:-

  - job_name: routersnmp
    metrics_path: /snmp
    params:
      module: [router]
    static_configs:
      - targets:
        - 192.168.1.253
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 192.168.1.181:9116  # URL as shown on the UI


Below is the screenshot:-
snmpexporter1.pngsnmpexporter2.png

Brian Candler

unread,
Nov 21, 2022, 3:38:23 AM11/21/22
to Prometheus Users
The error is right there:
Unknown module "router"

Almost certainly you are running snmp_exporter to load a different config file than the SNMP.yml you've shown.

Aliff Ashraf

unread,
Nov 30, 2022, 8:30:44 PM11/30/22
to Brian Candler, Prometheus Users
Yup! This is the case. Thanks for pointing that out!

--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/9rQnf6BEeCc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/05e51ace-93d7-4234-acda-564d3f4304f1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages