sensu-plugins / sensu-plugins-snmp

This plugin provides native SNMP instrumentation for monitoring and metrics collection, including: generic OID single/bulk query for status and metrics, and ifTable metrics.
http://sensu-plugins.io
MIT License
4 stars 15 forks source link

Custom Mibs | ENOENT: No such file or directory #10

Open daswars opened 8 years ago

daswars commented 8 years ago

Hi, i will use a custom mib file with the metrics-snmp-bulk.rb plugin:

/opt/sensu/embedded/bin/metrics-snmp-bulk.rb -h 192.168.0.102 -C public -O enterprises.xy.xy-series -d /usr/share/snmp/mibs -l xy-mib

result:

An unknown error occured: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /usr/share/snmp/mibs/xy-mib.yaml>

The smtp walk works: /usr/bin/snmpwalk -c public -v2c 192.168.0.102 enterprises.xy.xy-series

and the mibs file exist: /usr/share/snmp/mibs/xy-mib.txt The mibs file ist included in /etc/snmp/snmp.conf why it needs a yaml file?

Can any one help me?

majormoses commented 7 years ago

I did not spend enough time to run it to ground but it is not something that is being done in this script that is forcing it to be yaml. Here is the line in the script: https://github.com/sensu-plugins/sensu-plugins-snmp/blob/1.1.0/bin/metrics-snmp.rb#L76 I went a step farther: http://www.rubydoc.info/github/hallidave/ruby-snmp/SNMP/Manager#load_modules-instance_method but from a quick scan I do not see why this would be the case.