5. Inventory

The Inventory menu provides all the necessary elements to add the entire group of items that the company has available, their location, manufacturer, support contracts, people and their contact numbers, etc. Objects in the inventory are a key part of the ticketing system since they allow a ticket to be associated to a business related asset.

Within the Inventory there are different types of object. A user can create new types and also modify, add or delete fields for any type of object.

doc36.jpg

Creating an inventory item type

Inventory item types customize the different elements that will be used in the inventory. It can manage object types by clicking Object Types.

An inventory item type has a name, icon, minimum stock value and a description. Plus, you can define if this type will appear or not as “root” in the inventory's 'tree' view.

Each object type has a series of custom fields. In the example, the object type denominated Software has the associated fields Version and Manufacturer

doc38.jpg

Fields include the following:

  • Label
  • Type: numeric, text, combo, external
  • Reference field for the parent chart
  • Unique: two inventory objects may not have the same value in this field (similar to an ID)
  • Inherit: will adopt the values of the owner, users and companies of the parent object
  • Show list: obsolete
  • Updates not permitted: the field won't update when receiving data from remote inventory

doc39.jpg

External type fields

External type fields show information from external charts in the database, inputted manually by an administrator. To configure and use an external type field:

  • Name of the external table: the exact name, from the database, of the chart you're going to use.
  • Field to be shown: name of the column which contains the values which will ultimately be shown in your inventory object.

Using this configuration it's possible to use an external type field. When creating or modifying an inventory object which contains external fields a modal window appears with the information from the external table:

Furthermore, external type fields can be related among each other, creating dependencies; in order to do this the two external tables to be used in the two external fields must be related in one of the two columns, which will usually be an ID. Normally the parent table will have an ID column which is its “primary key”, and the child table will have an ID type column which corresponds to a “foreign key”, the column which relates the child chart with its parent. This means that the values selected for the first table will affect the values of the second. When creating an external type field you have to do some additional configurations in both the parent and child fields. To correctly configure the relation, you have to complete the additional fields.

Parent chart:

  • Primary key: ID field or “primary key”, normally corresponds to the ID column. Only necessary when it is a parent table/field.

Child chart:

  • Foreign key: child table field which connects both charts. Only necessary when it is a child table/field.
  • Parent chart name: only necessary when it is a child table/field

Example

You have a chart which has been added manually, tubicacion, with two columns: ID and Ubicacion; the first is the unique ID, the second the value you want to show.

doc40.jpg

To configure an external type field which uses the information contained in this field, fill it out in the following way:

doc41.jpg

As you can see, in the first case you use the table name tubicacion, and in the second, the column you want to display in your external type field ubicacion.

Once completed, when you want to create an inventory object type which contains this external field, follow the following steps. “Create inventory object” and see the following:

These fields can have a unique value that acts as an identifier and that can be marked for inheritance by other items. Another feature is that they can be marked to be shown on the search. This way, viewing the inventory on a search can also be flexible.

Custom fields can be numeric, text only, combined or external.

External type fields allude to an external table found in the database and that can be related to other charts. When created, the chart name and ID field for it must be detailed. In case of it being related with another chart, the name of the fathering chart and the name of the field where the ID value for said fathering chart can be found, will also need to be specified.

When it comes to selecting the value of these fields, a modal window will appear with all the information on the external chart.

To add an external chart and afterwards use it on inventory items, you'll only need to 
add the chart you want along with the corresponding data from Integria's database. 
Maintenance on this chart is done manually, operating on it with SQL sentences, 
or using an external chart editor provided by Integria IMS.  

External chart editing

In the list of inventory object types, those that have fields from external sources will have a chart editing icon.

On this chart users can perform editing and deleting operations on existing data, as well as add new data.

Creating an inventory item

To create a new inventory item click the option “Create inventory item” from the left. You'll see the following form with all the available options to configure that inventory item.

The most important fields on this form are: owner, associated companies, associated users and public. These fields define who sees the object. This way, the object will only be accessible by the owner, users directly related to an item or that belong to a related company. Furthermore, if the public flag is checked everyone is able to see the item.

An inventory item can have an established item “hierarchy” (one item can be a “child” to another). This is defined when deciding a “parent”. Apart from this hierarchic relationship, other relationships among items can be established.

Integria IMS's inventory has a simple stock control system. In order to manage a stock item, all items from an inventory have a “status” field which permits this stock system. Possible statuses include: new, in use, unused, or unsubscribed. The signup and unsuscription dates can also be registered.

Let's look at an example of an inventory item:

The Relationships tab shows the other items related to a primary item. New items can be related, users only need to choose them from the combination and link it like we show below. This way other items apart from a parenting item can be interrelated.

The Contacts tab shows us people related to that inventory item. We can click on any of them to directly access their information.

The linked tickets tab indicates the inventory item, what tickets have been applied to it, along with the status for those tickets. We can click on any of them to directly access the information.

The Tracking tab shows changes that take place on the inventory item such as owner changes, if an item type is assigned, parent items, etc.

Inventory searches

Results of inventory searches can be seen in two ways: tree graph or list.

In the tree graph view, inventory items are shown grouped by their corresponding types. Stock can also be seen, showing: total units, new units, unused units, minimum stock. If the number of total units is less than the minimum stock, it'll be marked in red.

In the list view information about the inventory is shown, along with its custom fields that have been marked to be shown.

Fields that searches can be performed on are:

  • Search (free text field): which refers to the name or inventory description. This is so if no custom fields are chosen. In this case, the search is limited to those fields' values too.
  • Item type
  • Custom fields in the item type
  • Owner
  • Contract
  • Manufacturer
  • Status
  • Related user
  • Related company
  • Parent object

Plus, a user can export search results to CSV and HTML formats in order to obtain lists that can be added to any type of report.

Importing inventory data from a CSV file

There is an option to import inventory data from a CSV file. To do this, the file has to be loaded with a header and a line per inventory object.

The header must be in the first row of our CSV and must contain at least the name column since the name of the inventory object must exist.

Let’s have a look at the columns to be added:

  • name: As we’ve said previously, it has to appear in our CSV, since inventory objects cannot be created without a name, we also need to consider the setup option that allows you to have names of duplicated inventory objects.
  • owner: This column collects ids of the users who are owners of the object, which must exist in the bbdd, if this column is not added, the value entered by default will be empty.
  • id_parent: The id of the parent inventory object will be in this column, which must exist in the bbdd. By default it is 0.
  • id_manufacturer: The id of the companies to which each inventory object belongs will be in this column, therefore these companies must exist in the bbdd. By default it is 0.
  • id_contract: the contract id to which each inventory object belongs will be in this column. By default it is 0.
  • status: the four state types that exist can only be collected in this column and therefore it will not accept any value different from (new, inuse, unused, issued).
  • receipt_date: the date of receipt will be in this column and it must have a valid date format.
  • issue_date: the date of use will be in this column and it must have a valid date format.
  • description: the description of the inventory object will be here. By default, it will be empty.
  • public: It will only admit value 0 or 1 depending on whether it’s private or not. By default 1
  • id_company: There might be one or several associated companies, therefore we will introduce the ids as follows : [ id1 . id2 .id3 . id4 ] It’s quite important to use full stops here.
  • associated_user: There might be one or several associated users, therefore we will introduce the ids as follows: [ id1 . id2 .id3 . id4 ] It’s quite important to use full stops here.
  • id_object_type: the id of the type of objects which must exist in the bbdd will be in this column. By default 0.

The rest of the columns to be added will belong to the custom fields of a type of object; in which we can find four types of different fields, which must respect the limitations of these fields:

  • Fields of text type: It has no limitations.
  • fields of numeric type: it only allows numbers, therefore the column of this field should only contain numbers.
  • Fields of combo type: it allows a list of words, therefore the characters to be entered in this column can only be those that are included in that list.
  • Fields of external type: These fields allow you to associate external tables to introduce the values, the existence of ​such table and its references will be validated.

All custom fields must also comply if they are unique or not. This depends on whether you have selected the creation of custom fields, which will cause you to be unable to enter values ​​that already exist in these custom fields.

Let's see an example to understand it better:

As we see in the image, the ordered columns are shown but it is not necessary to maintain a specific order, in this csv we will introduce two objects, (test and test2) in which we’ll introduce all the fixed columns up to public, it is only necessary to enter the name, the rest depends on whether you want to fill in or not. When no columns are shown, the default value will be entered, only when you want to enter the custom fields of an object type then it will be necessary to enter the column id_object_type to find out what type of object these custom fields belong to.

In the image, the column (Field text) has custom fields, these fields belong to the id of object 18 but it is not necessary to enter all the columns of the fields, which means that if your object type has 8 custom fields and you just want to consider two of them, you will only put the columns of those two. If it’s necessary to call them exactly the same as the name of the field because your custom field has that name, for example our image is called Field text because my custom field has that name, if I was to put “Fieldtext1” (as it is not called exactly as my custom field) then it would cause an error.

Synching inventory with Pandora FMS

Integria can create inventory items by synchronizing information from existing agents on an instance of Pandora FMS that is present in your system.

To begin, configure the parameters that connect Integria IMS with Pandora FMS. Configuration for this can be found in the “Setup” menu under the “Pandora FMS Inventory” option.

On the form the user must configure mandatory parameters:

  • Pandora FMS URL: url through which the Pandora FMS console is accessible
  • Pandora FMS API password: API password for Pandora FMS. This parameter is configured in Pandora FMS' console.
  • Pandora FMS User: username with which the information on Pandora FMS can be accessed.
  • Pandora FMS User password: password corresponding to the Pandora FMS username.
  • Default Contract: the default contract linked to the item.

