Icon

This is the documentation of the release 2.1 of automaIT. The documentation of the latest stable release can be found at AUTOMAIT.

Skip to end of metadata
Go to start of metadata

Agent scripts are called during host initialization and are used to collect information about the underlying operating system of the remote agent. As default, information about the OS name, its version and the system architecture is collected by internal Java functions. Customized agent scripts can be created and used to change the stored OS information of a host.

Icon

OS information collected by agent scripts may be accessed using system substitutions (:[sys.OSName], :[sys.OSVersion], and :[sys.OSArch]). Host searches may use "sys.OSName", "sys.OSVersion", and "sys.OSArch" as criteria.

Create custom agent script

Custom agent scripts can be created within the web interface. The link to do so can be found in the "Administration" area.

The agent script is called up to three times during host initialization (once per OS property) while the environment variable NP_OSINFORMATION is set each time to the requested value (NAME, VERSION or ARCHITECTURE). So it's possible to create one script for each information and return one fixed value. Nevertheless it's recommended to create one script collecting the needed information regarding to the set environment variable. The returned resp. output value must have a length between 1 and 512 chars, it will be assigned to the corresponding operating system property (Name, Version, Architecture).

The following code can be an example to create an own script. Please note that this example is Linux specific.

agent script example

Please note

Icon

 If the script returns an error code which is not 0 or produces no output, an error will be thrown and the host won't be initialized.

  • No labels