collected metric: was collected before with the same name and label values

171 views
Skip to first unread message

Michael S

unread,
Aug 24, 2023, 1:18:19 PM8/24/23
to Prometheus Users
Hi,
Im using snmp_exporter to monitor Server, Network and USPs with snmp_exporter. I generated the snmp.yml file with the official snmp_exporter generator from github.


cat generator.yml
---
modules:
#http://oidref.com/1.3.6.1.4.1.674.10892.5
  outOfBandGroup:
    walk:
      - 1.3.6.1.4.1.674.10892.5
  apcups:
    walk:
      - 1.3.6.1.4.1.318.1.1.1.12
      - 1.3.6.1.4.1.318.1.1.1.2
      - 1.3.6.1.4.1.318.1.1.1.3
      - 1.3.6.1.4.1.318.1.1.1.4
      - 1.3.6.1.4.1.318.1.1.1.7.2
      - 1.3.6.1.4.1.318.1.1.10.2.3.2
      - 1.3.6.1.4.1.318.1.1.26.10.2.2
      - 1.3.6.1.4.1.318.1.1.26.4.3
      - 1.3.6.1.4.1.318.1.1.26.6.3
      - 1.3.6.1.4.1.318.1.1.26.8.3
    #get:
    #  - 1.3.6.1.4.1.318.1.1.1.8.1.0
  if_mib:
    walk:
      - 1.3.6.1.2.1.2
      - 1.3.6.1.2.1.31.1.1
    #get:
    #  - 1.3.6.1.2.1.1.3.0

The Server Monitoring with outOfBandGroup & if_mib does work without any problems, but apcups gets the error.

cat prometheus.yml
global:
  scrape_interval:     15s
  evaluation_interval: 15s
  external_labels:
     monitor: 'Linux'

rule_files:
  - "prometheus.rules.yml"
  - "alert.rules.yml"

alerting:
    alertmanagers:
     - static_configs:
         - targets:
            - prom01.xxxx.xx:9093

scrape_configs:
  - job_name: prometheus
    static_configs:
     - targets: [prom01.xxxx.xx:9090]

  - job_name: node
    scrape_interval: 15s
    static_configs:
     - targets: [prom01.xxx.xx:9100]

  - job_name: 'snmpServer'
    scrape_interval: 2m
    scrape_timeout: 2m
    static_configs:
      - targets:
#Ansible SNMP
       - server01
       - server02
    metrics_path: /snmp
    params:
      #auth: [public_v2]
      module: [outOfBandGroup]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: prom01.xxx.xx:9116  # The SNMP exporter's real hostname:port.

  - job_name: 'snmpNetwork'
    scrape_interval: 2m
    scrape_timeout: 2m
    static_configs:
      - targets:
#Ansible SNMPNETWORK
       - switch01
       - switch02
    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: prom01.xxx.xx:9116  # The SNMP exporter's real hostname:port.

  - job_name: 'snmpUPS'
    scrape_interval: 2m
    scrape_timeout: 2m
    static_configs:
      - targets:
#Ansible SNMPUPS
        - usv-rack01-01.xxx.xx
    metrics_path: /snmp
    params:
      #auth: [public_v2]
      module: [apcups]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: prom01.xxx.xx:9116  # The SNMP exporter's real hostname:port.

curl -g 'http://prom01.xxx.xx:9116/snmp?target=usv-rack01-01.xxx.xx&module=apcups'
An error has occurred while serving metrics:

110 error(s) occurred:
* collected metric "upsHighPrecBatteryPackSerialNumber" { label:<name:"upsHighPrecBatteryPackSerialNumber" value:"2" > gauge:<value:1 > } was collected before with the same name and label values
* collected metric "upsHighPrecBatteryPackSerialNumber" { label:<name:"upsHighPrecBatteryPackSerialNumber" value:"5" > gauge:<value:1 > } was collected before with the same name and label values
* collected metric "upsHighPrecBatteryPackTemperature" { label:<name:"upsHighPrecBatteryPackTemperature" value:"11" > gauge:<value:0 > } was collected before with the same name and label values
* collected metric "upsHighPrecBatteryPackCartridgeReplaceDate" { label:<name:"upsHighPrecBatteryPackCartridgeReplaceDate" value:"2" > gauge:<value:1 > } was collected before with the same name and label values
* collected metric "upsHighPrecBatteryPackTemperature" { label:<name:"upsHighPrecBatteryPackTemperature" value:"2" > gauge:<value:210 > } was collected before with the same name and label values

As i generated the snmp.yml with this official generator i do not know how to handle this.

I also attached the snmp.yml im using. Of course i noticed that there are labelnames(indexes) doubled but that the way the snmp.yml file was generated.

for example:
- name: upsOutletGroupStatusIndex
      oid: 1.3.6.1.4.1.318.1.1.1.12.1.2.1.1
      type: gauge
      help: The index to the outlet group entry. - 1.3.6.1.4.1.318.1.1.1.12.1.2.1.1
      indexes:
      - labelname: upsOutletGroupStatusIndex
        type: gauge
    - name: upsOutletGroupStatusName
      oid: 1.3.6.1.4.1.318.1.1.1.12.1.2.1.2
      type: DisplayString
      help: The name of the outlet group - 1.3.6.1.4.1.318.1.1.1.12.1.2.1.2
      indexes:
      - labelname: upsOutletGroupStatusIndex
        type: gauge

Every help is appreciated!!!

snmp.yml.new

Ben Kochie

unread,
Aug 24, 2023, 1:23:39 PM8/24/23
to Michael S, Prometheus Users
Can you include a snmpwalk command line output of 1.3.6.1.4.1.318.1.1.1.2.3.10.2.1.4?

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/1a8ce7da-bae4-4ba2-9b6d-6ccfd8444651n%40googlegroups.com.

Michael S

unread,
Aug 24, 2023, 1:32:00 PM8/24/23
to Prometheus Users
Hi,
thanks for fast respondes... i forgot all snmpwalks i tried did work:
snmpwalk -v 2c -c public usv-rack01-01.xxx.xx 1.3.6.1.4.1.318.1.1.1.2.3.10.2.1.4
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.1.1.1 = STRING: "                "
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.1.1.2 = STRING: "                "
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.2.1.1 = STRING: "5S2120T51071    "
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.2.1.2 = STRING: "5S2120T51071    "
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.3.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.3.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.4.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.4.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.5.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.5.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.6.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.6.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.7.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.7.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.8.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.8.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.9.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.9.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.10.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.10.1.2 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.11.1.1 = ""
SNMPv2-SMI::enterprises.318.1.1.1.2.3.10.2.1.4.11.1.2 = ""

snmpwalk -v 2c -c public usv-rack01-01.xxx.xx 1.3.6.1.4.1.318.1.1.1.12
SNMPv2-SMI::enterprises.318.1.1.1.12.1.1.0 = INTEGER: 4
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.1.2 = INTEGER: 2
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.1.3 = INTEGER: 3
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.1.4 = INTEGER: 4
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.2.1 = STRING: "Unswitched Group"
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.2.2 = STRING: "Outlet Group 1"
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.2.3 = STRING: "Outlet Group 2"
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.2.4 = STRING: "Outlet Group 3"
SNMPv2-SMI::enterprises.318.1.1.1.12.1.2.1.3.1 = INTEGER: 1

so i really think its a problem with the snmp.yml or/and prometheus as i also said outOfBandGroup and if_mib already worked
Reply all
Reply to author
Forward
0 new messages