Re: [Nut-upsdev] [Fusioninventory-devel] Adding power devices support to Fusion Inventory

2011-11-29 Thread Gonéri Le Bouder
2011/11/17 Arnaud Quette aquette@gmail.com:
 Hi Gonéri,

 2011/11/17 Gonéri Le Bouder gon...@rulezlan.org:
 On Thu, Nov 17, 2011 at 09:20:15PM +0100, Arnaud Quette wrote:
 Hi,

 Hello all,

 I'm interest to start the integration on the agent side (local inventory).
 There no UPS here. Is there a way to emulate it?

 sure.
 I've attached an updated (and not yet published) version of the NUT
 simulation info.
 You will find everything you need to simulate as many UPS, PDU, (...) you 
 want.
 Since manpages links are broken, also use the online version:
 http://www.networkupstools.org/docs/man/index.html
I managed to create a dummy device.

upsrw dummy gives me very few output. Can you please point me some
examples of upsrw output?

Is there a command I can run to get the list the ups on a machine?

Do you have an idea of the amount of supported UPS that return a serial number?

So far, the best system I can imagine is a forumlar on the server side
where the user
write the list of UPS devices to inventory (IP, hostname, login, pw, ups).

The agent gets the list, contact each device and get a full log with upsrw and
push back the data to the server.

IMO upsrw data structure is simple enough to avoid a new perl dependency on
UPS::Nut perl binding. What is your opinion about this?

Best regards,
-- 
     Gonéri Le Bouder

___
Nut-upsdev mailing list
Nut-upsdev@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev

Re: [Nut-upsdev] [Fusioninventory-devel] Adding power devices support to Fusion Inventory

2011-11-17 Thread Arnaud Quette
Hi Guillaume, Walid and the list,

I'm grouping my answers to you.

2011/11/15 Guillaume Rousse guillomovi...@gmail.com

 Le 15/11/2011 15:30, Arnaud Quette a écrit :

  So, would you be interested in working with me on this topic?
 How can we proceed?
 Which kind of integration would be best, ie providing a formated files,
 or using languages binding or program calls?

 Hellp Arnaud.

 This is quite interesting idea. Especially if you're willing to provide
 the code directly :P


indeed, but not everything: if we want this effort to succeed, I will only
be able to complete the NUT side (see below) with you working on the FI
side.


 The first point is to determine how to extract UPS informations. In
 fusioninventory, they are currently two different ways for this:
 - local devices are managed in local inventory task, using whatever
 command/tool available
 - remote devices (thoses with an IP adress, basically) are managed in net
 inventory task, using only SNMP currently

 Some kind of devices, such as printers, can belong to both categories:
 small ones are locally controlled on a specific host, while larger ones are
 autonomous. I guess UPS are quite similar in this regard, some of them
 being attached by an USB link to a controller host, others having their own
 network device, right ?

 In this case, UPS support would mean two additional pieces of code.

 Local inventory support is just a matter of adding a new additional
 inventory module, in perl, for the local inventory task. There is also a
 new section definition to add to the inventory data structure, but that's
 trivial to do.

 Remote inventory support is a bit more complex. First, we need an SNMP
 description model (just a mapping of OIDs against specific known
 properties), but as currently this task only manage printers and network
 devices, we also need to define those properties, and add explicit support
 in the task code itself.

 So, the easiest way to start would be the local support. Have a look at
 the generic local printer module, in the 2.2.x branch, it should give you
 some idea on how to proceed:
 https://github.com/fusinv/**fusioninventory-agent/blob/2.**
 2.x/lib/FusionInventory/Agent/**Task/Inventory/Input/Generic/**Printers.pmhttps://github.com/fusinv/fusioninventory-agent/blob/2.2.x/lib/FusionInventory/Agent/Task/Inventory/Input/Generic/Printers.pm

 Of course, feel free to ask if I'm not clear enough.


First, NUT provides support for UPS, and also PDU (sort of manageable
powerstrip) and servers power supplies.
UPS can be local (serial or USB) or networked (SNMP).
NUT only support natively SNMP PDU (12 MIBs currently, with ~8 more
stagging).
And IPMI support is only local, but network support is planned.

So these devices pertain to both local and remote categories.

I've thought a lot about that, for both FusionInventory and OCS Inventory
NG, and came to the conclusion that extracting all the needed data for both
inventory and assets management (Ie GLPI) would either be identical to
nut-scanner, or would need too much revamp in the NUT code. In either case,
this would almost be a Perl reimplementation of NUT, which is probably not
desirable, at least for maintenance reasons!

Thus, I propose you the following 2 steps approach, which is the same I
proposed to OCS (minus USB):

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

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)!

And here is another one for USB devices:

$ /path/to/nut-scanner -UPq
USB:driver=bcmxcp_usb,port=auto,vendorid=0592,productid=0002,bus=002
USB:driver=usbhid-ups,port=auto,vendorid=0463,productid=,bus=002

A possible variation of this would be a new nut-scanner option, that would
display a list of supported devices:
- VendorID:ProductID for USB
- sysOID:otherTestOID for SNMP

This would be sufficient for a generic USB or SNMP iterator in FI

2) configure and launch snmp-ups and/or USB 

Re: [Nut-upsdev] [Fusioninventory-devel] Adding power devices support to Fusion Inventory

2011-11-17 Thread David DURIEUX
Le Thu, 17 Nov 2011 18:40:00 +0100
Arnaud Quette aquette@gmail.com a écrit:

Hi Guillaume, Walid and the list,

Hi 


I'm grouping my answers to you.

2011/11/15 Guillaume Rousse guillomovi...@gmail.com

 Le 15/11/2011 15:30, Arnaud Quette a écrit :

  So, would you be interested in working with me on this topic?
 How can we proceed?
 Which kind of integration would be best, ie providing a formated
 files, or using languages binding or program calls?

 Hellp Arnaud.

 This is quite interesting idea. Especially if you're willing to
 provide the code directly :P


indeed, but not everything: if we want this effort to succeed, I will
only be able to complete the NUT side (see below) with you working on
the FI side.


 The first point is to determine how to extract UPS informations. In
 fusioninventory, they are currently two different ways for this:
 - local devices are managed in local inventory task, using whatever
 command/tool available
 - remote devices (thoses with an IP adress, basically) are managed
 in net inventory task, using only SNMP currently

 Some kind of devices, such as printers, can belong to both
 categories: small ones are locally controlled on a specific host,
 while larger ones are autonomous. I guess UPS are quite similar in
 this regard, some of them being attached by an USB link to a
 controller host, others having their own network device, right ?

 In this case, UPS support would mean two additional pieces of code.

 Local inventory support is just a matter of adding a new additional
 inventory module, in perl, for the local inventory task. There is
 also a new section definition to add to the inventory data
 structure, but that's trivial to do.

 Remote inventory support is a bit more complex. First, we need an
 SNMP description model (just a mapping of OIDs against specific known
 properties), but as currently this task only manage printers and
 network devices, we also need to define those properties, and add
 explicit support in the task code itself.

 So, the easiest way to start would be the local support. Have a look
 at the generic local printer module, in the 2.2.x branch, it should
 give you some idea on how to proceed:
 https://github.com/fusinv/**fusioninventory-agent/blob/2.**
 2.x/lib/FusionInventory/Agent/**Task/Inventory/Input/Generic/**Printers.pmhttps://github.com/fusinv/fusioninventory-agent/blob/2.2.x/lib/FusionInventory/Agent/Task/Inventory/Input/Generic/Printers.pm

 Of course, feel free to ask if I'm not clear enough.


First, NUT provides support for UPS, and also PDU (sort of manageable
powerstrip) and servers power supplies.
UPS can be local (serial or USB) or networked (SNMP).
NUT only support natively SNMP PDU (12 MIBs currently, with ~8 more
stagging).
And IPMI support is only local, but network support is planned.

So these devices pertain to both local and remote categories.

I've thought a lot about that, for both FusionInventory and OCS
Inventory NG, and came to the conclusion that extracting all the
needed data for both inventory and assets management (Ie GLPI) would
either be identical to nut-scanner, or would need too much revamp in
the NUT code. In either case, this would almost be a Perl
reimplementation of NUT, which is probably not desirable, at least for
maintenance reasons!

Thus, I propose you the following 2 steps approach, which is the same I
proposed to OCS (minus USB):

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

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)!

Several MIBs ? what did it mean?


And here is another one for USB devices:

$ /path/to/nut-scanner -UPq
USB:driver=bcmxcp_usb,port=auto,vendorid=0592,productid=0002,bus=002
USB:driver=usbhid-ups,port=auto,vendorid=0463,productid=,bus=002

A possible variation of this would be a new nut-scanner option, that
would display a list of supported devices:
- VendorID:ProductID for USB
- sysOID:otherTestOID 

Re: [Nut-upsdev] [Fusioninventory-devel] Adding power devices support to Fusion Inventory

2011-11-17 Thread Arnaud Quette
Hi Gonéri,

2011/11/17 Gonéri Le Bouder gon...@rulezlan.org:
 On Thu, Nov 17, 2011 at 09:20:15PM +0100, Arnaud Quette wrote:
 Hi,

 Hello all,

 I'm interest to start the integration on the agent side (local inventory).
 There no UPS here. Is there a way to emulate it?

sure.
I've attached an updated (and not yet published) version of the NUT
simulation info.
You will find everything you need to simulate as many UPS, PDU, (...) you want.
Since manpages links are broken, also use the online version:
http://www.networkupstools.org/docs/man/index.html

 We provide tarball of Perl, FusionInventoy-Agent and the dependencies
 to simplify the inventory of the machine. Basicly, the sysadmin, has
 just to extract and run the agent.
 This is very useul when a decent Perl is not available and there is no
 compiler (for example, an ancient Solaris or HP-UX)
  http://prebuilt.fusioninventory.org
 Is it possible to prepare a minimalist nut distribution just for
 local inventory and embed it with the agent? Does nut have a lot of
 external dependency itself?

NUT is included in small footprint appliances (10 Mb) such as Opengear
devices, so this should not be an issue.
A full (Ie including the world) distribution on Linux weights ~4 Mb
But you will be able to cut it down to 2Mb or even more... at least on Linux.
- 350 Kb for (5) USB drivers
- 94 Kb for snmp-ups
- 54 Kb for nut-ipmipsu
- 43 Kb simulation driver
- 200 Kb lib (nut client and scan)
- 14 kb nut-scanner binary
- 26 Kb for Nut.pm
- 51 Kb for upsd, but you can also directly talk to drivers and remove
upsd (ex: if you just want to launch drivers from time to time, to
update data...)
- ...

NUT depends on libc/equiv + libusb + libsnmp (Net SNMP) for your requirements.
For other options (SSL, IPMI, ...) requirements, check this chapter
and the following:
http://www.networkupstools.org/docs/user-manual.chunked/aphs01.html

 Is it possible to use nut on Windows?

sure, NUT now runs on all OSs, including Windows (not yet as complete
/ mature as Unix versions), Linux*, OS X, BSD*, HP-UX, Aix, Solaris,
Qnx, ...

Windows and other packages are available:
http://www.networkupstools.org/download.html#_binary_packages

cheers,
Arnaud
Title: 10. NUT developers tools


Prev   Next10. NUT developers toolsNUT provides several tools for clients and core developers, and QA people.10.1. Device simulationThe dummy-ups driver propose a simulation mode, also known as Dummy Mode.
This mode allows to simulate any kind of devices, even non existing ones.Using this method, you can either replay a real life sequence,
recorded from an actual device, or directly interact
through upsrw or by editing the device file, to modify the variables values.Here is an example to setup a device simulation:
install NUT as usual, if not already done

get a simulation file (.dev) or sequence (.seq), or generate one using the
device recorder. Sample files are provided in the data
directory of the NUT source. You can also download these from the development
repository, such as the
evolution500.seq.

copy the simulation file to your sysconfig directory, like /etc/nut or
/etc/ups

configure NUT for simulation (ups.conf(5)):
[dummy]
driver = dummy-ups
port = evolution500.dev
desc = "dummy-ups in dummy mode"
now start NUT, at least dummy-ups and upsd:
$ upsdrvctl start dummy
$ upsd
and check the data:
$ upsc dummy
...
you can also use upsrw to modify the data:
$ upsrw -s ups.status="OB LB" -u user -p password dummy
or directly edit /etc/nut/evolution500.seq. In this case, modification will
only apply according to the TIMER events and the current position in the
sequence.
For more information, refer to dummy-ups(8) manual page.10.2. Device recordingTo complete dummy-ups, NUT provides a device recorder script called
device-recorder.sh and located in the tools/ directory of the
NUT source tree.This script uses upsc to record device information, and stores
these in a differential fashion every 5 seconds (by default).Its usage is the following:Usage: dummy-recorder.sh device-name [output-file] [interval]For example, to record information from the device myups every 10 seconds:tools/device-recorder.sh myups@localhost myups.seq 10During the recording, you will want to generate power events, such as power
failure and restoration. These will be tracked in the simulation files, and be
eventually be replayed by the dummy-ups driver.Prev   Next Home 
___
Nut-upsdev mailing list
Nut-upsdev@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev

Re: [Nut-upsdev] [Fusioninventory-devel] Adding power devices support to Fusion Inventory

2011-11-15 Thread Walid nouh


On 15/11/2011 15:30, Arnaud Quette wrote:

Dear Fusion Inventory fellows,

I've been thinking about working on adding power devices knowledge to 
inventory systems for years.
Following the last Ubuntu Developer Summit, I know have an excuse to 
do so:

https://blueprints.launchpad.net/ubuntu/+spec/servercloud-p-cloud-power-management

My below proposition is related to the above blueprint. So please keep 
in mind that the target is also to be able to provide these info to 
Fusion Inventory , so that it can in turn provide these to Cobbler / 
Orchestra.



Hello Arnaud,

If FusionInventory collects theses new data, then it should be displayed 
in the asset management software (in our case GLPI). What kind of data 
must should be stored and are interesting to display ?
There may be some work to do to add theses new informations on the GLPI 
side.


Walid.

___
Nut-upsdev mailing list
Nut-upsdev@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev