0

Using net-snmp, I've setup my snmp.conf to see vendor MIBs and I can walk them via "snmpwalk -Cc -v 2c -c <community> <device> <MIB name>". Is it possible to get snmpwalk to auto-walk the vendor MIBs when I walk a device without calling out the vendor MIB specifically?

Weeve
  • 1
  • 2

1 Answers1

2

It doesn't look like it. The default OID to use as the root of the walk is hard coded into the application.

I would recommend creating a small wrapper shell script.

For example.

vendor-snmpwalk.sh:

#!/bin/sh
/path/to/snmpwalk -Cc -v 2c -c <community> $1 <root vendor OID>

Then you just call your wrapper script instead of snmpwalk directly

/path/to/vendor-snmpwalk.sh <device>

For reference, here's the relevant code that handles the root OID that the walk starts from (from the net-snmp code repository):

74  oid             objid_mib[] = { 1, 3, 6, 1, 2, 1 };

...

233      * get the initial object and subtree 
234      */
235     if (arg < argc) {
236         /*
237          * specified on the command line 
238          */
239         rootlen = MAX_OID_LEN;
240         if (snmp_parse_oid(argv[arg], root, &rootlen) == NULL) {
241             snmp_perror(argv[arg]);
242             exit(1);
243         }
244     } else {
245         /*
246          * use default value 
247          */
248         memmove(root, objid_mib, sizeof(objid_mib));
249         rootlen = sizeof(objid_mib) / sizeof(oid);
250     }
chuckx
  • 1,150
  • 6
  • 8