[Nut-upsdev] Adding power devices support to OCS Inventory NG

Arnaud Quette aquette.dev at gmail.com
Thu Nov 17 16:18:49 UTC 2011


Hi Guillaume and the list,

2011/11/15 Guillaume PROTET <guillaume at ocsinventory-ng.org>

> Hi Arnaud,
>
> Thanks a lot for your email. Of course, we are interested to work with you
> on this. It could be really interesting to get this kind of informations in
> OCS Inventory.
>

I'm glad to see you're interested in ;)


> If the "nut-scanner" command can use SNMP, an idea could be to integrate
> it directly in OCS SNMP scans steps.
>

well, nut-scanner is very NUT centric: it will show the basic info for
detected devices, in order to configure the right NUT driver(s) for data
acquisition (for protection or management purpose).

As an example for nut-scanner with SNMP, you would only get the IP address
and the name of the detected MIB (which can only be resolved by the
snmp-ups NUT driver)!

 A special perl module could be create to make OCS agent able to scan NUT
> devices during its SNMP scans. I think it could be easily integrated. If
> you want, you can take a look at OCS Unix agent trunk branch on launchpad (
> https://code.launchpad.net/~ocsinventory-dev/ocsinventory-unix-agent/trunk)
> and take a look to lib/Ocsinventory/Agent/Modules/Snmp* files to give you
> an idea on how SNMP scans work.
>
> Of course, it is a first idea and there is surely an other way to do this
> :) :).
>

First note that NUT currently supports 12 MIBs, with ~8 more stagging.
And not all offers the same level of details and capabilities.
Some PDUs are very basic, for example.

I see a 2 steps way:

1) use the nut-scanner for a quick integration.
Refer to [1].

A Perl wrapper is planned (as for the existing "jNutScanner" [2]), that
would help this effort.
Any Perl contrib is welcome BTW ;-)

This requires the nut-scanner binary to installed on the local system, that
is:
- the server, for SNMP scans
- the agents for USB and still for IPMI (remote support planned) scans

Here is an example SNMP scan, in quiet mode with parsable output:

$ /path/to/nut-scanner -SPq --mask_cidr 166.99.250.58/24

SNMP:driver="snmp-ups",port="166.99.250.64",desc="Eaton
5PX",mibs="mge",community="public"
SNMP:driver="snmp-ups",port="166.99.250.26",desc="Evolution",mibs="mge",community="public"
SNMP:driver="snmp-ups",port="166.99.250.67",desc="DELL",mibs="ietf",community="public"
SNMP:driver="snmp-ups",port="166.99.250.7",desc="DBQ10634/5",mibs="aphel_revelation",community="public"
SNMP:driver="snmp-ups",port="166.99.250.118
",desc="EATON",mibs="ietf",community="public"
SNMP:driver="snmp-ups",port="166.99.250.118",desc="Eaton 5PX
1500",mibs="pw",community="public"
SNMP:driver="snmp-ups",port="166.99.250.118",desc="Eaton
5PX",mibs="mge",community="public"

Note: the same device may be exposed several times, if it supports several
MIBs (as for 166.99.250.118 above)!


2) configure and launch snmp-ups + upsd to get more (all) details

As told previously, the results of a NUT scan is very basic.

But many details can then be gathered using NUT [3] and its client
interface (Perl binding available [4]).
See [5] for examples of UPS and PDU data reported by NUT, so that you can
match with GLPI requirements or needs.

That method requires to setup NUT to talk to the SNMP device, but that is
not a big deal.
The nut-scanner output can be used (either the parsable, or the direct nut
ups.conf format)


So, does the above 2 steps suits you?
How can we collaborate on this topic?

Finally, NUT supports most (if not all) USB UPSs, and now IPMI power supply
(most servers).
Can OCS handle this?
For the former, NUT can also provide a "Perl adapted header" (C header also
attached).
For IPMI, there are generic ways that can be used to do this (I recommend a
wrapper around FreeIPMI).

cheers,
Arnaud
--
[1] nut-scanner manpage(doc to be published with the next release)
http://www.networkupstools.org/docs/man/nut-scanner.html
[2]
http://anonscm.debian.org/viewvc/nut/trunk/scripts/java/jNut/src/main/java/org/networkupstools/jnut/Scanner.java?view=co
[3] NUT architecture
http://www.networkupstools.org/docs/developer-guide.chunked/ar01s02.html
[4] UPS::Nut client Perl module:
http://www.networkupstools.org/projects.html#_a_href_http_search_cpan_org_search_dist_ups_nut_ups_nut_a
[5] examples of NUT data output:
UPS:
http://anonscm.debian.org/viewvc/nut/trunk/data/evolution500.seq?view=co
PDU:
http://anonscm.debian.org/viewvc/nut/trunk/data/epdu-managed.dev?view=co
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20111117/0fa04b7d/attachment.html>


More information about the Nut-upsdev mailing list