Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:documentation:04_using:04_inventory [2021/07/08 08:24]
laura.cano [Local inventory setup for software agents]
en:documentation:04_using:04_inventory [2021/09/16 09:17] (current)
Line 365: Line 365:
  
 == Inventory module within UNIX systems through software agent == == Inventory module within UNIX systems through software agent ==
 +
 The UNIX software agent module locally uses a plugin to retrieve information about different aspects of the machine, both software and hardware related. The UNIX software agent module locally uses a plugin to retrieve information about different aspects of the machine, both software and hardware related.
  
Line 371: Line 372:
 <code> <code>
 module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
-</code> 
  
 +</code>
  
 The module consists of one line and the following parameters: The module consists of one line and the following parameters:
Line 378: Line 379:
   * Module activation   * Module activation
  
-<WRAP center round box> +<code>module_plugin inventory " 1 cpu ram video nic hd cdrom software init_services filesystem users route
-**//module_plugin inventory//** " 1 cpu ram video nic hd cdrom software init_services filesystem users route</WRAP>+
  
-  * Field where it is set how often the module will be executed (in days). If the value is '0', the inventory information will be sent on every agent execution.+</file> 
 +  * Field where it is set how often the module will be executed (in days). If the value is 0, the inventory information will be sent **on every agent execution**.
  
-<WRAP center round box> +<code>module_plugin inventory " 1 " cpu ram video nic hd cdrom software init_services filesystem users route
-module_plugin inventory " //**1**// " cpu ram video nic hd cdrom software init_services filesystem users route</WRAP>+
  
 +</file>
   * Field where the defined inventory objects are collected.   * Field where the defined inventory objects are collected.
  
-<WRAP center round box> +<code>module_plugin inventory 1 " cpu ram video nic hd cdrom software init_services filesystem users route "
-module_plugin inventory 1 " **//cpu ram video nic hd cdrom software init_services filesystem users route//** "</WRAP>+
  
-Just like in the Windows agent, it is possible to collect the following objects:+</file>
  
-  * **CPU:** It obtains information about CPUs. +Just like in the MS Windows® agent, it is possible to collect the following objects:
-  * **cdrom:** It obtains information about CDROMs. +
-  * **video:** It obtains information about VGAs. +
-  * **hd:** It obtains information about hard drives. +
-  * **nic:** It obtains information about network interface controllers. +
-  * **patches:** It obtains information about the installed patches. +
-  * **software:** It obtains information about the installed software. +
-  * **ram:** It obtains information about the RAM modules. +
-  * **filesystem:** It obtains information about the system's partitions. +
-  * **users:** It obtains information about the users. +
-  * **init_services:** It obtains information about the initiated services. +
-  * //Route:// It collects information about the system path table.+
  
-You may find the plugin that collects the inventory in the directory named '/etc/pandora/plugins'.+  * **CPU:**  It obtains information about CPUs. 
 +  * **ram:** It collects information about RAM modules. 
 +  * **video:**  It obtains information about VGAs. 
 +  * **hd:**  It obtains information about hard drives. 
 +  * **cdrom:** It collects information about the optical disk reading devices. 
 +  * **nic:**  It obtains information about network interface controllers. 
 +  * **patches:**  It obtains information about the installed patches. 
 +  * **software:**  It obtains information about the installed software. 
 +  * **ram:**  It obtains information about the RAM modules. 
 +  * **filesystem:**  It obtains information about the system's partitions. 
 +  * **users:**  It obtains information about the users. 
 +  * **init_services:**  It obtains information about the initiated services. 
 +  * **Route**//://  It collects information about the system path table. 
 +You may find the plugin that collects the inventory in the directory named ''/etc/pandora/plugins''
  
 It is also possible to set the plugin to gather all available information. In this example, the plugin will obtain all daily information on the inventory: It is also possible to set the plugin to gather all available information. In this example, the plugin will obtain all daily information on the inventory:
Line 413: Line 415:
  # Plugin for inventory on the agent (Only Enterprise)  # Plugin for inventory on the agent (Only Enterprise)
  module_plugin inventory 1  module_plugin inventory 1
 +
 </code> </code>
  
-In order to activate the inventory module, copy the previously described code within the software agent 'pandora_agent.conf' file. This activation could be achieved locally on the machine or remotely from the agent's remote configuration.+In order to activate the inventory module, copy the previously described code within the software agent ''pandora_agent.conf'' file. This activation could be achieved locally on the machine or remotely from the agent's remote configuration. 
 + 
 +{{  :wiki:in32.png?800  }}
  
