Pass flags to snmpwalk specific to device

I can poll correctly mib’d data with the following from the command line:

snmpwalk -Cc -v 1 -m ALL -c public **$hostname** enterprises

When trying from LibreNMS I get:

Error: OID not increasing: .1.3.6.1.4.1.40989.10.16.20.16.0

= .1.3.6.1.4.1.40989.10.16.1.0.1.0

.1.3.6.1.2.1.1.1.0 = STRING: GLCY SNMP
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.2.1.1.2
.1.3.6.1.2.1.1.3.0 = Timeticks: (2726677400) 315 days, 14:06:14.00
.1.3.6.1.2.1.1.4.0 = STRING:
.1.3.6.1.2.1.1.5.0 = STRING:
.1.3.6.1.2.1.1.6.0 = STRING:
.1.3.6.1.4.1.40989.10.16.20.1.0 = STRING: “OAP-M2”

And we’ve think we’ve isolated it to the -Cc being required.

Is it possible to configure/change flags that are used for snmpwalk by device?

For the moment I have a hack to fix the above. I modifed includes/snmp.inc.php and addied:

$options = $options ? array_merge([‘-Cc’], (array) $options) : [‘-Cc’];

To the gen_snmpwalk_cmd function.

I can now snmpwalk the device without errors:

.1.3.6.1.2.1.1.1.0 = STRING: GLCY SNMP
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.2.1.1.2
.1.3.6.1.2.1.1.3.0 = Timeticks: (2735505000) 316 days, 14:37:30.00
.1.3.6.1.2.1.1.4.0 = STRING:
.1.3.6.1.2.1.1.5.0 = STRING:
.1.3.6.1.2.1.1.6.0 = STRING:
.1.3.6.1.4.1.40989.10.16.20.1.0 = STRING: “OAP-M2”

Next step contribute a field below community in the GUI to pass snmpwalk options? :smiley:

1 Like

Hello
SnmpFlags can already be added as an array of strings to the YAML file of an OS like ~/includes/definitions/discovery/ies5000.yaml :

    processors:
        data:
            -
                oid: cpuUtilizationTable
                value: cpuCurValue
                num_oid: '.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.2.{{ $index }}'
                snmp_flags: ['-OeQUsb', '-Pu'] # workaround for underscores in mib
                descr: '{{ $index }} {{ $cpuDescr }}'
                #high_limit: cpuHighThresh
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.