Understand the pattern structure

Still need help?

The Atlassian Community is here for you.

Ask the community

A pattern is an XML file that contains the following nodes:

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

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

See Process types.

<PatternType>(tick)

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

See Pattern types.

<OrderNr>(tick)

You can have multiple patterns for one Discovery-Object, and here you specify their order.

<Command>(error)

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

The command depends on the process type.

<Processing>(tick)

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

See Create custom patterns.

<IgnoreCommandCache>-

If set to true, the CommandProvider will ignore the cache. By default, a command result is stored in the cache and the result of the same command is read from the cache.

The scan is persistent for a scan session.

<RegValue>

(error)

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

Process types

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.

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

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 Oct 10, 2023

Was this helpful?

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