Inventory synchronization is done using the maintenance script once a day. You can read on how to install this script in the “Script Installation” section of maintenance.

In our instance of Pandora FMS we have the following agents installed and we want to synchronize them into Integria's inventory.

Once configured, Integria will synchronize the agents and the inventory and, from that moment on, you'll have agents available under the inventory item type “Pandora agents”.

This synchronization creates inventory items with the information from monitored agents on the Pandora FMS server.

These fields are fixed and it's impossible to expand them. If you need to customize information extraction from a device or PC you can use the automatic inventory with agents from Pandora FMS.

Remote inventory based on Pandora FMS agents

This Enterprise feature allows the user to extract custom information from an inventory on any device or operating system.

The remote inventory is based on the use of software agents from Pandora FMS, which are installed on devices from which we wish to extract information.

Agents collect information from the inventory using scripts, and then send it to the server where Integria IMS is running. Once the information is received, Integria will process it and create the corresponding inventory items based on the data received.

Unlike inventory synchronization with Pandora FMS, in order to use the 
remote inventory based on Pandora FMS agents it's not necessary to install 
the Pandora FMS application; you only need to install the agents 
on the desired devices. 

Internal workings of the remote inventory

Pandora FMS agents send an XML file with the inventory information to the server that supports Integria IMS. Integria then processes these files using the maintenance script. File processing takes place every 5 minutes.

With the information from the inventory sent in the XML, various inventory items will be created. This way, if an agent sends information about 12 applications that are installed on the system, 13 inventory items will be created (one for the agent and 12 for the different applications).

When information is received about a device or inventory element, two things can happen:

  1. That the element exists: then the information in the inventory will be updated.
  2. That the element doesn't exist: in this case, a new inventory item will be created only if the type of item associated to it is defined in Integria.
It's important to define item types that will be used before starting to 
create the inventory. Next we'll explain how data acquisition works in detail, 
where you'll be able to see how different elements are related to types. 

Pandora FMS agents are linked to the type named "Pandora Agents". 
This means that for the inventory to work, it's necessary for this to be defined. 
The rest of the inventory items are linked to their types as explained below. 

The following XML with inventory information can be sent by a Pandora FMS agent.

<?xml version='1.0' encoding='UTF-8'?>
<agent_data description='' group='' os_name='linux' os_version='"CentOS release 6.4 
(Final)"' interval='300' version='4.1(Build 130822)' timestamp='2013/10/22 09:27:38' 
agent_name='localhost.localdomain' timezone_offset='0' address='192.168.70.163'>
 <inventory>
  <inventory_module>
    <name><![CDATA[Users]]></name>
    <datalist>
      <data><![CDATA[root]]></data>
    </datalist>
  </inventory_module>
  <inventory_module>
    <name><![CDATA[Process]]></name>
    <datalist>
      <data><![CDATA[COMMAND]]></data>
      <data><![CDATA[/sbin/init]]></data>
      <data><![CDATA[[kthreadd]]]></data>
      <data><![CDATA[[migration/0]]]></data>
      <data><![CDATA[[ksoftirqd/0]]]></data>
      <data><![CDATA[[scsi_eh_6]]]></data>
      <data><![CDATA[sh -c ps -eo command |  tr -d "" ]]></data>
      <data><![CDATA[ps -eo command]]></data>
      <data><![CDATA[tr -d ]]></data>
    </datalist>
  </inventory_module>
  <inventory_module>
    <name><![CDATA[Software]]></name>
    <datalist>
      <data><![CDATA[acl;2.2.49;Access control list utilities]]></data>
      <data><![CDATA[acpid;1.0.10;ACPI Event Daemon]]></data>
      <data><![CDATA[alsa-lib;1.0.22;The Advanced Linux Sound Architecture (ALSA) 
      library]]></data>
      <data><![CDATA[alsa-plugins-pulseaudio;1.0.21;Alsa to PulseAudio backend]]>
      </data>
      <data><![CDATA[zenity;2.28.0;Display dialog boxes from shell scripts]]></data>
      <data><![CDATA[zip;3.0;A file compression and packaging utility compatible 
      with PKZIP]]></data>
      <data><![CDATA[zlib;1.2.3;The zlib compression and decompression library]]>
      </data>
    </datalist>
  </inventory_module>
  <inventory_module>
    <name><![CDATA[File system]]></name>
    <datalist>
      <data><![CDATA[tmpfs;0;244M;/dev/shm]]></data>
      <data><![CDATA[/dev/sda1;34M;426M;/boot]]></data>
    </datalist>
  </inventory_module>
 </inventory>
 </agent_data>
 

