Hi All,
      I'm trying to get the snmp exporter working so I can get BGP peer 
state metrics off our routers.  It works locally on my machine but when I 
run the same config on the server I need this to run on it doesn't work.  
So there's obviously some config I'm missing on the server.  I don't think, 
it's the MIB file that's missing.  If I run snmptranslate and specify the 
MIB is brings back a numerical value as expected

*snmptranslate -m BGP4-MIB -IR -On bgpPeerState *

*.1.3.6.1.2.1.15.3.1.2*

When I try and query the 'bgp4' module this is the output I get.  


*level=info ts=2020-03-24T10:53:35.919Z caller=main.go:149 msg="Starting 
snmp_exporter" version="(version=0.17.0, branch=HEAD, 
revision=f0ad4551a5c2023e383bc8dde2222f47dc760b83)"*
*level=info ts=2020-03-24T10:53:35.919Z caller=main.go:150 
build_context="(go=go1.13.8, user=root@cb51f17d52f8, 
date=20200217-09:26:25)"*
*level=info ts=2020-03-24T10:53:35.932Z caller=main.go:243 msg="Listening 
on address" address=:9117*
*panic: Unknown index type IpAddress*

*goroutine 29 [running]:*
*main.indexOidsAsString(0xc00032e1d0, 0x4, 0x6, 0xc0001da840, 0x9, 0x0, 
0x415800, 0x7fb91dc8fa00, 0x300, 0x7fb91de76fff, ...)*
* /app/collector.go:665 +0x1870*
*main.indexesToLabels(0xc00032e1d0, 0x4, 0x6, 0xc00021b280, 0xc00027da80, 
0x8001c00027d928)*
* /app/collector.go:676 +0x169*
*main.pduToSamples(0xc00032e1d0, 0x4, 0x6, 0xc00027dab0, 0xc00021b280, 
0xc00027da80, 0xabee20, 0xc000252360, 0x0, 0x0, ...)*
* /app/collector.go:329 +0x77*
*main.collector.Collect(0xaca540, 0xc000098dc0, 0xc0000ca651, 0xb, 
0xc000124d20, 0xabee20, 0xc000252360, 0xc000095020)*
* /app/collector.go:247 +0x934*
*github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()*
* 
/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:443 
+0x19d*
*created by 
github.com/prometheus/client_golang/prometheus.(*Registry).Gather*
* 
/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:454 
+0x57d*


Has anyone any idead on this.  The server is running Centos 7.5 with 
netsnmp installed.

Here is the section of the bgp4 module on in the snmp.yml file


bgp4:
auth: 
community: "xxxxxxxxx"
version: 2
walk:
- 1.3.6.1.2.1.15.2
- 1.3.6.1.2.1.15.3
metrics:
- name: bgpLocalAs
oid: 1.3.6.1.2.1.15.2
- name: bgpPeerState
oid: 1.3.6.1.2.1.15.3.1.2
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerAdminStatus
oid: 1.3.6.1.2.1.15.3.1.3
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerNegotiatedVersion
oid: 1.3.6.1.2.1.15.3.1.4
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerLocalPort
oid: 1.3.6.1.2.1.15.3.1.6
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerRemotePort
oid: 1.3.6.1.2.1.15.3.1.8
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerRemoteAs
oid: 1.3.6.1.2.1.15.3.1.9
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerInUpdates
oid: 1.3.6.1.2.1.15.3.1.10
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerOutUpdates
oid: 1.3.6.1.2.1.15.3.1.11
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerInTotalMessages
oid: 1.3.6.1.2.1.15.3.1.12
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerOutTotalMessages
oid: 1.3.6.1.2.1.15.3.1.13
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerFsmEstablishedTransitions
oid: 1.3.6.1.2.1.15.3.1.15
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerFsmEstablishedTime
oid: 1.3.6.1.2.1.15.3.1.16
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerConnectRetryInterval
oid: 1.3.6.1.2.1.15.3.1.17
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerHoldTime
oid: 1.3.6.1.2.1.15.3.1.18
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerKeepAlive
oid: 1.3.6.1.2.1.15.3.1.19
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerHoldTimeConfigured
oid: 1.3.6.1.2.1.15.3.1.20
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerKeepAliveConfigured
oid: 1.3.6.1.2.1.15.3.1.21
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerMinASOriginationInterval
oid: 1.3.6.1.2.1.15.3.1.22
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerMinRouteAdvertisementInterval
oid: 1.3.6.1.2.1.15.3.1.23
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7
- name: bgpPeerInUpdateElapsedTime
oid: 1.3.6.1.2.1.15.3.1.24
indexes:
- labelname: bgpPeerIdentifier
type: IpAddress
lookups:
- labels: [bgpPeerIdentifier]
labelname: bgpPeerRemoteAddr
oid: 1.3.6.1.2.1.15.3.1.7

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/c8295290-2168-4779-a747-259d25507252%40googlegroups.com.

Reply via email to