Configuring scripts using PATROL Configuration Manager


Rule set files in PATROL for Scripting KM

The following table lists the rule set files, which are available at $PATROL_HOME\..\pconfmgr\rulesets\Shipped\TRO\km_version_number\Script for configuring scripts.

Files

Descrption

Administration.cfg

Contains configuration variables to provide additional information related to network devices, such as, display name, debug enabling and so on.

All.cfg

Consolidated file containing all the configuration variables available in Administration.cfg, DefaultConfiguration.cfg, ConfigurationFilesBasedMonitoring.cfg, Script.cfg, ScriptLocal.cfg.

ConfigurationFilesBasedMonitoring.cfg

Contains configuration variables to configure scripts from a text file. the text file is located at %PATROL_HOME%\TRO\Conf\ImportDevices.

Script.cfg

Contains configuration variables to configure scripts located on a remote device.

ScriptLocal.cfg

Contains configuration variables to configure scripts located on a local device.

DefaultConfiguration.cfg

Contains configuration variables to set pre-defined or default values for the configuration fields to monitor the scripts.

You can set up default configuration for the following configuration fields:

  • Port
  • Device Poll Interval
  • Device Timeout (sec)
  • User name
  • Password
  • Public Key File Path
  • Private Key File Path
  • Passphrase
  • Script Poll Interval
  • Script Timeout

Following template of the All.cfg file contains configuration variables to configure the scripts.

PATROL_CONFIG
"/TRO/txn_id" = { REPLACE = "1"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/DeviceName" = { REPLACE = "<<MyDevice>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/ipAddress" = { REPLACE = "<<ip>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/Category" = { REPLACE = "<<Network>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/DevicePollInterval" = { REPLACE = "<<300>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/DeviceTimeout" = { REPLACE = "<<5>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/Port" = { REPLACE = "<<22>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/UserName" = { REPLACE = "<<Username>>"},
"/SecureStore/TRO/TRO_Root/Devices/<<MyDevice>>/Password" = { REPLACE = "TRO_Root/<<password>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/PublicKeyFilePath" = { REPLACE = "<<PublicKeyFilePath>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/PrivateKeyFilePath" = { REPLACE = "<<PrivateKeyFilePath>>"},
"/SecureStore/TRO/TRO_Root/Devices/<<MyDevice>>/PassPhrase" = { REPLACE = "TRO_Root/<<PassPhrase>>"},
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/ScriptName" = { REPLACE = "<<MyScript1>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/Path" = { REPLACE = "<<Full path contains the script name locate on the remote device(e.g: /root/BMC/apps/TSPS_CPU.bash) or a shell command.
   The script will be copied automatically if it does not exist on the remote device but exist on the monitoring system(%PATROL_HOME%/TRO/Conf/Scripts/ScriptFileTransfer/Devices/DeviceName or %PATROL_HOME%/TRO/Conf/Scripts/ScriptFileTransfer or %PATROL_HOME%/TRO/Conf/Scripts/Samples)>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/Arguments" = { REPLACE = "<<MyScript1Args>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/ScriptPollInterval" = { REPLACE = "300" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/ScriptTimeout" = { REPLACE = "5" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/RegEx" = { REPLACE = "<<java regular expression>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/ScriptName" = { REPLACE = "<<MyScript2>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/Path" = { REPLACE = "<<Full path contains the script name locate on the remote device(e.g: /root/BMC/apps/TSPS_CPU.bash) or a shell command.
   The script will be copied automatically if it does not exist on the remote device but exist on the monitoring system(%PATROL_HOME%/TRO/Conf/Scripts/ScriptFileTransfer/Devices/DeviceName or %PATROL_HOME%/TRO/Conf/Scripts/ScriptFileTransfer or %PATROL_HOME%/TRO/Conf/Scripts/Samples)>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/Arguments" = { REPLACE = "<<MyScript2Args>>" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/ScriptPollInterval" = { REPLACE = "300" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/ScriptTimeout" = { REPLACE = "5" },
"/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/RegEx" = { REPLACE = "<<java regular expression>>"},
"/TRO/TRO_Root/Shared_Port" = { REPLACE = "<<22>>"},
"/TRO/TRO_Root/Shared_DevicePollInterval" = { REPLACE = "<<300>>"},
"/TRO/TRO_Root/Shared_DeviceTimeout" = { REPLACE = "<<5>>"},
"/TRO/TRO_Root/Shared_UserName" = { REPLACE = "<<Username>>"},
"/SecureStore/TRO/TRO_Root/Shared_Password" = { REPLACE = "TRO_Root/<<password>>"},
"/TRO/TRO_Root/Shared_PublicKeyFilePath" = { REPLACE = "<<Default_PublicKeyFilePath>"},
"/TRO/TRO_Root/Shared_PrivateKeyFilePath" = { REPLACE = "<<Default_PrivateKeyFilePath>>"},
"/SecureStore/TRO/TRO_Root/Shared_PassPhrase" = { REPLACE = "TRO_Root/<<Default_PassPhrase>>"},
"/TRO/TRO_Root/Shared_ScriptPollInterval" = { REPLACE = "<<300>>"},
"/TRO/TRO_Root/Shared_ScriptTimeout" = { REPLACE = "<<5>>"},
"/TRO/TRO_Root/RootDisplayName" = { REPLACE = "<<Script>>"},
"/TRO/TRO_Root/DeviceMapping" = { REPLACE = "<<0(No) or 1(Yes: FQDN) or 2(Yes: User defined)>>"},
"/TRO/TRO_Root/CustomMonitorTypesCleanup" = { REPLACE = "<<0=Disable,1=Daily,2=Weekly,3=Monthly>>"},
"/TRO/TRO_Root/ReadFromFile" = { REPLACE = "<<1>>"},
"/TRO/TRO_Root/JAVA_HOME" = { REPLACE = "<<%JAVA_HOME%>>"},
"/TRO/TRO_Root/Debug" = { REPLACE = "<<1(Yes) or 0(No)>>"}

Configuration variables for Scripts configuration

The following table provides information about the configuration variables for configuring the scripts you want monitor. You can use PATROL Configuration Manager to add values to the variable for configuring scripts. 

 

Note

The value, Manual in the value column of the table indicates that there is no predefined value for the configuration variable and you must manually enter a value for those variables.

Variable

Description

Operation

Value

Remote script configuration details

/TRO/txn_id

Activates the remote script configuration.

Replace

1

/TRO/TRO_Root/Devices/<<MyDevice>>/DeviceName

Alias name or a real host name or IP address of the device.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/ipAddress

IP address of the device you want to monitor, if you have not provided the actual host name or IP address.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Category

Category name to group the devices.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/DevicePollInterval

Poll interval time in seconds.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/DeviceTimeout

Connection timeout in seconds.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Port

SSH port number to connect to the configured device.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/UserName

User name to connect to remote host.

Replace

Manual

/SecureStore/TRO/TRO_Root/Devices/<<MyDevice>>/Password

Password for password based authentication.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/PublicKeyFilePath

Full path to the file that will hold the public key, in key based authentication.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/PrivateKeyFilePath

Full path to the file that will hold the private key, in key based authentication.

Replace

Manual

/SecureStore/TRO/TRO_Root/Devices/<<MyDevice>>/PassPhrase

Passphrase to access public and private keys.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/ScriptName

Script display name that can be used to identify the script.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/Path

Full path to the script file located on the remote device (for example, /root/BMC/apps/TSPS_CPU.bash) or a one liner execution statement.

If the script does not exist on the remote device and is located on your local monitoring system, the script will be automatically copied to the Scripts folder (%PATROL_HOME%/TRO/Conf/Scripts/DeviceName or %PATROL_HOME%/TRO/Conf/Scripts).

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/Arguments

Arguments that will be passed during the script execution. The arguments must be separated by a space character.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/ScriptPollInterval

Script frequency in seconds. The minimum value is 10 seconds and the maximum value is 3600 seconds.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/ScriptTimeout

 

Script timeout in seconds.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript1>>/RegEx

A Java regular expression to search on the script results. Use a semicolon to separate multiple regular expressions. For example, expressionA;expressionB;expressionC

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/ScriptName

Script display name that can be used to identify the script.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/Path

Full path to the script file located on the remote device (for example, /root/BMC/apps/TSPS_CPU.bash) or a one liner execution statement.

If the script does not exist on the remote device and is located on your local monitoring system, the script will be automatically copied to the Scripts folder (%PATROL_HOME%/TRO/Conf/Scripts/DeviceName or %PATROL_HOME%/TRO/Conf/Scripts).

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/Arguments

Arguments that will be passed during the script execution. The arguments must be separated by a space character.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/ScriptPollInterval

Script frequency in seconds. The minimum value is 10 seconds and the maximum value is 3600 seconds.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/ScriptTimeout

Script timeout in seconds.

Replace

Manual

/TRO/TRO_Root/Devices/<<MyDevice>>/Scripts/<<MyScript2>>/RegEx

A Java regular expression to search on the script results. Use a semicolon to separate multiple regular expressions. For example, expressionA;expressionB;expressionC

Replace

Manual

Local script configuration details

/TRO/txn_id

Activates the local script configuration.

Replace

1

/TRO/TRO_Script_Local/Scripts/<<MyScript>>/ScriptName

Script display name that can be used to identify the script.

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript>>/Path

Full path to the script file located on the local device (for example, /root/BMC/apps/TSPS_CPU.bash) or a one liner execution statement.

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript>>/Arguments

Arguments that will be passed during the script execution. The arguments must be separated by a space character.

Replace

Manual

/SecureStore/TRO/TRO_Script_Local/Scripts/<<MyScript>>/userAccount

User name and password to configure scripts.

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript>>/RegEx

A Java regular expression to search on the script results. Use a semicolon to separate multiple regular expressions. For example, expressionA;expressionB;expressionC

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript2>>/ScriptName

Script display name that can be used to identify the script.

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript2>>/Path

Full path to the script file located on the local device (for example, /root/BMC/apps/TSPS_CPU.bash) or a one liner execution statement.

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript2>>/Arguments

Arguments that will be passed during the script execution. The arguments must be separated by a space character.

Replace

Manual

/SecureStore/TRO/TRO_Script_Local/Scripts/<<MyScript2>>/userAccount

User name and password to configure scripts.

Replace

Manual

/TRO/TRO_Script_Local/Scripts/<<MyScript2>>/RegEx

A Java regular expression to search on the script results. Use a semicolon to separate multiple regular expressions. For example, expressionA;expressionB;expressionC

Replace

Manual

Default configuration

/TRO/txn_id

Activates the shared script configuration.

Replace

1

/TRO/TRO_Root/Shared_Port

SSH port number to connect to the configured device.

Replace

Manual

/TRO/TRO_Root/Shared_DevicePollInterval

Poll interval time in seconds.

Replace

Manual

/TRO/TRO_Root/Shared_DeviceTimeout

Connection timeout in seconds. The minimum value is 1 second and the maximum value is 600 seconds.

Replace

Manual

/TRO/TRO_Root/Shared_UserName

User name to connect to remote host.

Replace

Manual

/SecureStore/TRO/TRO_Root/Shared_Password

Password for password based authentication.

Replace

Manual

/TRO/TRO_Root/Shared_PublicKeyFilePath

Full path to the file that will hold the public key, in key based authentication.

Replace

Manual

/TRO/TRO_Root/Shared_PrivateKeyFilePath

Full path to the file that will hold the private key, in key based authentication.

Replace

Manual

/SecureStore/TRO/TRO_Root/Shared_PassPhrase

Full path to the file that will hold the private key, in key based authentication.

Replace

Manual

/TRO/TRO_Root/Shared_ScriptPollInterval

Script frequency in seconds. The minimum value is 10 seconds and the maximum value is 3600 seconds.

Replace

Manual

/TRO/TRO_Root/Shared_ScriptTimeout

Script timeout in seconds. The minimum value is 1 second and the maximum value is 600 seconds.

Replace

Manual

Administration

/TRO/txn_id

Activates the configuration.

Replace

1

/TRO/TRO_Root/RootDisplayName

Root application class display name that can be used to identify the location of the device.

Replace

Manual

/TRO/TRO_Root/DeviceMapping

Option to display monitor instance as a device in the Operational console. 

Replace

  • 0: Disable
  • 1: Displays FQDN as the device name of the network device in the Operations Console
  • 2: Displays user defined name (alias name) as the device name of the network device in the Operations Console.

/TRO/TRO_Root/CustomMonitorTypesCleanup

Option to set automatic clean up of the old monitor types that are not in use. 

Replace

  • 0: Disable
  • 1: Daily
  • 2: Weekly
  • 3: Monthly

/TRO/TRO_Root/Debug

Enable logging. Log files will be created in the $PATROL_HOME\TRO\logs directory.

0: Debug off

1: Debug on

Replace

Manual

/TRO/TRO_Root/JAVA_HOME

Path to the JAVA Home directory.

Example:

  • (UNIX) /usr/local/java8 or
  • (WINDOWS): C:\Program Files\Java\jre8 Version 1.8 and above.

If you leave this field blank, environment variable, JAVA home or PATROL Agent JRE will be used.

Replace

Manual

Configuration file based monitoring

/TRO/txn_id

Activates the file based script configuration.

Replace

1

/TRO/TRO_Root/ReadFromFile

Enable this option to configure devices to be monitored automatically from file-based configuration.

Place the files at $PATROL_HOME\TRO\Conf\ImportDevices\

You can have multiple files for configuring devices and must specify an appropriate name to the files. These devices will be grouped under these files.

Replace

  • 0: No
  • 1: Yes

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*