wveagle81 has asked for the wisdom of the Perl Monks concerning the following question:

I'm using the "Baytech-MIB-413-1" MiB file and the Perl module SNMP to retrieve data from an MMP-11 power strip.

When I use the "getnext" function, I'm able to get all of the data I need, but it's cumbersome to read tables this way. So I switched to using the "gettable" function. It works well for all of the tables I'm reading, except for:

sBTAModulesRPCCircuitsTable (or sBTAModulesRPCBreakersTable)
sBTAEnvironmentalObjectsTable

With the sBTAModulesPRPCCircuitsTable I get the following message:

ack: gettable failed to find any columns to look for

With the sBTAEnvironmentalObjectsTable I get the following messages:

***** ERROR parsing .1.3.6.1.4.1.4779.1.6.2.1.13.2.1.1 MIB indexes:
   spcEnvironmentalStateTrapEn.2.1.1 => netsnmp_oidPtr
   should be an array
   expected # indexes = 2
***** ERROR parsing .1.3.6.1.4.1.4779.1.6.2.1.13.2.1.2 MIB indexes:
   spcEnvironmentalStateTrapEn.2.1.2 => netsnmp_oidPtr
   should be an array
   expected # indexes = 2

The Environmental one *does* return data for the sensors (we don't have any external sensors installed so the data is bogus) but the Circuits table returns just that error.

If anyone could help me with these issues I'd appreciate it. I have sent the same question to Baytech support but I'm thinking I'll get a faster response from this group.

  • Comment on Querying Baytech MMP-11 Power Strips using SNMP

Replies are listed 'Best First'.
Re: Querying Baytech MMP-11 Power Strips using SNMP
by FreeBeerReekingMonk (Deacon) on Jun 05, 2015 at 22:50 UTC

    Help us to help you, post the link to the mib. Now, as a matter of principle, if you have a vendor, do seek a bugfix from the vendor. creating errorfree MIBs is hard, and without the right hardware to test, even harder. And even harder without an example code to look at. (just in case the problem is not in the MIB but in the perl script)

    Anyway, the MIB has sBTAModulesRPCCircuitsTable and you describe sBTAModulesPRPCCircuitsTable. Typo?

      I couldn't post a link because the crappy 'net restrictions where I work have blocked the Baytech website. Argh. Thanks for posting that.

      Also, I have communicated with the Vendor and they haven't been any help. They don't have a Perl programmer on staff and they suggested I use a different MiB entry to query the strip. I tried that and it failed as well.

      There are two different MiB entries for the circuit table. They are: sBTAModulesRPCCircuitTable and sRPCModPortCircuitsTable.

      Both of those entries give me an error when I use them to query the powerstrip.

Re: Querying Baytech MMP-11 Power Strips using SNMP
by akuk (Beadle) on Jun 06, 2015 at 07:01 UTC

    A quick question, when you run SNMP from command line to "sBTAModulesPRPCCircuitsTable" did you get any output from the device itself ?

      I haven't tried it from the command line, but if I use the "getnext" function to get the data it works just fine. But when I try to use the "gettable" function I get the error.

        I would suggest try to run it from the command line using snmpwalk.

        snmpwalk -v2c -c community router_ip OID

        then check whether you get some output.

Re: Querying Baytech MMP-11 Power Strips using SNMP
by wveagle81 (Novice) on Jun 12, 2015 at 13:49 UTC

    OK, update on the problem.

    In my code I was including all three of the MiB files I have for the Baytech strips because there were subtle differences in them. After some reflection, I removed the older versions and just kept the newest.

    NOW, the code works. Maybe one of the older MiB files has an error in it. BUT, I still get some errors displayed where the SNMP module says one of the entries should be a table but the MiB file clearly shows it as an integer.

    Bottom line, the code now works as expected.

    Thanks for helping me work through this.