What are patterns?

Assets Discovery uses patterns to identify different devices and configuration items that it discovers on your local network. Once Assets Discovery finds a device or configuration item that matches a specific pattern, it transforms the information that can be later imported into Assets in Jira Service Management. To check out the objects types, generate host and device examples using the command Discovery.exe -e.

A pattern is an XML file that contains detailed information about how a device or configuration item might appear to the scanner.

For Unix systems, SSHExecute patterns are executed based on the operating system (OS) type. When you create custom SSHExecute patterns, include the OS types (for example, Linux_HostInfo_UUID.pat, Linux_Solaris_HostInfo_UUID.pat) so that patterns are executed on the specified OS types.

Pattern structure

A pattern contains the following nodes:

NodeMandatoryDescription
<Version>YesA version string for the pattern.
<PatternID>YesA unique string for each pattern.
<AlternativePattern>YesA pattern that will be used instead of that one (e.g. used for PowerShell).
<ProcessType>Yes

Describes which type of execution will be proceed by the Discovery-Tool to collect information.

All possible process types are listed down below on this page.

<PatternType>Yes

Describes for which type of Discovery-Object the pattern is responsible.

All possible pattern types are listed down below on this page.

<OrderNr>Yes

You can have multiple patterns for one Discovery-Object, and here you specify their order. The order number is used to set in which order the Pattern is executed.

(For example you can see in the pattern folder 3 Pattern for Linux Network Interface)

<Command>No

Contains the Command that will be executed on the Remote-System.

The command depends on the process type.

<Processing>Yes

Contains the C# SourceCode to processing result data to Discovery-Objects.

How to create custom patterns.

<IgnoreCommandCache>No

By default, a command result will be stored in the cache and the result of the same command will be read from the cache.

If set to true, the CommandProvider will ignore the cache.

The cache is just persistent for a scan session.

<RegValue>

No

The Registry Variable that would be read in combination with the Command used by WMIRegValue.
<ApplicationName>NoThe name of the application that is used to collect extended information for.
<ContextName>NoOptional SNMP Walk context name.
<WMINamespace>NoDefine an alternative WMI Namespace for the initial command.

Pattern process types

There are several different types of processes that might be executed when a pattern is run.
TypeExample commandCommand result typeDescription
SSHExecuteifconfig -aStringExecutes a SSH Command on a connected Remote Unix System
WMIQuerySELECT * FROM Win32_OperatingSystemManagementObjectCollectionExecutes a WMI Query on a connected Remote Windows System
WMIExecutenetstat -anString

Executes a Command on a connected Remote Windows System

WMIRegValue

<![CDATA[
SOFTWARE\MySoftware\
]]>

object

The result object can any type of a registry value

By WMIRegValue the Command contains the Registry Path and reads the Value described in the <RegValue> Node of the Pattern.

The "Root" is set by default to "HKEY_LOCAL_MACHINE\" and should not included in the command.

The Result is an object containing all Variations of an Registry Variable.

WMIRegValueList

<![CDATA[
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
]]>

List<string>

By WMIRegValueList the Command contains the Registry Path and returning the "subKeys" of the Registry Path.

The "Root" is set by default to "HKEY_LOCAL_MACHINE\" and should not included in the command.

PowerShellExecuteGet-WmiObject win32_computersystemStringExecutes a PowerShell-Command on a connected Remote Windows System

SNMP_GET

1.3.6.1.4.1.2021.4.5.0;1.3.6.1.4.1.2021.4.6.0

List<ExtendedInformation>

ExtendedInformation is an object with two attributes:


Executes a SNMP GET Command for the given MIB's.

Returning a List of ExtendedInformation, a ExtendedInformation containing the Name (the MIB) and the Value of the MIB.

SNMP_WALK1.3.6.1.2.1.2.2.1.2;1.3.6.1.2.1.4.20.1.2

List<ExtendedInformation>

ExtendedInformation is an object with two attributes:

Executes a SNMP WALK Command for the given MIB's.

Returning a List of ExtendedInformation, a ExtendedInformation containing the Name (the MIB) and the Value of the MIB.

