For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Inventory and Templates

Assets' inventories in OCS are composed of two main elements: the base inventory and the template inventory.

Base inventory

The base inventory provides a default set of core information about an asset. This inventory is always available and includes the following fields:

  • Name

  • Description

  • Serial Number

  • OS Name

  • OS Version

  • UUID

  • IP Address

  • Mac Address

  • Domain

  • Agent Version

Template inventory

To extend the base inventory, OCS uses a template system. These templates add extra fields and define what method should be used to retrieve the corresponding data.

Preloaded Templates

By default, OCS includes six preloaded templates, visible at Configurations → Inventory → Templates:

  • Legacy (for compatibility with legacy agents, version 2.X)

  • Linux (Debian based)

  • Linux (RHEL based)

  • MacOS

  • Windows

  • Generic SNMP

Template fields and their retrieval methods for Linux
Template fields and their retrieval methods for Linux

Let's check how the SSN value is retrieved within the Linux (Debian based) template.

Here’s where to find this in the console:

1

Navigate to Configurations → Templates.

2

Click the pen icon in the Action column for the Linux (Debian based) template.

3

On the template details page, click the Bios section to expand it.

The top table identifies the inventory section and what command should be used to retrieve data, among other options.

For this template, the command (Target field) is dmidecode.

The Retrieval method field tells us how this command needs to be executed : as a Bash command in this instance.

The Retrieval output tells the agent how the output of this command should be processed to get the relevant data: Regex processing.

4

Locate the SERIAL NUMBER field.

The table below lists all the fields for this section.

The Retrieval value field contains the key or regex that will be used to retrieve the serial number value from the output of dmidecode.

Template assignment

Using Rules (automatic)

Templates are assigned to assets based on their operating systems. OCS uses the Rule Engine to determine and apply the correct template when an asset inventories itself for the first time.

Out of the box, OCS provides six predefined rules, evaluated against the OS Name or Agent field of the base inventory and used to assign Templates automatically:

Field evaluated

OS Name

OS Name

OS Name

OS Name

Agent

OS Name

Value(s) expected

Windows

Ubuntu, Debian

Redhat, Centos, Alma, Rocky

Mac

OCS-NG

SNMP

Template

Windows

Debian based

RHEL based

macOS

Legacy

Generic SNMP

Notes on automatic assignment:

  • Rules are evaluated with each incoming inventory.

  • If no rule matches, the asset will only report using the base inventory.

  • Template assignment can also be switched to manual selection per device. More details are available on the Managing Rules page.

Manual Template assignment

In addition to automatic assignment, templates can also be manually assigned to assets from the asset’s detail page.

Steps to manually assign a Template:

1

Navigate to the asset's detail page.

2

On the right side, click the Options icon.

3

Select Assign inventory template from the drop-down.

4

Choose the desired template for the asset from the list.

A manually assigned template will never be overridden by Rules.

To switch back to automatic assignment:

  1. Open the asset’s detail page.

  2. Click the Options icon at the top right.

  3. In the drop-down menu, select Reset inventory template.

The template will be reset, and a new one will be automatically assigned during the next inventory if a Rule matches.

Last updated