Discussion:
[Nut-upsdev] Updating snmp-mib.c with new Cyberpower v2.0 MIB
Ben Kamen
2017-10-31 01:32:36 UTC
Permalink
Hey all,


 I'm feeling spunky... and want to update nut to handle the new v2.0 MIB from CyberPower.

I've looked at the cyberpower v0.1 .c/.h and being new to working on nut to this level -- anything anyone has to offer on adding code besides the obvious?

like: should the 0.1 and 2.0 coexist somehow? (maybe different files)

(also, is there a list of all the parms I can match up from the MIB? -- i.e. the APC MIB.c is pretty comprehensive, I suppose I could use that as a model. I haven't looked at all the SNMP .C files yet though. Will do that later tonight and get busy.)

Cheers,


 -Ben
Jim Klimov
2017-10-31 06:13:53 UTC
Permalink
Post by Ben Kamen
Hey all,
 I'm feeling spunky... and want to update nut to handle the new v2.0 MIB from CyberPower.
I've looked at the cyberpower v0.1 .c/.h and being new to working on
nut to this level -- anything anyone has to offer on adding code
besides the obvious?
like: should the 0.1 and 2.0 coexist somehow? (maybe different files)
(also, is there a list of all the parms I can match up from the MIB? --
i.e. the APC MIB.c is pretty comprehensive, I suppose I could use that
as a model. I haven't looked at all the SNMP .C files yet though. Will
do that later tonight and get busy.)
Cheers,
 -Ben
_______________________________________________
Nut-upsdev mailing list
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev
Welcome!

If the new data is in a separate OID tree, it can quite be a new MIB. Otherwise you can use the UNIQUE flag and set the preferred (e.g. newer, more precise) source for a value first in the list of same-named mappings in existing file - if there's a hit on an actual device, it will be used and not iterated onwards. The flag is not yet supported for all cases though (e.g. daisy-chained devices), so some other combinations would set the preferred value mapping last in list.

I'm on the road now so can't point exactly, but there's a text file in docs/ (?) which lists and describes the mappings which drivers should share (for any media and vendor-protocol -- e.g. networked snmp in this case).

Hope this helps,
Jim

--
Typos courtesy of K-9 Mail on my Android
Ben Kamen
2017-11-02 04:31:42 UTC
Permalink
Post by Jim Klimov
If the new data is in a separate OID tree, it can quite be a new MIB. Otherwise you can use the UNIQUE flag and set the preferred (e.g. newer, more precise) source for a value first in the list of same-named mappings in existing file - if there's a hit on an actual device, it will be used and not iterated onwards. The flag is not yet supported for all cases though (e.g. daisy-chained devices), so some other combinations would set the preferred value mapping last in list.
I'm on the road now so can't point exactly, but there's a text file in docs/ (?) which lists and describes the mappings which drivers should share (for any media and vendor-protocol -- e.g. networked snmp in this case).
the gen-snmp script -- VERY handy... looks like I just have to fish through the MIB (which seems pretty well documented) to add the beef...


As for the UNIQUE flag, since this is SNMP, I'm guessing we'll have the network plug-ins that are the old MIB (I'll have to look it up) versus the new network modules that support the v2.0 MIB.

for now, I'm building a separate .C and .H file.

More later..

 -Ben
Jim Klimov
2017-11-02 06:52:09 UTC
Permalink
Post by Jim Klimov
Post by Jim Klimov
If the new data is in a separate OID tree, it can quite be a new MIB.
Otherwise you can use the UNIQUE flag and set the preferred (e.g.
newer, more precise) source for a value first in the list of same-named
mappings in existing file - if there's a hit on an actual device, it
will be used and not iterated onwards. The flag is not yet supported
for all cases though (e.g. daisy-chained devices), so some other
combinations would set the preferred value mapping last in list.
Post by Jim Klimov
I'm on the road now so can't point exactly, but there's a text file
in docs/ (?) which lists and describes the mappings which drivers
should share (for any media and vendor-protocol -- e.g. networked snmp
in this case).
the gen-snmp script -- VERY handy... looks like I just have to fish
through the MIB (which seems pretty well documented) to add the beef...
As for the UNIQUE flag, since this is SNMP, I'm guessing we'll have the
network plug-ins that are the old MIB (I'll have to look it up) versus
the new network modules that support the v2.0 MIB.
for now, I'm building a separate .C and .H file.
More later..
 -Ben
_______________________________________________
Nut-upsdev mailing list
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev
I believe the main reason for a new set of .c/.h files here would be if the new MIB is defined in a separate subtree. The top-level mapping binds the vendor entry OIDs (often "hidden" so one has to know where to poke). It may also be higher in the list of snmp-ups.h, in case the device also serves the older MIB but you'd prefer the newer (e.g. common standard IETF one is always last).

If both the older and newer data are in the same vendor tree, e.g. new leaf points are added, you'd extend the existing table.

Jim
--
Typos courtesy of K-9 Mail on my Android
Ben Kamen
2017-11-02 07:11:07 UTC
Permalink
Post by Jim Klimov
I believe the main reason for a new set of .c/.h files here would be if the new MIB is defined in a separate subtree. The top-level mapping binds the vendor entry OIDs (often "hidden" so one has to know where to poke). It may also be higher in the list of snmp-ups.h, in case the device also serves the older MIB but you'd prefer the newer (e.g. common standard IETF one is always last).
If both the older and newer data are in the same vendor tree, e.g. new leaf points are added, you'd extend the existing table.
I'll have to compare...  working on the basics at the moment.

Once I get the new one filled in -- I'll check it to the old 0.1 version mib.c

Thanks,

 -Ben
Ben Kamen
2017-11-06 07:26:41 UTC
Permalink
Chugging along...

Question for the gang --

CyberPower lists other items in their MIB for controlling PD units and some other things.

Does NUT support all that and should I make an effort to get all that in or should we skip for now and get UPS primary ingredients inserted and tested?

just wondering,

 -Ben
--
Ben Kamen - O.D.T., S.P.
----------------------------------------------------------------------
Email: ben AT benkamen DOT net http://www.benkamen.net
Cell: 224.619.9006 http://www.linkedin.com/in/benkamen
- -
NOTICE: All legal disclaimers sent to benkamen.net
or any of its affiliated domains are rendered null and void on
receipt of communications and will be handled/considered as such.
Ben Kamen
2018-08-16 17:28:55 UTC
Permalink
Hey all,

sorry for my absence  -- it's been a crazy busy time since my last email.

I did I think most of the work for the Cyberpower v2.0 SNMP driver... I'm looking to get back into finishing this up...

Do any of the devs want to take a look so far to see what else I'm missing?

 -Ben

Loading...