-  
-{{ wiki:in32.png?800 }} 
  
 == Assigning Local Modules == == Assigning Local Modules ==
-It is not necessary to activate the modules in the agents defined within the console. If the modules have been created in //Configuration// > //Inventory Modules//, the OS matches and the execution is defined in the software agent configuration file, the collected data will appear directly on the //view// > //inventory// section of the console agent. 
  
-{{ wiki:in33.png?800 }}+It is not necessary to activate the modules in the agents defined within the console. If the modules have been created in **Configuration** → **Inventory modules**, the OS matches and the execution is defined in the software agent configuration file, the collected data will appear directly on the **View** → **Inventory** section of the console agent. 
 + 
 +{{  :wiki:in33.png?800  }} 
  
 == Creating local inventory modules (software agent) == == Creating local inventory modules (software agent) ==
-In addition to the default inventory systems, you may create inventory modules for UNIX and Windows-based systems easily.  + 
-Create a script that generates an XML file with the following structure:+In addition to the default inventory systems, you may create inventory modules for Unix® and Windows® systems easily. 
 + 
 +Basically, it creates a script that generates an XML file with the following structure:
  
 <code> <code>
Line 439: Line 446:
 </inventory_module> </inventory_module>
 </inventory> </inventory>
 +
 </code> </code>
  
 +**INVENTORY_MODULE_NAME**: The name should match that of the module that registered the inventory modules in Pandora FMS console.
  
-**"INVENTORY_MODULE_NAME"**: The name should match that of the module that registered the inventory modules in Pandora FMS console. +**DATA1;DATA2**: The data you intend to retrieve, which have been defined in the inventory module.
-**"DATA1;DATA2..."**: The data you intend to retrieve, which have been defined in the inventory module.+
  
-Supposing you intend to get an ARP table and the IPs along with their interfaces (see the previous example regarding remote inventory modules). Use the command //arp -a// and clean out the output to obtain the desired data. +Suppose you intend to get an ARP table and the IPs along with their interfaces ([[https://prewebs.pandorafms.com/manual/en/documentation/04_using/04_inventory#complete_example_of_a_remote_inventory_module|see the previous example]] regarding remote inventory modules). Use the command //arp -a// and clean out the output to obtain the desired data.
- +
-This time, it will be developed in Windows; the 'C:\tmp\windows_arp_inventory.bat' script with the following definition:+
  
 +Now to develope it in Windows® type in the script the ''C:\tmp\windows_arp_inventory.bat'' with the following definition:
 <code> <code>
 +
 @echo off @echo off
 echo ^<inventory^> echo ^<inventory^>
Line 460: Line 468:
 echo ^</inventory_module^> echo ^</inventory_module^>
 echo ^</inventory^> echo ^</inventory^>
 +
 </code> </code>
  
 +Modify the ''pandora_agent.conf'' and add the following line:
 +<code>
  
-Modify the 'pandora_agent.conf' and add the following line:+module_plugin cmd.exe /C C:\tmp\windows_arp_inventory.bat
  
-  module_plugin cmd.exe /C C:\tmp\windows_arp_inventory.bat+</code>
  
-<WRAP center round important 60%> +<WRAP center round important 60%> This script is executed every five minutes (the default agent interval). If you want it to be executed every X minutes, implement that logic into the script itself or use the [[:en:documentation:03_monitoring:02_operations|programmed monitoring]]. </WRAP>
-This script is executed every five minutes (the default agent interval). If you want it to be executed every X minutes, implement that logic into the script itself or use the[[en:documentation:03_monitoring:02_operations|programmed monitoring]]. +
-</WRAP>+
  
-In order for the local script execution to store inventory information, it must have an inventory module defined in the console, specifying the OS, the module's name and the data to be stored separated by ";". Do not forget to create the inventory module in Pandora FMS before restarting the Pandora FMS agent, so that it inherits the changes.+Remember: In order for the local script execution to store inventory information, it must have an inventory module defined in the console, specifying the OS, the module's name and the data to be stored separated by '';''. Do not forget to create the inventory module in Pandora FMS before restarting Pandora FMS agent, so that it loads the changes, create Pandora FMS inventory module:
  
-{{ wiki:inventory_sample4_.png?400 }}+{{  :wiki:inventory_sample4_.png?400  }}
  