Command result types

Starting with Discovery v.3, every pattern process type has a command result implementation.

Process typeCommand result type
WMIQueryWMIQueryResult
WMIRegValue

WMIRegValueResult

WMIRegValueList

WMIRegValueListResult

WMIExecuteWMIExecuteResult
PowerShellExecutePowerShellExecuteResult
SSHExecuteSSHExecuteResult
SNMP_GETSNMPExecuteResult
SNMP_WALKSNMPExecuteResult
VIMObjectVIMCommandResult

Pattern types

Pattern types define which types of Discovery-Object are returned as results from processing.

The result of Discovery-Objects will be merged. For example in the Discovery/pattern folder you can see multiple HostInfo pattern, they are all collecting partial results of a host and the Discovery-Tool merging the Attributes together.

TypeExample pattern (included)Description
Host

Linux_Hostinfo_Hostname.pat

Windows_Hostinfo_Hostname_Model.pat

Processing collected data for a Host.

The pattern function (PerformAction) processing a HostInfo-Object.

DeviceinfoSNMP_Deviceinfo_Default.pat

Processing collected data for a Host or a Device.

The pattern function (PerformAction) processing a DeviceInfo-Object.

Network

Linux_NetworkInterfaces.pat

Windows_NetworkInterfaces.pat

Processing collected data for NetworkInterfaces.

The pattern function (PerformAction) processing the NetworkInterface-Objects of the parent system.

CPU

Linux_CPUs.pat

Windows_CPUs.pat

Processing collected data for CPUs.

The pattern function (PerformAction) processing the CPUInfo-Objects of the parent system.

OS

Linux_OS.pat

Windows_OS.pat

Processing collected data for OS.

The pattern function (PerformAction) processing the OSInfo-Objects of the parent system.

FileSystem

Linux_FileSystem.pat

Windows_FileSystem.pat

Processing collected data for FileSystems.

The pattern function (PerformAction) processing the FileSystemInfo-Objects of the parent system.

Application

Linux_Application_RPM.pat

Windows_Application_Product.pat

Processing collected data for Applications.

The pattern function (PerformAction) returning a list of ApplicationInfo-Objectsof the parent system.

Patch

Windows_Patches.pat

Processing collected data for Patches.

The pattern function (PerformAction) processing the PatchInfo-Objects of the parent system.

ApplicationServiceWindows_ApplicationServices.pat

Processing collected data for ApplicationServices.

The pattern function (PerformAction) processing the ApplicationServiceInfo-Objects of the parent system.

OSProductKeyWindows_ProductKey.pat

Processing collected data for License.

The pattern function (PerformAction) processing the License for the Operating-System

ApplicationProductKeyExample: Application Product Key

Processing collected data for License.

The pattern function (PerformAction) processing the License for the Applications of the parent system.

UserLinux_User.pat
Windows_User.pat

Processing collected data for User.

The pattern function (PerformAction) processing the User of the parent system.

GroupLinux_Group.pat
Windows_Group.pat

Processing collected data for Groups.

The pattern function (PerformAction) processing the Groups of the parent system.

ConnectedPeripherieWindows_Peripherie_USB_Storage.pat

Processing collected data for Extended Informations.

The pattern function (PerformAction) processing the ExtendedInformation-Objects of the parent system.

SNMPExtendedValues

SNMP_Deviceinfo_ExtExampleRAM.pat

Example: SNMP Extended Values

Processing collected data for Extended Informations.

The pattern function (PerformAction) processing the ExtendedInformation-Objects of the parent system.

ConnectedPeripherieWindows_Peripherie_USB_Storage.patProcessing collected data for Connected Devices of the parent system.
HostinfoList

Windows_VBox_VMs.pat

Linux_VBox_VMs.pat

Processing collected data for a lis of Virtual Guests

The patten function (PerformAction) processing the Host-Objects (like virtual guest machines) of the parent system.

PostProcessing

Post Processing pattern will be executed after all the pattern types and can be used to add or modify host/device information

The pattern function (PerformAction) returning a HostInfo- or a DeviceInfo-Object.

Last modified on May 21, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.