querying snmp modules

118 views
Skip to first unread message

Andrew Meyer

unread,
Jul 16, 2019, 6:42:00 PM7/16/19
to Prometheus Users
Now that I have SNMP working again I can see that the ciscoasa module has lots of other data points to monitor.  However I am not following how to test the query in prometheus query or grafana.

For example I want to try to query this:
ccaAcclDecryptOctets{ccaAcclIndex="2"} 

Would it be something like:
ccaAcclDecryptOctets{ccaAcclIndex="2", instance="1.2.3.4", job="snmp"}

This is not working in prometheus.  Looking for input.

Thanks!

Andrew Meyer

unread,
Jul 16, 2019, 6:57:54 PM7/16/19
to Prometheus Users
I think I figured it out.  

I needed to put the snmp modules in the prometheus.yml snmp job.  Separating it by a comma for each one.

Andrew Meyer

unread,
Jul 16, 2019, 9:48:32 PM7/16/19
to Prometheus Users
So here is the snmp job in my prometheus.yml

  - job_name: 'snmp'
    static_configs:
      - targets: [ 10.150.1.1, 10.150.1.2, 10.150.1.11, 10.150.1.18, 10.150.1.19, 10.150.1.20, 192.168.125.1, 192.168.125.3, 192.168.125.25, 192.168.125.26, 192.168.220.1, 192.168.220.20, 10.20.30.1 ]
    scrape_interval: 15s
    metrics_path: /snmp
    params:
      module: [if_mib,ciscoasa,f5,fortinet,hp,juniper,aruba,aerohive,tp-link,netapp,printer_mib,synology,Cisco,cisco_wlc]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.150.10.25:9116
    #file_sd_configs:
    #  - files:
    #    - '/etc/prometheus/snmp-devices.yml'

So when I can go to the prometheus dashboard site and put in ccaAcclHashOutboundPkts{ccaAcclIndex="2"} for instance, I get nothing returned.  Even if I shorten it to ccaAcclHashOutboundPkts I get nothing.

Thoughts?

Ben Kochie

unread,
Jul 17, 2019, 2:52:50 AM7/17/19
to Andrew Meyer, Prometheus Users
While the param feature in the prometheus.yml takes multiple options, the snmp_exporter only takes one module at a time. You need to separate them into different jobs.

 - job_name: 'snmp_if_mib'
    static_configs:
      - targets:
        - if-mib-target1
        - if-mib-target2
    metrics_path: /snmp
    params:
      module:
      - if_mib

    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.150.10.25:911
 - job_name: 'snmp_if_ciscoasa'
    static_configs:
      - targets:
        - asa-target1
        - asa-target2
    metrics_path: /snmp
    params:
      module:
      - ciscoasa

    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.150.10.25:911
--
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/e0be9ea2-641c-4a96-b332-938d70f7e0f9%40googlegroups.com.

Andrew Meyer

unread,
Jul 17, 2019, 9:30:44 AM7/17/19
to Prometheus Users
I thought so.  I want to say I had it set up this previously.  But its working now! 

Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to promethe...@googlegroups.com.

Andrew Meyer

unread,
Jul 17, 2019, 10:25:24 AM7/17/19
to Prometheus Users
Ok.  Now I am having problems making this work.  Prometheus and the snmp_exporter start but querying a cisco aironet (cisco_wlc) is not working.  I have tried snmp_cisco_wlc and snmp_ciscowlc.  No dice.  What am I doing wrong?

  - job_name: 'snmp_ciscowlc'
    static_configs:
      - targets: [ 192.168.125.25,192.168.125.26 ]
    scrape_interval: 15s
    metrics_path: /snmp
    params:
      module: [cisco_wlc]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.150.10.25:9116

Khanh Nguyen Duc

unread,
Aug 21, 2020, 2:41:10 AM8/21/20
to Prometheus Users
can you share your generator.yml file


Vào lúc 21:25:24 UTC+7 ngày Thứ Tư, 17 tháng 7, 2019, andre...@gmail.com đã viết:
Reply all
Reply to author
Forward
0 new messages