-Make sure that when it is a local module it has the "interpreter" and "code" fields empty and the OS one filled out.+Make sure that when it is a local moduleit has the **Interpreter** and **Code** fields empty and the OS one filled out.
  
-The results obtained here are the same as the ones for the remote module's equivalent under Linux:+The results obtained here are the same as the ones for the remote module's equivalent under GNU Linux:
  
-{{ wiki:inventory_sample5_.png?700 }}+{{  :wiki:inventory_sample5_.png?700  }} 
 + 
 +There are a lot more local and remote inventory modules available for download within the [[http://pandorafms.com/library/|Pandora FMS Module Library.]] You may also easily develop your own, as seen throughout this chapter.
  
-There are a lot more local and remote inventory modules available for download within the [[http://pandorafms.com/library/|**Pandora FMS Module Library.**]] You may also easily develop your own, as seen throughout this chapter. 
  
 ==== Data display for the inventory ==== ==== Data display for the inventory ====
-Inventory data that have been locally or remotely collected from a system can be viewed from the agent or the console's inventory menu.+ 
 +Inventory data that have been locally or remotely collected from a system can be seen from the agent or the console's inventory menu. 
  
 === Inventory Data Display in the Inventory Menu === === Inventory Data Display in the Inventory Menu ===
-By clicking on 'Monitoring' -> 'Inventory', it is possible to view all agent inventory data, search and export data to a CSV. 
  
-{{ wiki:in37.png?800 }}+By clicking on **Monitoring** → **Inventory**, it is possible to view all agent inventory data, search and export data to a CSV. 
 + 
 +{{  :wiki:in37.png?800  }}
  
 The fields which could be used for searches are the following: The fields which could be used for searches are the following:
  
-  * **Group:** Choose the agent group you intend to filter by. The user will be able to see only the groups he/she belongs to, unless the user explicitly belongs to the [[en:documentation:04_using:11_managing_and_administration#Group_all|ALL group]]. +  * **Group:**  Choose the agent group you intend to filter by. The user will be able to see only the groups it belongs to, unless the user explicitly belongs to the [[:en:documentation:04_using:11_managing_and_administration#group_all|ALL group]]. 
-  * **Module:** Choose the inventory module you intend to filter by. +  * **Module:**  Choose the inventory module you intend to filter by. 
-  * **Agent:** Type in  the agent name you intend to filter by. +  * **Agent:**  Type in the agent name you intend to filter by. 
-  * **Search:** Type in a text in order to search by all inventory fields.+  * **Search:**  Type in a text in order to search by all inventory fields
 +With searches it is also possible to see all module agents which have an inventory, by selecting All within the search options and clicking on **Search**.
  
-It is also possible to see all module agents which have an inventory by selecting 'All' within the search options and clicking on 'Search'.+{{  :wiki:in38.png?800  }}
  
-{{ wiki:in38.png?800 }}+Or a specific module in all agents with inventory by selecting the module and clicking on **Search**.
  
-Or a specific module in all agents with inventory by selecting the module and clicking on 'Search'.+{{  :wiki:in39.png?550  }}
  
-{{ wiki:in39.png?550 }} 
  
 === Inventory dates and changes === === Inventory dates and changes ===
-In the detail view of an inventory agent, you may choose the specific inventory report date you want to see through a selector: 
  
-{{ wiki:Vista_inventario_diff.png }}+In the detail view of an inventory agent, you may choose the specific inventory report date you want to see through a selector:
  
 +{{  :wiki:vista_inventario_diff.png  }}
  
 If you see there are dates missing, it is likely to be due to data changes regarding the last inventory execution. That means, Pandora FMS only stores inventory data when these change compared to the last execution. If you see there are dates missing, it is likely to be due to data changes regarding the last inventory execution. That means, Pandora FMS only stores inventory data when these change compared to the last execution.
 +
  
 === Exporting the Inventory Data to CSV === === Exporting the Inventory Data to CSV ===
-By clicking on 'Monitoring' and 'Inventory' it's possible to export inventory data which are the result of a filtering to a CSV file. 
  
-Choose the filter and once there is any data, click on 'Export to CSV'.+From **Monitoring** > **Inventory** it is possible to export inventory data which are the result of a filtering to CSV file.
  
-{{ wiki:in40.png }}+Choose the filter and once there is any data, click on **Export CSV**. 
 + 
 +{{  :wiki:in40.png  }} 
 + 
 +A file containing inventory data, separated by semicolon is created.
  
-It creates a file containing inventory data, separated by semicolon. 
  
 === Inventory version differences === === Inventory version differences ===
 +
 **Block mode** **Block mode**
  
-From Pandora FMS version 5.1, inventory information can be viewed in two columns so differences can be spotted easily. Block mode specifies that the result of an inventory module is a single element, instead of interpreting each line as a different element of the same type, as it has been done in the previously seen inventory modules.+From Pandora FMS version 5.1, inventory information can be viewed in two columns so differences can be spotted easily. **Block mode** specifies that the result of an inventory module is a single element, instead of interpreting each line as a different element of the same type, as it has been done in the previously seen inventory modules.
  
 Block mode is configured when defining a remote or local inventory module: Block mode is configured when defining a remote or local inventory module:
  
-{{ wiki:Block_mode_setup.png?800 }}+{{  :wiki:block_mode_setup.png?800  }}
  
 When there is a module with block mode enabled, it allows seeing the divided view (to visually see the changes): When there is a module with block mode enabled, it allows seeing the divided view (to visually see the changes):
  
-{{ wiki:Diff inventory.png?800 }}+{{  :wiki:diff_inventory.png?800  }}
  
 In the two column view, all differences between one inventory version and another are shown. Even the date filtering version can be seen. In the two column view, all differences between one inventory version and another are shown. Even the date filtering version can be seen.
  
-{{ wiki:Pandora FMS the Flexible Monitoring System 2014-07-01 19.09.10.png?800 }}+{{  :wiki:pandora_fms_-_the_flexible_monitoring_system_-_2014-07-01_19.09.10.png?800  }}
  
 Remember each time an inventory module change is detected, a new event will be generated. Remember each time an inventory module change is detected, a new event will be generated.
  
-{{ wiki:Events inv.png?799 }}+{{  :wiki:events_inv.png?799  }}
  
  
 ==== Inventory alerts ==== ==== Inventory alerts ====
-The inventory alerts added in version 751 help launch specific alerts on the inventory content of an agent group. Similarly to SNMP alerts or event alerts, they are not applied agent by agent but rather they are global, in this case, they are applied by groups.  
  
 +<WRAP center round tip 60%> Version 751 NG or later. (Dec/2020) </WRAP>
  
-<WRAP center round tip 60%> +Inventory alerts help launch specific alerts on the inventory content of an agent group. Similarly to SNMP alerts or event alerts, they are not applied agent by agent but rather they are global, in this case, they are applied by groups.
-Inventory alerts are featured from version 751 (Dec/2020) +
-</WRAP>+
  
-To configure them, go to section //Alerts -> Inventory alerts//+To configure them, go to section **//Alerts → Inventory alerts.// **
  
-{{ wiki:alerta-inventario-1.png?400 }}+{{  :wiki:alerta-inventario-1.png?400  }}
  
 +Inventory alerts have fields similar to other alerts such as name, description, time threshold and action, as indicated in [[https://prewebs.pandorafms.com/manual/en/documentation/04_using/01_alerts|Pandora FMS alert chapter]]. We will focus on what makes them different.
  
-Inventory alerts have fields similar to other alerts such as namedescription, //time threshold// and action that do not require explanation if you know how to use Pandora FMS alerts. We will focus on what makes them different+  * The **group**  in this case works as alert termso alerts will be evaluated for any data that comes from an agent of said group. 
 +  * These alerts also have the option of **disabling event**  to not generate an alert event when the alert is triggeredIt is useful since it is possible that with the inventory alert application many alerts might get triggered with a single execution.
  
-The **group** in this case works as alert term, so alerts will be evaluated for any data that comes from an agent of said group. 
- 
-These alerts also have the option of **disabling event** help to not generate an alert event when the alert is triggered. It is useful since it is possible that with the inventory alert application many alerts might get triggered with a single execution. //We recommend you to activate it unless you have a broad knowledge of what you are doing.// 
  
 === Alert triggering terms === === Alert triggering terms ===
Line 587: Line 601:
  
 == White list == == White list ==
-Similar to the previous one. Specify a list of elements, for one of the inventory fields, except this time, the inventory module value must be on one of the elements of the list, otherwise the alert will fire. 
  
-{{ wiki:inventory-alert-white-list.png?600 }}+Similar to the [[:en:documentation:04_using:04_inventory#black_list|previous case]]. Specify a list of elements, for one of the inventory fields, except this time, the inventory module value must be on one of the elements of the list, otherwise the alert will fire. 
 + 
 +{{  :wiki:inventory-alert-white-list.png?600  }}