Connecting the dots between, smnp_exporter > prometheus > meraki > Grafana

  • What Grafana version and what operating system are you using?
    grafana the latest not sure where to find the verion number
  • What are you trying to achieve?
    Make it work between the 4
  • How are you trying to achieve it?
    Follwing documentaion the proper config and yml files
  • What happened?
    Can’t get it to work is get parsing errors, then bad request s
  • What did you expect to happen?
    for it to successufullly scrap data so I can start using grafana
  • Can you copy/paste the configuration(s) that you are having problems with?
# SNMP Exporter Configuration File
# Manually created to bypass generator issues.

# Configuration file version.
version: 2

# Authentication and community strings.
auths:
  # Default SNMPv1 public community (optional, keep if needed)
  public_v1:
    version: 1
    community: public

  # Default SNMPv2c public community (optional, keep if needed)
  public_v2:
    version: 2
    community: public  # --- Your Meraki SNMPv2c Authentication ---
  # This is the authentication method the exporter will use when 'auth: [meraki_v2c]' is specified.
  meraki_v2c:
    version: 2
    community: 002QWwJxAXqH4WC1cNY6 # <--- **Ensure this is your actual Meraki SNMPv2c community string**


# SNMP modules
# Each module defines a set of OIDs to collect and how to structure the metrics.
modules:
  # Standard system information (using numeric OIDs).
  # Metrics from SNMPv2-MIB and HOST-RESOURCES-MIB.
  system:
    walk:
    - .1.3.6.1.2.1.1 # system subtree (sysDescr, sysObjectID, sysUpTime, etc.)
    - .1.3.6.1.2.1.25.1.1 # hrSystemUptime (Host Resources MIB uptime)
    metrics:
    - name: snmp_sysDescr
      oid: .1.3.6.1.2.1.1.1
      type: OctetString
      help: A textual description of the entity.
    - name: snmp_sysObjectID
      oid: .1.3.6.1.2.1.1.2
      type: OctetString
      help: The vendor's authoritative identification of the network management subsystem contained in the entity.
    - name: snmp_sysUpTime_seconds
      oid: .1.3.6.1.2.1.1.3
      type: counter # Uptime is typically a counter
      help: The time (in hundredths of a second) since the network management portion of the system was last re-initialized. Converted to seconds.
      transform: "x/100" # Convert hundredths of a second to seconds
    - name: snmp_sysContact
      oid: .1.3.6.1.2.1.1.4
      type: OctetString
      help: The textual identification of the contact person for this managed node.
    - name: snmp_sysName
      oid: .1.3.6.1.2.1.1.5
      type: OctetString
      help: An administratively-assigned name for this managed node.
    - name: snmp_sysLocation
      oid: .1.3.6.1.2.1.1.6
      type: OctetString
      help: The physical location of this node.
    - name: snmp_sysServices
      oid: .1.3.6.1.2.1.1.7
      type: gauge
      help: A value which indicates the set of services that this entity primarily offers.
    - name: snmp_hrSystemUptime_seconds
      oid: .1.3.6.1.2.1.25.1.1
      type: counter # Uptime is typically a counter
      help: The time (in hundredths of a second) since the host system was last initialized. Converted to seconds.
      transform: "x/100" # Convert hundredths of a second to seconds

  # Standard interface metrics (using numeric OIDs).
  # Metrics from IF-MIB.
  if_mib:
    walk:
    - .1.3.6.1.2.1.2.2 # ifTable (contains interface entries)
    metrics:
    - name: snmp_ifIndex
      oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
      type: gauge
      help: A unique value, greater than zero, for each interface.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex is both the metric and the index
        type: gauge
    - name: snmp_ifDescr
      oid: .1.3.6.1.2.1.2.2.1.2 # ifDescr
      type: OctetString
      help: A textual string containing information about the interface.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifType
      oid: .1.3.6.1.2.1.2.2.1.3 # ifType
      type: gauge
      help: The type of interface.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifSpeed
      oid: .1.3.6.1.2.1.2.2.1.5 # ifSpeed
      type: gauge
      help: An estimate of the interface's current bandwidth in bits per second.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifAdminStatus
      oid: .1.3.6.1.2.1.2.2.1.7 # ifAdminStatus
      type: gauge
      help: The desired state of the interface (1=up, 2=down, 3=testing).
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifOperStatus
      oid: .1.3.6.1.2.1.2.2.1.8 # ifOperStatus
      type: gauge
      help: The current operational state of the interface (1=up, 2=down, 3=testing, 4=unknown, 5=dormant, 6=notPresent, 7=lowerLayerDown).
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifInOctets
      oid: .1.3.6.1.2.1.2.2.1.10 # ifInOctets (32-bit counter)
      type: counter
      help: The total number of octets received on the interface.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifOutOctets
      oid: .1.3.6.1.2.1.2.2.1.16 # ifOutOctets (32-bit counter)
      type: counter
      help: The total number of octets transmitted on the interface.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifInErrors
      oid: .1.3.6.1.2.1.2.2.1.14 # ifInErrors
      type: counter
      help: The number of inbound packets that contained errors.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    - name: snmp_ifOutErrors
      oid: .1.3.6.1.2.1.2.2.1.20 # ifOutErrors
      type: counter
      help: The number of outbound packets that could not be transmitted due to errors.
      indexes:
      - labelname: ifIndex
        oid: .1.3.6.1.2.1.2.2.1.1 # ifIndex
        type: gauge
    # Use ifHCInOctets/ifHCOutOctets if your device supports 64-bit counters
    # ifHCInOctets: .1.3.6.1.2.1.31.1.1.1.6
    # ifHCOutOctets: .1.3.6.1.2.1.31.1.1.1.10
    lookups:
    - source_indexes: [ .1.3.6.1.2.1.2.2.1.1 ] # Use ifIndex as the key
      lookup: .1.3.6.1.2.1.2.2.1.2 # Look up the ifDescr OID
      labelname: ifDescr # Add a label named 'ifDescr'
      type: OctetString
    - source_indexes: [ .1.3.6.1.2.1.2.2.1.1 ] # Use ifIndex as the key
      lookup: .1.3.6.1.2.1.31.1.1.1.1 # Look up the ifName OID (another common label)
      labelname: ifName # Add a label named 'ifName'
      type: OctetString

  # --- Your Meraki Module Definition (using numeric OIDs) ---
  # Metrics from the MERAKI-CLOUD-CONTROLLER-MIB.
  meraki:
    walk:
    - .1.3.6.1.4.1.29671.1.1.4.1:161 # Meraki Device Entry Table, explicitly on port 161
    - .1.3.6.1.4.1.29671.1.1.5.1:161 # Meraki Device Interface Table, explicitly on port 161

    metrics:
    # --- Metrics from the Meraki Device Table (.1.3.6.1.4.1.29671.1.1.4.1) ---
    - name: meraki_device_status
      oid: .3 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.4.1.3 - devStatus)
      type: gauge # Status is a gauge (0=offline, 1=online)
      help: Meraki device connection status (0=offline, 1=online).
      indexes:
        - labelname: dev_mac
          oid: .1 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.4.1.1 - devMac)
          type: octetstring # MAC address type
    - name: meraki_device_client_count
      oid: .5 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.4.1.5 - devClientCount)
      type: gauge # Client count is a gauge
      help: Number of clients currently associated with the Meraki device.
      indexes:
        - labelname: dev_mac
          oid: .1 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.4.1.1 - devMac)
          type: octetstring

    # --- Metrics from the Meraki Device Interface Table (.1.3.6.1.4.1.29671.1.1.5.1) ---
    - name: meraki_interface_sent_bytes
      oid: .6 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.5.1.6 - devInterfaceSentBytes)
      type: counter # Bytes are counters
      help: Total number of bytes transmitted on the Meraki interface.
      indexes:
        - labelname: dev_mac # First index is the device MAC
          oid: .1 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.5.1.1 - devInterfaceDevMac)
          type: octetstring
        - labelname: interface_index # Second index is the interface index
          oid: .2 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.5.1.2 - devInterfaceIndex)
          type: gauge # Index is a number

    - name: meraki_interface_recv_bytes
      oid: .7 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.5.1.7 - devInterfaceRecvBytes)
      type: counter # Bytes are counters
      help: Total number of bytes received on the Meraki interface.
      indexes:
        - labelname: dev_mac
          oid: .1 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.5.1.1 - devInterfaceDevMac)
          type: octetstring
        - labelname: interface_index
          oid: .2 # OID relative to the walk OID (.1.3.6.1.4.1.29671.1.1.5.1.2 - devInterfaceIndex)
          type: gauge

    lookups:
      # --- Lookups for the Device Table ---
      # Lookup the device name (devName) using the device MAC index
      - source_indexes: [ .1 ] # Source index is the relative OID of devMac from the Device Table walk (.1.3.6.1.4.1.29671.1.1.4.1.1)
        lookup: .1.3.6.1.4.1.29671.1.1.4.1.2 # Absolute OID for devName
        labelname: dev_name
        type: DisplayString

      # --- Lookups for the Device Interface Table ---
      # Lookup the interface name (devInterfaceName) using the device MAC and interface index
      - source_indexes: [ .1, .2 ] # Source indexes are relative OIDs of devInterfaceDevMac (.1) and devInterfaceIndex (.2) from the Interface Table walk
        lookup: .1.3.6.1.4.1.29671.1.1.5.1.3 # Absolute OID for devInterfaceName
        labelname: interface_name
        type: DisplayString

