CSM node definitions

<< Click to Display Table of Contents >>

Raynet One > 1.1 > User Guide > Technical overview > Custom inventory scripting > CSM inventory scripting 

CSM node definitions

This chapter defines the XML nodes used by the CSM device inventory language.

 

The attributes and their accepted values are case-sensitive. Attributes are mandatory unless specified otherwise.

Node CustomScriptSet

The root element in the XML structure in which all the custom scripts are placed.

Attribute Name (string)

The name of the CSM script set.

Attribute Version (string)

The maintainer-defined version of the CSM script set. It has no meaning in script evaluation.

Node CustomScript

Defines an executable CSM script part of a CSM script set. Various script node layouts are supported. Review the use-cases to learn more about the supported script node layouts.

Attribute Name (string)

The name of the CSM script.

Optional attribute TargetPlatform (string)

Specifies the inventory device platform type limiting the set of accepted devices for script execution.

 

The recognized set of target platform specifications is:

Linux

AIX

Solaris

macOS

HPUX

All

Node Command

Specifies a command for execution part of the CustomScript or ForeachLine node. Commands are executed in the same order as put inside of the CSM script node. For execution details, see the CSM inventory scripting main chapter.

Attribute Name (string)

The variable name for command output storage.

Optional attribute OnError (string)

The behaviour to take on execution error. If the command failure can result in empty command output, it is necessary to use the fail error behaviour for clean error recovery.

 

Supported values:

fail

warn

ignore

 

Default: ignore

Node content

The command to execute on the inventory device. All command output (stdout, stderr) is captured.

Node ForeachLine

Splits the variable content into lines, then executes its content once for each line in the order of lines. This node is part of the CustomScript node.

Attribute Values (string)

The variable name of the one containing the lines to process.

Attribute Name (string)

The variable name to store each line into during per-line execution.

Node Item

Describes the inventory object to create after command execution. This node can be part of the CustomScript or the ForeachLine node.

Attribute Name (string)

The internal name of the inventory object.

Attribute Class (string)

The class of the inventory object.

Attribute ItemName (string)

The name of the inventory object.

Optional attribute UseCustom (boolean)

If true, the class is not mapped to any of the built-in inventory objects. Otherwise, the inventory object is considered for import into the device inventory database. This field does not exist for our Scan Engine product.

 

Default: true

Node Property

Defines an inventory object property to assign part of the Item node.

Attribute Name (string)

The name of the property to assign.

Attribute Value (string)

The value of the property to assign.