prometheus dont see mikrotik snmp value

1,097 views
Skip to first unread message

Нурлан

unread,
Jul 16, 2018, 12:51:44 AM7/16/18
to Prometheus Users
Hi.

i am trying to get CPU Usage from MikroTik via SNMP v2.


snmp.yml

  version: 2
  auth
:
    community
: 777
  walk
:
 
- 1.3.6.1.2.1.25.3.3.1.2.1
  metrics
:
 
- name: hrProcessorLoad
    oid
: 1.3.6.1.2.1.25.3.3.1.2.1
    type
: gauge


# HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and processing).
# TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.101215308
# HELP snmp_scrape_pdus_returned PDUs returned from walk.
# TYPE snmp_scrape_pdus_returned gauge
snmp_scrape_pdus_returned 0
# HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
# TYPE snmp_scrape_walk_duration_seconds gauge
snmp_scrape_walk_duration_seconds 0.101179037


how you see query is working fine, but prometheus console dont see.
snmpwalk -Os -c 777 -v 2c 172.XX.XX.XX 1.3.6.1.2.1.25.3.3.1.2.1

hrProcessorLoad.1 = INTEGER: 72




Нурлан

unread,
Jul 16, 2018, 1:45:13 AM7/16/18
to Prometheus Users
no datapoints found.
 


Ben Kochie

unread,
Jul 16, 2018, 1:59:50 AM7/16/18
to Нурлан, Prometheus Users
The generator is required in order to correctly format snmp_exporter configs.

Your walk is too deep, as the snmp_exporter expects this to return an indexed set of results as there may be more than one processor.

generator.yml:
modules:
  host_resources:
    auth:
      community: xxxx
    walk:
      - hrProcessorLoad

snmp.yml:
host_resources:
  walk:
  - 1.3.6.1.2.1.25.3.3.1.2
  metrics:
  - 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
  auth:
    community: xxxx

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/a3291582-0698-4242-a885-e5d5066caaf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Нурлан

unread,
Jul 16, 2018, 2:02:23 AM7/16/18
to Prometheus Users
Ben thank you, fixed walk section, now working  :)

# HELP hrProcessorLoad 
# TYPE hrProcessorLoad gauge
hrProcessorLoad 45
# HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and processing).
# TYPE snmp_scrape_duration_seconds gauge
snmp_scrape_duration_seconds 0.067591239
# HELP snmp_scrape_pdus_returned PDUs returned from walk.
# TYPE snmp_scrape_pdus_returned gauge
snmp_scrape_pdus_returned 1
# HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
# TYPE snmp_scrape_walk_duration_seconds gauge
snmp_scrape_walk_duration_seconds 0.067425485

понедельник, 16 июля 2018 г., 11:59:50 UTC+6 пользователь Ben Kochie написал:

Нурлан

unread,
Jul 16, 2018, 7:21:47 AM7/16/18
to Prometheus Users
Someone know why graphs interrupting?







Нурлан

unread,
Jul 16, 2018, 7:23:22 AM7/16/18
to Prometheus Users
via zabbix everything is fine.



Ben Kochie

unread,
Jul 16, 2018, 9:12:24 AM7/16/18
to Нурлан, Prometheus Users
What does the `up` metric say?
What is your scrape interval?
What is your scrape timeout?
What is your query?

On Mon, Jul 16, 2018 at 1:21 PM Нурлан <nurlani...@gmail.com> wrote:
Someone know why graphs interrupting?







--
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.

Нурлан

unread,
Jul 17, 2018, 7:02:37 AM7/17/18
to Prometheus Users
Ben when graphs is interrupting, snmp metric context deadline exceeded.I am increased time out to 8 second, but it's not helping.  

scrape_timeout: 8s







prometheus.yml



# Sample config for Prometheus.


global:
  scrape_interval
:     20s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval
: 20s # Evaluate rules every 15 seconds. The default is every 1 minute.
 
# scrape_timeout is set to the global default (10s).


 
# Attach these labels to any time series or alerts when communicating with
 
# external systems (federation, remote storage, Alertmanager).
  external_labels
:

      monitor
: 'example'


# Alertmanager configuration

alerting
:

  alertmanagers
:
 
- static_configs:
   
- targets: ['localhost:9093']


# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.

rule_files
:
 
# - "first_rules.yml"
 
# - "second_rules.yml"




# A scrape configuration containing exactly one endpoint to scrape:

# Here it's Prometheus itself.

scrape_configs
:

 
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
 
- job_name: 'prometheus'

   
# Override the global default and scrape targets from this job every 5 seconds.
#    scrape_interval: 5s
    scrape_timeout
: 8s



Ben Kochie

unread,
Jul 17, 2018, 8:18:45 AM7/17/18
to Нурлан, Prometheus Users
This usually means the device is overloaded, or there is something else slowing down the scrape.

I would plot scrape_duration_seconds to see what a typical response time is.

You can also enable debug level logging on the snmp_exporter, this will show each of the individual walks and how long they take.

--
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.
Reply all
Reply to author
Forward
0 new messages