Here is the prometheus config:

global:
  scrape_interval: 15s # Default scrape interval
  evaluation_interval: 15s # Default evaluation interval

scrape_configs:
  # Job for Prometheus itself (good practice for self-monitoring)
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090'] # Prometheus runs on port 9090 by default

  # Job for Uptime Kuma
  - job_name: 'uptime-kuma'
    metrics_path: /metrics # Default metrics path for Uptime Kuma [8, 9]
    scheme: http # Uptime Kuma metrics are at http://10.101.11.108:3001
    static_configs:
      - targets: ['10.101.11.108:3001'] # Uptime Kuma IP address and port
    basic_auth:
      username: 'admin'
      password: 'uk2_qUL3AhrpnVNZiWYuy2BwY21n3lzFE8cAAVghdraO' # User-provided credentials

# This goes inside your existing scrape_configs: section
# along with any other jobs you have.

  # --- CORRECTED MERAKI JOB STARTS HERE ---
  - job_name: 'meraki_exporter_org_367558'  # Ensure this '-' is aligned with other job_names
    metrics_path: /
    params:
      target: ['367558'] # Your Organization ID
    static_configs:
      - targets: ['10.101.11.108:9822'] # IP and port of your Meraki Exporter  <--- Removed extra text from here

# Add this job to your scrape_configs section in prometheus.ym
   - job_name: 'snmp'
     static_configs:
      - targets:['10.101.199.2:161'] # The IP of your Meraki device
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.101.11.108:9116 # Replace with the actual IP and port of your SNMP exporter
      - source_labels: [__param_target]
        regex: (.*)
        target_label: snmp_target
        replacement: $1
      - target_label: __param_module
        replacement: meraki # The module defined in your snmp.yml
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    NO
  • Did you follow any online instructions? If so, what is the URL? Gemini got me started but it could finish the job for me