Hi Ben,

I ran another VM and used roles:
-  https://github.com/cloudalchemy/ansible-snmp-exporter
-  https://github.com/cloudalchemy/ansible-prometheus

along with Grafana. Prometheus, node.exporter and Grafana work as intended
(as before).

However, when I try to enable snmp_exporter:
  - job_name: snmp
    metrics_path: /snmp
    params:
      module:
      - if_mib
    relabel_configs:
    - source_labels:
      - __address__
      target_label: __param_target
    - source_labels:
      - __param_target
      target_label: instance
    - replacement: 127.0.0.1:9116
      target_label: __address__
    static_configs:
    - targets:
      - 192.168.10.187

I get error in syslog:
Aug 21 14:43:23 monnew snmp_exporter[363]: level=info
ts=2020-08-21T12:43:23.189Z caller=collector.go:224 module=if_mib
target=192.168.10.187 msg="Error scraping target" err="scrape canceled
(possible timeout) getting target 192.168.10.187"

snmp is enabled on device on 192.168.10.187. I tried snmp version 2c and 3
but the error message is the same. I can connect on that IP:port from
prometheus/snmp_exporter node:
root@monnew:~# telnet 192.168.10.187 161
Trying 192.168.10.187...
Connected to 192.168.10.187.
Escape character is '^]'.


Port 9116 is opened on localhost on prometheus/snmp_exporter node:
root@monnew:/etc/snmp_exporter# netstat -na|grep 9116
tcp        0      0 127.0.0.1:35274         127.0.0.1:9116
 ESTABLISHED
tcp6       0      0 :::9116                 :::*                    LISTEN
tcp6       0      0 127.0.0.1:9116          127.0.0.1:35274
ESTABLISHED
root@monnew:/etc/snmp_exporter# telnet 127.0.0.1 9116
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

What I am missing here is that generator thing. I didn't install any  mibs
in this case, and, from what I see in Ansible role, no mibs or generator
has been set/run.

Instead, snmp.yml file is being pulled from remote location:
"https://raw.githubusercontent.com/prometheus/snmp_exporter/v{{
snmp_exporter_version }}/snmp.yml"

Could you shed some light here, because I am obviously missing some step
along the way.

Thanks in advance!

Best regards,

Mario.


fre. 21. aug. 2020 kl. 11:05 skrev Mario Pranjic <mario.pran...@gmail.com>:

> Hm.
>
> I wrote the roles myself for Prometheus and Grafana but I used debian
> packages for Prometheus and external repository for Grafana.
>
> I am fully aware Debian often has older versions of packages (sometimes
> pretty old). To be able to use prometheus repository (as Grafana provides
> one), would make our lives a lot easier. :)
>
> I will look into these and see if things are better with newer versions.
>
> Thanks for the tip!
>
> Best regards,
>
> Mario.
>
> fre. 21. aug. 2020 kl. 10:42 skrev Ben Kochie <sup...@gmail.com>:
>
>> I highly recommend against using the Debian packages, as they are
>> extremely out of date.
>>
>> If you're using Ansible, you can use these high quality roles.
>>
>> https://github.com/cloudalchemy
>>
>> For example, https://github.com/cloudalchemy/ansible-prometheus
>>
>> We are planning an official Deb repo, but it's not ready yet.
>>
>> For the generator, it's going to be one thing you do need to build,
>> because it needs to be compiled with a distro specific net-snmp dev package.
>>
>> On Fri, Aug 21, 2020, 10:37 Mario Pranjic <mario.pran...@gmail.com>
>> wrote:
>>
>>> Hi Ben,
>>> I use versions available in Debian repository:
>>> ii  prometheus                              2.7.1+ds-3+b11
>>>  amd64        Monitoring system and time series database
>>> ii  prometheus-alertmanager                 0.15.3+ds-3+b1
>>>  amd64        Handle and deliver alerts created by Prometheus
>>> ii  prometheus-node-exporter                0.17.0+ds-3+b11
>>>   amd64        Prometheus exporter for machine metrics
>>> ii  prometheus-snmp-exporter                0.14.0+ds-1+b10
>>>   amd64        Prometheus exporter for SNMP-enabled devices
>>>
>>> I try building as little as possible since all provisioning is handled
>>> by Ansible at the end.
>>>
>>> If there is prometheus external repository for Debian, that could be
>>> worth checking, but I didn't find one.
>>>
>>>
>>> fre. 21. aug. 2020 kl. 10:25 skrev Ben Kochie <sup...@gmail.com>:
>>>
>>>> What version is this, it's likely out of date. I would recommend
>>>> building from source.
>>>>
>>>> On Thu, Aug 20, 2020, 21:11 Mario Polario <mario.pran...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to set-up prometheus-snmp-exporter to collect data from my
>>>>> Synology NAS.
>>>>> I downloaded mibs (Synology mibs included) to /usr/share/snmp/mibs.
>>>>>
>>>>> When running prometheus-snmp-generator I get an error:
>>>>>
>>>>> root@monitoring:/etc/prometheus# prometheus-snmp-generator generate
>>>>>
>>>>> INFO[0000] Loading MIBs from
>>>>> $HOME/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
>>>>> source="net_snmp.go:136"
>>>>> WARN[0000] NetSNMP reported 2 parse errors
>>>>>  source="main.go:103"
>>>>> FATA[0000] Error parsing yml config: Invalid metric type override
>>>>> 'EnumAsInfo'  source="main.go:44"
>>>>>
>>>>>
>>>>> I tried removing all from generator.yml except Synology module, but no
>>>>> change.
>>>>>
>>>>> I was following instructions noted
>>>>> in /usr/share/doc/prometheus-snmp-exporter/README.Debian but I can't seem
>>>>> to generate snmp.yml file.
>>>>>
>>>>> Any help in understanding what I did wrong is more than welcomed.
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Mario.
>>>>>
>>>>> --
>>>>> 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+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/prometheus-users/b8f2f195-efc1-4c48-b85b-88a8687964bfn%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/prometheus-users/b8f2f195-efc1-4c48-b85b-88a8687964bfn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAE%2BvKfBgwxrdVg0FRc0j1w6pk4Kk9PP5jhoL_Q8k8Rci2GzTdQ%40mail.gmail.com.

Reply via email to