Integria will create an item for the agent which reported the XML, and after it will process the different inventory modules separately, for example:

<inventory_module>
    <name><![CDATA[Software]]></name>
    <datalist>
      <data><![CDATA[acl;2.2.49;Access control list utilities]]></data>
      <data><![CDATA[acpid;1.0.10;ACPI Event Daemon]]></data>
      <data><![CDATA[alsa-lib;1.0.22;The Advanced Linux Sound Architecture (ALSA) 
      library]]></data>
      <data><![CDATA[alsa-plugins-pulseaudio;1.0.21;Alsa to PulseAudio backend]]>
      </data>
      <data><![CDATA[zenity;2.28.0;Display dialog boxes from shell scripts]]></data>
      <data><![CDATA[zip;3.0;A file compression and packaging utility compatible 
      with PKZIP]]></data>
      <data><![CDATA[zlib;1.2.3;The zlib compression and decompression library]]>
      </data>
    </datalist>
  </inventory_module>

The name defined on the XML will be chosen for the inventory module, which is in the case is “Software”, in order to identify which item type is linked to these items. After, inventory items with this type will be created for each element reported on the XML:

<datalist>
  <data><![CDATA[acl;2.2.49;Access control list utilities]]></data>
  <data><![CDATA[acpid;1.0.10;ACPI Event Daemon]]></data>
  <data><![CDATA[alsa-lib;1.0.22;The Advanced Linux Sound Architecture (ALSA) 
  library]]></data>
  <data><![CDATA[alsa-plugins-pulseaudio;1.0.21;Alsa to PulseAudio backend]]>
  </data>
  <data><![CDATA[zenity;2.28.0;Display dialog boxes from shell scripts]]></data>
  <data><![CDATA[zip;3.0;A file compression and packaging utility compatible 
  with PKZIP]]></data>
  <data><![CDATA[zlib;1.2.3;The zlib compression and decompression library]]>
  </data>
</datalist>

Inventory items separate the information with semi-colons (;). Information will be broken down as can be seen below:

<data><![CDATA[acl;2.2.49;Access control list utilities]]></data>
acl     2.2.49     Access control list utilities

The first component defines the name for the new inventory item, the rest of the components are linked to the item type fields, in the same order in which they appear on the object definition in the inventory. In this case, the second element is associated to Version and the third to Description.

Furthermore, all items corresponding to the elements will have the agent that reported them through XML as a parent. The final result for the inventory item created for that element on the XML would look something like what can be seen in the following image:

In the inventory, along with the items created from the different inventory modules on the XML, an item for the agent will appear and, in this case, be named localhost.localdomain

Integria IMS has its main inventory modules defined by default for Windows agents: software, patches, HD, video, services and RAM. Below we can see an example of how it would look.

Configuring the remote inventory

Configuring the automatic inventory can be found on the Setup menu in the tab Pandora FMS Inventory. Inside this section, a subsection named Remote Inventory can be found.

Configurable fields are:

  • Default owner: the default owner for the new inventory item.
  • Associated company: companies assigned by default to the new inventory item.
  • Associated user: users assigned by default to the new inventory item.
The Default owner field is mandatory, if left without configuring, 
new items on the inventory won't be created. The rest of the fields are meant 
for access ACL configuration and item viewing. 

Apart from configuring the mentioned fields, it's also necessary to enable the maintenance script. The installation process for this script can be seen in the section titled “Installing the maintenance script”.

If you don't enable the maintenance script, files sent by 
Pandora FMS agents won't be processed. 

File sending is made through a TCP connection to port 41121. 
Because of this in order for this feature to work correctly, you may have to 
review routing or firewall rules on your network.

Configuring Pandora FMS agents

To extract information from devices you'll need to install Pandora FMS agents. You can check agent compatibility with your systems in the section named “Software Agent Requirements”, found in the Pandora FMS user manual.

There are versions of Pandora FMS software agents available for multiple platforms and each has an installation process. All the information on these different installation processes is available on the “Installing Pandora FMS agents” section of the Pandora FMS manual.

Additional parameters to be configured on the agent are the following:

  • server_ip: IP for the server that runs Integria IMS.
  • server_path: receiving directory for server files.
  • module_plugin: command to execute scripts that will extract information from the inventory.

All the information on software agent configuration is in the “Pandora FMS Software Agents” section in the Pandora FMS installation manual.

Pandora FMS agents have a default plugin module to extract information from the inventory. It can be executed with the following command:

module_plugin inventory 1 cpu ram video nic hd cdrom software 
init_services filesystem users process ip route

Inventory customizing

If you wish to customize the information that is retrieved you can modify this script or create your own. In the “Module Creation on Local Inventories” section of the Pandora FMS manual you can see the XML structure for inventory modules and examples on how to create inventory modules for Linux and Windows platforms.


Integria Documentation