SNMP Exporter Config Generator issue

1,711 views
Skip to first unread message

acm...@gmail.com

unread,
May 30, 2018, 5:57:26 PM5/30/18
to Prometheus Users
Trying to override mtxrFirmwareVersion from Mikrotik.mib, using docker SNMP Exporter Config Generator. Generation completes successfully but mtxrFirmwareVersion returns no data in Prometheus graph query. Here are both of generator.yml and snmp.yml files.

generator.yml:

  mikrotik_private:  # The module name. You can have as many modules as you want.    walk:       # List of OIDs to walk. Can also be SNMP object names or specific instances.

     
- hrProcessorLoad # CPU Load
     
- hrSystemUptime # System Uptime
     
- ifInOctets # Incoming Traffic on the interface
     
- ifOutOctets # Outgoing Traffic on the interface
     
- mtxrSerialNumber
     
- mtxrFirmwareVersion

    overrides
:
      mtxrFirmwareVersion
:
        type
: DisplayString
        regex_extracts
:
         
Value:
           
- regex: '(.*)'
              value
: '$1'

    version
: 3  # SNMP version to use. Defaults to 2.
               
# 1 will use GETNEXT, 2 and 3 use GETBULK.
    max_repetitions
: 25  # How many objects to request with GET/GETBULK, defaults to 25.
                         
# May need to be reduced for buggy devices.
    retries
: 3   # How many times to retry a failed request, defaults to 3.
    timeout
: 10s # Timeout for each walk, defaults to 10s.

    auth
:
     
# Community string is used with SNMP v1 and v2. Defaults to "public".
      community
: snmp

     
# v3 has different and more complex settings.
     
# Which are required depends on the security_level.
     
# The equivalent options on NetSNMP commands like snmpbulkwalk
     
# and snmpget are also listed. See snmpcmd(1).
      username
: snmp #Required, no default. -u option to NetSNMP.
      security_level
: authNoPriv  # Defaults to noAuthNoPriv. -l option to NetSNMP.
                                   
# Can be noAuthNoPriv, authNoPriv or authPriv.
      password
: snmp  # Has no default. Also known as authKey, -A option to NetSNMP.
                     
# Required if security_level is authNoPriv or authPriv.
      auth_protocol
: MD5  # MD5 or SHA, defaults to SHA. -a option to NetSNMP.
                         
# Used if security_level is authNoPriv or authPriv.
#      priv_protocol: DES  # DES or AES, defaults to DES. -x option to NetSNMP.
                         
# Used if security_level is authPriv.
#      priv_password: # Has no default. Also known as privKey, -X option to NetSNMP.
                               
# Required if security_level is authPriv.
#      context_name: context # Has no default. -n option to NetSNMP.
                           
# Required if context is configured on the device.


snmp.yml:

mikrotik_private:
  walk
:
 
- 1.3.6.1.2.1.2.2.1.10
 
- 1.3.6.1.2.1.2.2.1.16
 
- 1.3.6.1.2.1.25.3.3.1.2
 
get:
 
- 1.3.6.1.2.1.25.1.1.0
 
- 1.3.6.1.4.1.14988.1.1.7.4.0
  metrics
:
 
- name: ifInOctets
    oid
: 1.3.6.1.2.1.2.2.1.10
    type
: counter
    help
: The total number of octets received on the interface, including framing
      characters
. - 1.3.6.1.2.1.2.2.1.10
    indexes
:
   
- labelname: ifIndex
      type
: gauge
 
- name: ifOutOctets
    oid
: 1.3.6.1.2.1.2.2.1.16
    type
: counter
    help
: The total number of octets transmitted out of the interface, including framing
      characters
. - 1.3.6.1.2.1.2.2.1.16
    indexes
:
   
- labelname: ifIndex
      type
: gauge
 
- name: hrSystemUptime
    oid
: 1.3.6.1.2.1.25.1.1
    type
: gauge
    help
: The amount of time since this host was last initialized - 1.3.6.1.2.1.25.1.1
 
- name: hrProcessorLoad
    oid
: 1.3.6.1.2.1.25.3.3.1.2
    type
: gauge
    help
: The average, over the last minute, of the percentage of time that this processor
      was
not idle - 1.3.6.1.2.1.25.3.3.1.2
    indexes
:
   
- labelname: hrDeviceIndex
      type
: gauge
 
- name: mtxrFirmwareVersion
    oid
: 1.3.6.1.4.1.14988.1.1.7.4
    type
: DisplayString
    help
: Current firmware version - 1.3.6.1.4.1.14988.1.1.7.4
    regex_extracts
:
     
Value:
     
- value: $1
        regex
: ^(?:(.*))$
  version
: 3
  max_repetitions
: 25
  retries
: 3
  timeout
: 10s
  auth
:
    community
: snmp
    security_level
: authNoPriv
    username
: snmp
    password
: snmp
    auth_protocol
: MD5


Ben Kochie

unread,
May 31, 2018, 2:01:03 AM5/31/18
to acm...@gmail.com, Prometheus Users
mtxrFirmwareVersion is a string, you should not need to use a regexp on it.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/dbdc9191-cdb1-493c-b6e5-0fdb95089316%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

acm...@gmail.com

unread,
May 31, 2018, 2:52:30 AM5/31/18
to Prometheus Users
Couldn't you tell what should I write then?

четверг, 31 мая 2018 г., 9:01:03 UTC+3 пользователь Ben Kochie написал:

Ben Kochie

unread,
May 31, 2018, 3:06:59 AM5/31/18
to acm...@gmail.com, Prometheus Users
You can omit the overrides section, it should work without it.  You only need to include the mtxrFirmwareVersion in the walk section.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
Message has been deleted

acm...@gmail.com

unread,
May 31, 2018, 3:29:44 AM5/31/18
to Prometheus Users

I would have happily done it but I don't get the desired result:



четверг, 31 мая 2018 г., 10:06:59 UTC+3 пользователь Ben Kochie написал:
You can omit the overrides section, it should work without it.  You only need to include the mtxrFirmwareVersion in the walk section.
On Thu, May 31, 2018 at 8:52 AM, <acm...@gmail.com> wrote:
Couldn't you tell what should I write then?

четверг, 31 мая 2018 г., 9:01:03 UTC+3 пользователь Ben Kochie написал:
mtxrFirmwareVersion is a string, you should not need to use a regexp on it.

--
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 post to this group, send email to promethe...@googlegroups.com.

Brian Brazil

unread,
May 31, 2018, 3:31:26 AM5/31/18
to acm...@gmail.com, Prometheus Users
On 31 May 2018 at 08:29, <acm...@gmail.com> wrote:

I would have happily done it but I don't get the desired result:


What result were you expecting?

Brian
 
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/5f895224-d923-4beb-bbbe-fee890d13fd3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Ben Kochie

unread,
May 31, 2018, 3:31:31 AM5/31/18
to Pasha Qwerty, Prometheus Users
That is the only possible result for version strings.

"6.43rc19" can not be converted into a float.

For additional information, see this blog post:



On Thu, May 31, 2018 at 9:12 AM, <acm...@gmail.com> wrote:

I would have happily done it but I don't get the desired result:



четверг, 31 мая 2018 г., 9:52:30 UTC+3 пользователь acm...@gmail.com написал:
Couldn't you tell what should I write then?

четверг, 31 мая 2018 г., 9:01:03 UTC+3 пользователь Ben Kochie написал:
mtxrFirmwareVersion is a string, you should not need to use a regexp on it.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages