Table of Contents
The inventory module is available on the LRS main page. You just need to click on the inventory icon corresponding to one client, or one group to display it. The inventory module uses, for the inventory agent, 'OCS Inventory' http://ocsinventory.sourceforge.net/.
This module gives a complete description of the clients hardware configuration, and a list of installed software as shown on this picture :
One part of the inventory, the low-level inventory (serial numbers, processor, memory, disks, PCI cards) is sent during the network boot just before displaying the LRS boot menu. Other parts of the inventory, require an inventory agent on Windows clients.
The best way to install the agent is to deploy it silently using the "Post-Installation" module or the "Linbox Secure Control" module. You can also manually install it running setup.exe.
This inventory software can be downloaded from http://lrs_server_address in "Windows utilities", "LRS Inventory Agent". Various versions of the inventory and their source code are also available at ftp://ftp.linbox.com/pub/lrs/inventory. The Windows inventory module is compatible with OCS Inventory clients version 2, 3 and NG. Both MacOS X and Linux are also available.
The inventory agent installation is a simple process, select and validate the default choices.
Before starting to copy its files, the installer will ask for the name (or the IP address) of the LRS server, to send the results from the information collected.
If you install the inventory agent on a disk which will be replicated, make sure to run the 'clean.bat' script in 'C:\Program Files\LRS Inventory Agent' before running a backup. It will remove any trace from previous inventories and will reset the inventory device id.
There are three ways to start the inventory:
By default, the inventory automatically starts each time a user logs in, but with a minimal delay of 24 hours between each inventory.
The inventory can be manually started from the 'Linbox Secure Control' module, with the 'start action' drop down box.
Or even better, a periodic inventory can be scheduled by the LSC, using the 'run-inventory-secure.bat' script.
This mode has many advantages over the other ones. The inventory can be started during the night to lower the network activity, and to avoid the 8 o'clock 'rush' when users log-in. Inventory spoofing or DoS can be eradicated because the inventory is sent to the server using a SSH tunnel (leaving the server's port 80 open, is not required anymore).
A "Module Configuration" option is available on the top left corner of the inventory screen. This settings screen contains the paths used by the module. The default parameters usually have the right value at the installation.
The inventory has several tabs to display the clients hardware and software configurations.
General: General information (name of the box, serial numbers, operating system, etc).
The Warranty and Locations can be modified in the 'Customization' tab. Other fields can be created in the customization page:
Network: Network interfaces available with their details (IP and MAC addresses, state, speed, etc),
Disks: Disks, partitions and Windows logical drives information,
Peripherals: Printers, scanners, monitors, etc.
Hardware: Processors, memory, PCI cards, BIOS, etc.
Software: details on the installed software,
Each table also provides a CSV button which can be used to download the currently displayed information as a Comma Separated Value file.
If the 'php-gd2' module is properly installed on the server, an orange "G" appears on top of some rows. Clicking on this "G" will display a pie chart showing the distribution of the related elements on a client or on a clients group.
The inventory data is stored in a MySQL database. By default, only the 'lrs' user can access this database locally. So you will have to declare another user if you want to access to the database from external software like OpenOffice Base, or MS Access.
To create an "openoffice" user identified by the "lrs" password which will connect from the "myhost" host, login as "root" on the LRS and type:
mysql inventory mysql> GRANT SELECT ON inventory.* TO 'openoffice'@'myhost' mysql> IDENTIFIED BY 'lrs'; mysql> \q
You may also need to activate TCP/IP access to the database: Edit the /etc/mysql/my.cnf file, comment the 'skip-networking' line and restart the mysql service with '/etc/init.d/mysql restart'.
To make SQL requests, keep in mind that:
Each client has an unique "id" (in the "Machine" table).
With this "id" inventory numbers ("inventory" field) can be found in the tables whose name begin with "has".
For each inventory row in "has" tables, there is a corresponding entry in the tables without the "has" prefix ("Storage" and "hasStorage" are linked by the "id" and "storage" fields).
Thanks to that structure, inventory data rows are not duplicated. For example if 1000 clients have the same sound card, you will find only one row in the "Sound" table. That structure allows to keep the full inventory history in the database without significantly increasing the needed storage space, contrary to the original OCS Inventory database structure.
So to get the list of logical drives, for the client number "4" and the inventory number "1222", one would use the following SQL statement:
select Drive.* from hasDrive, Drive where hasDrive.machine=4 and hasDrive.inventory=1222 and hasDrive.drive=Drive.id;
The last inventory number can be found using "last*Id" columns in the "Machine" table. "lastBootId" gives the last inventory sent during the PXE boot (data stored in "Boot*" tables), "lastCustomId" gives the last custom informations manually entered ("Custom" table), and "lastId" gives the last inventory sent by OCS clients.
To find the inventory numbers before a given date, you have to select data in "hasHardware" for OCS inventories, or in "hasBootGeneral" for low level inventories like this:
select has.inventory from hasHardware has, Inventory inv where inv.id=has.inventory and has.machine=MACHINE_ID and inv.date<='2006-01-01'
![]() | |
This functionality is only available to the unified OCS Agent, so the Win32 agent doesn't have it. |
Even if the LRS inventory agent is rather exhaustive, only operating system seen apps can be gathered by it: any app. which could have been installed without using the platform packaging system (deb, rpm, etc ...) won't be seen by the standard inventory.
It is indeed possible to perform a deeper hard drive analysis using a modified agent and a XML dictionary containing control sums. This function, available only through the « Linbox » modified OCS agent, brings the possibility to detect software installed outside standard packaging systems using the binaries MD5 hash.
The administrator is proposed to fulfill its own signatures in this dictionary, whose location is given thanks to the « dictionary_path » parameter which you will find in the LRS config file /etc/lbs.conf (default is /tftpboot/revoboot/lrs-inventory/dictionary/dictionary.xml).
The dictionary DTD is:
<!DOCTYPE Dictionary [
<!ELEMENT Dictionary (Software*)>
<!ELEMENT Software (ProductPath?,ProductName,ExecutableSize?,Company?,
Application?,Type?,ProductVersion?,Comments?)>
<!ATTLIST Software md5sum CDATA #REQUIRED>
<!ELEMENT ProductPath (#PCDATA)>
<!ELEMENT ProductName (#PCDATA)>
<!ELEMENT ExecutableSize (#PCDATA)>
<!ELEMENT Company (#PCDATA)>
<!ELEMENT Application (#PCDATA)>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT ProductVersion (#PCDATA)>
<!ELEMENT Comments (#PCDATA)>
]>For example a dictionary can contain the following sentences:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE REQUEST>
<Dictionary>
<Software md5sum="e406b30dd2947e9e901aba538c68fdf3">
<ProductPath>/usr/bin/ocsinventory-agent<ProductPath>
<ProductName>OCS Inventory Unified Agent<ProductName>
<ExecutableSize>10627<ExecutableSize>
<Company>Linbox - F&AS<Company>
<Application>Inventoring<Application>
<Type>Inventoring<Type>
<ProductVersion>0.6.11<ProductVersion>
<Comments>A useful inventory tool<Comments>
</Software>
<Dictionary>The analysis function is located in lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Find.pm. If your agent doesn't have this file, please install a Linbox packaged version. Some parameters have to be filled in /etc/ocsinventory/ocsinventory-agent.cfg for this function to work:
- OCS_AGENT_DICO
If you need to change the location of the dictionary file cache (default is /etc/ocsinventory/dictionary).
- OCS_AGENT_DICO_DIRS
Les directories where the script will try to locate binary files corresponding to dictionary entries. This paths have to be columns-separated.
![[Note]](/ucome.rvt/any/en/Produits/LRS/details/doc/img/note.png)
This function will be disabled if OCS_AGENT_DICO_DIRS contains nothing (i.e. its value is '').
One can customize inventory data using external scripts. For this you will have to drop the relevant scripts in OCS_AGENT_SCRIPT_PATH (which is defined in /etc/ocsinventory/ocsinventory-agent.cfg and defaulting to /etc/ocsinventory/scripts).
To inject results in the inventory using this scripts, those have to write on STDOUT a XML file compliant to the following DTD:
<!DOCTYPE REQUEST [ <!ELEMENT REQUEST (CONTENT)> <!ELEMENT CONTENT (SOFTWARES*)> <!ELEMENT SOFTWARES (PUBLISHER?,NAME,VERSION?,FOLDER?,COMMENTS?,FILESIZE?)> <!ELEMENT PUBLISHER (#PCDATA)> <!ELEMENT NAME (#PCDATA)> <!ELEMENT VERSION (#PCDATA)> <!ELEMENT FOLDER (#PCDATA)> <!ELEMENT COMMENTS (#PCDATA)> <!ELEMENT FILESIZE (#PCDATA)> ]>
For example:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE REQUEST>
<REQUEST>
<CONTENT>
<SOFTWARES>
<PUBLISHER>Linbox</PUBLISHER>
<NAME>OCS Inventory</NAME>
</SOFTWARES>
</CONTENT>
</REQUEST>This inventory is merged with the regular inventory then send to the server.
When clients can no reach the LRS (no network connection f.e.), it is still possible to manually inject inventories into the LRS inventory database.
![]() | |
This feature is unavailable under Debian Woody systems. |
To being able to use this feature, one should install the following Perl libraries on the server: xml-simple and www.
On Debian systems, a simple:
apt-get update; apt-get install libxml-simple-perl libwww-perl
should be enough. Please read your system manual for other distros.
Here is how to gather inventories results on inventory-agent equipped MS Windows platforms:
Open a DOS command line window (execute -> cmd),
Walk to the agent folder, for example:
cd c:\Program Files\OCS Inventory NG
Run the collect using the following command line:
start /wait ocsinventory.exe /local /xml
Get the just generated inventory file in the current directory (<CLIENT>-<TIMESTAMP>.xml).
To fill the inventory into the LRS, after having copied the .xml file onto the server (for example in /tmp using WInSCP), run the following command:
/usr/share/webmin/lrs-inventory/agent/Ocsinventory_local.pl --url http://127.0.0.1/ocsinventory --file /tmp/<MACHINE>-<HORODATAGE>.xml
Please install the WWW Perl lib (see above) if you got the following error:
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/webmin/lrs-inventory/agent/Ocsinventory_local.pl line 15. BEGIN failed--compilation aborted at /usr/share/webmin/lrs-inventory/agent/Ocsinventory_local.pl line 15.
Please install the XML-Simple Perl lib (see above) if you got the following error:
Can't locate XML/Simple.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/webmin/lrs-inventory/agent/Ocsinventory_local.pl line 16. BEGIN failed--compilation aborted at /usr/share/webmin/lrs-inventory/agent/Ocsinventory_local.pl line 16.














![[Warning]](/ucome.rvt/any/en/Produits/LRS/details/doc/img/warning.png)