File based configuration
This topic provides information about how to configure devices from files by using file based monitoring configuration. PATROL for Scripting provides the ability to configure devices on which you want to execute the scripts. You can create text files to define all devices you want to monitor. The PATROL Agent will read the configuration settings and from these files and configure PATROL for Scripting to monitor the devices and scripts within each file. You can configure multiple files, and these files will be consolidated to a group.
Configuring devices to execute scripts in Linux
You can configure devices using file-based configuration. The device configuration details must be saved in a text file and located at %PATROL_HOME%/TRO/Conf/ImportDevices/ directory. The KM supports text files. that is, files with .txt extension. If you do not provide values for the following configuration fields in the text file, it will take its respective default values:
- Port
- Poll interval (sec)
- Timeout (ms)
Any changes made to the file will be synchronized by the PATROL Agent.
You can find the instruction on how to prepare your file based configuration in the %PATROL_HOME%/TRO/Conf/ImportDevice/FileBaseConfiguration_ Instruction.txt file, which is as follows:
Click here to see how to create file based configuration to execute multiple scripts on a Linux environment
Instructions:
Create file base configuration to execute multi scripts on multi devices.
###############################################################################
#
# Create your own files base configuration to define all of the devices you would like to execute script/s on.
# PATROL Agent will read from those files and configure to monitor all of the devices and scripts within each file.
# File name should be meaningful, for each configured file, instance will be created and the name of the instance will be the file name.
# All of the devices and scripts within this file will be grouped under this instance.
#
# PATROL Agent will add new devices and scripts automatically from new files.
# PATROL Agent will remove devices and scripts automatically from files that were removed.
# PATROL Agent will add/delete/modify devices and scripts automatically from files that were modified.
#
# All files should be located within %PATROL_HOME%/TRO/Conf/ImportDevices directory, on the same location as the instructions file (FileBaseConfiguration_Instructions.txt).
#
# Configuration files should have the .txt extension, Example: adprod.txt
#
#################
#
### Warnings:####
#
#################
#
#
# 1. Empty line is not allowed, please use '#' as a comment.
# 2. The characters ',' and '|' and '*' are allowed only to separate between settings in the device/script configuration settings.
# 3. Script might configured with shell command that might include the '|' character, in this case all pipe characters need to be replaced with <BMC_SEP>
# Example: "my shell command | grep something" should be redefined as "my shell command <BMC_SEP> grep something"
#
#########################
#
### Security warning:####
#
#########################
#
# File based configuration might contains security settings details such as: SSH login credentials.
# Security settings details are not encrypted on the file based configuration and exposed to each user with login access to this server (known as the monitoring server).
#
# Using the default configuration feature, you may define the security settings details as default configuration, and leave those field blanks in the file.
#
#####################
#
### File content: ###
#
#####################
#
# Device Name/IP,Forced IP Address,Port,Connection timeout,Connection poll interval,Username,Password,Public Key Path,Private Key Path,Passphrase|Script name*Script path*Script arguments*Script timeout*Script poll Interval*Script RegEx to search|Script name*Script path*Script arguments*Script timeout*Script poll Interval*Script RegEx to search
#
#
#
# Device name/IP = Real Device name or IP address or an alias name, if you provide alias name then Forced IP address must be provided
#
# Forced IP Address = Provide the device IP address if the device name configured with the alias name
#
# Port = SSH port number (22)
#
# Connection timeout = Timeout in seconds
#
# Connection poll interval = Connection poll interval time in seconds
#
# Username = SSH username to connect to the remote device
#
# Password = SSH username password to connect to the remote device, leave it blank if you want to use Public/Private key authentication
# Public Key Path = Pull path to the file that will hold the public key (if the user password provided public Key Path will be ignored)
# Private Key Path = Pull path to the file that will hold the private key (if the user password provided private Key Path will be ignored)
# Passphrase = Passphrase to access the public and private keys (if the user password provided passphrase will be ignored)
#
#
#
#
# Script name = The instance name for the configured script to execute
# Script = Full path to the script to execute (Example: /root/user/apps/myAppsCPU.bash) or a shell command.
# Script might configured with shell command that might include the '|' character, in this case all pipe characters need to be replaced with <BMC_SEP>
# Example: "my shell command | grep something" should be redefined as "my shell command <BMC_SEP> grep something"
#
# Script arguments = Script arguments separated by a space character that will be passed during execution. e.g: script that measuring a log file size and should get an argument with the name of the log file.
# Script timeout = Timeout in seconds
# Script poll Interval = Script poll interval time in seconds
#
# Script RegEx to search = A Java regular expression to search on the script results.
#
###############################################################################################################################
#
# Default configuration can be defined through a policy and applied on devices that are having less configuration than required.
#
# Use this feature in case you are having default configuration details cross all of your devices.
#
###############################################################################################################################
#
Examples:
#
# Example 1.
# Configure device with 3 scripts to execute with RegEx 'ERR', user password provided
# clm-aus-013799,172.22.177.167,22,2000,60,user,user123,,,|scriptInstaneName1*/root/user/apps/myAppsCPU.bash**60*300*ERR|scriptInstaneName2*/root/user/apps/myAppsMEM.bash**60*300*ERR|scriptInstaneName3*/root/user/apps/myAppsSESSION.bash**60*300*ERR|
#
#
# Example 2.
# Configure device with 3 scripts to execute with no RegEx, public/private/passphrase provided
# clm-aus-013799,172.22.177.167,22,2000,60,user,,/root/.ssh/id_rsa.pub,/root/.ssh/id_rsa,user123|scriptInstaneName1*/root/user/apps/myAppsCPU.bash**60*300*|scriptInstaneName2*/root/user/apps/myAppsMEM.bash**60*300*|scriptInstaneName3*/root/user/apps/myAppsSESSION.bash**60*300*|
#
#
# Example 3.
# Configure 3 devices with 3 scripts with no RegEx to execute on each one of them
# clm-aus-013799,172.22.177.169,22,2000,60,user,user123,,,|scriptInstaneName1*/root/user/apps/myAppsCPU.bash**60*300*|scriptInstaneName2*/root/user/apps/myAppsMEM.bash**60*300*|scriptInstaneName3*/root/user/apps/myAppsSESSION.bash**60*300*|
# clm-aus-013798,172.22.177.168,22,2000,60,user,user123,,,|scriptInstaneName1*/root/user/apps/myAppsCPU.bash**60*300*|scriptInstaneName2*/root/user/apps/myAppsMEM.bash**60*300*|scriptInstaneName3*/root/user/apps/myAppsSESSION.bash**60*300*|
# clm-aus-013797,172.22.177.167,22,2000,60,user,user123,,,|scriptInstaneName1*/root/user/apps/myAppsCPU.bash**60*300*|scriptInstaneName2*/root/user/apps/myAppsMEM.bash**60*300*|scriptInstaneName3*/root/user/apps/myAppsSESSION.bash**60*300*|
#
#
# Example 4.
# Configure device with default configuration (Port,Connection timeout,Connection poll interval,Username,Password) (Script timeout*Script poll Interval)
# clm-aus-013799,172.22.177.167,,,,,,,,|scriptInstaneName1*/root/user/apps/myAppsCPU.bash|scriptInstaneName2*/root/user/apps/myAppsMEM.bash
- Comma ( , ), pipe ( | ), and asterisk ( * ) characters are allowed as a separator between the setting in the device and script configuration.
- If a script is configured by using shell command and includes the pipe ( | ) character, replace it with <BMC_SEP>
For example: my shell command | grep abc must be redefined as my shell command <BMC_SEP> grep abc - File based configuration might contain security settings, like SSH login credentials.
Configuring devices to execute scripts in Windows
You can configure devices using file-based configuration. The device configuration details must be saved in a text file and located at %PATROL_HOME%\TROMS\Conf\ImportDevices\ directory. The KM supports text files. that is, files with .txt extension. If you do not provide values for the following configuration fields in the text file, it will take its respective default values:
- Port
- Poll interval (sec)
- Timeout (ms)
Any changes made to the file will be synchronized by the PATROL Agent.
You can find the instruction on how to prepare your file based configuration in the %PATROL_HOME%\TROMS\Conf\ImportDevice\FileBaseConfiguration_ Instruction.txt file, which is as follows:
Click here to see how to create file based configuration to execute multiple scripts on a Windows environment
###############################################################################
## Instructions:
## Create file base configuration to execute multi scripts on a multi devices.
###############################################################################
#
# Create your own files base configuration to define all of the devices you would like to execute script/s on.
# Patrol agent will read from those files and configure to monitor all of the devices and scripts within each file.
# File name should be meaningful, for each configured file, instance will be created and the name of the instance will be the file name.
# All of the devices and scripts within this file will be grouped under this instance.
#
#
# Patrol agent will add new devices and scripts automatically from new files.
# Patrol agent will remove devices and scripts automatically from files that were removed.
# Patrol agent will add/delete/modify devices and scripts automatically from files that were modified.
#
# All files should be located within %PATROL_HOME%/TROMS/Conf/ImportDevices directory, on the same location as the instructions file (FileBaseConfiguration_Instructions.txt).
# Configuration files should have the .txt extension, e.g.: adprod.txt
#
#
#################
### Warnings:####
#################
#
#
# 1. Empty line is not allowed, please use '#' as a comment.
# 2. The characters ',' and '|' and '*' are allowed only to separate between settings in the device/script configuration settings.
# 3. If a script is configured by using shell command and includes the pipe ( | ) and asterisk ( * ) characters, in this case all the pipe characters need to be replaced with <BMC_PIPE> and asterix character need be replaced with <BMC_STAR>
# For example: my command | grep abc should be redefined as my command <BMC_PIPE> grep abc
#
#
#########################
### Security warning:####
#########################
#
#
# File based configuration might contains security settings details such as: login credentials.
# Security settings details are not encrypted on the file based configuration and exposed to each user with login access to this server (known as the monitoring server).
# Using the default configuration feature, you may define the security settings details as default configuration, and leave those field blanks in the file.
#
#
#####################
### File content: ###
#####################
#
#
# Device Name/IP,Forced IP Address,Port,Connection timeout,Connection poll interval,Username,Password,Authentication Protocol,Connection Protocol|Script name*Script path*Script arguments*Script timeout*Script poll Interval*Script RegEx to search|Script name*Script path*Script arguments*Script timeout*Script poll Interval*Script RegEx to search
#
#
# Device name/IP = Real Device name or IP address or an alias name, if you provide alias name then Forced IP address must be provided
# Forced IP Address = Provide the device IP address if the device name configured with the alias name
# Port = Windows PowerShell port number (5985)
# Connection timeout = Timeout in seconds
# Connection poll interval = Connection poll interval time in seconds
#
#
# Username = PowerShell username to connect to the remote device
# Password = PowerShell username password to connect to the remote device
# Authentication protocol = Authentication protocol that will be used to verify the authorization credentials: 0(Kerberos) or 1(Negotiate)
# Connection protocol = Connection protocol: 0(HTTP) or 1(HTTPS)
#
#
# Script name = The instance name for the configured script to execute
# Script = Full path to the script to execute (e.g.: C:/yossi/apps/myAppsCPU.ps1) or a command.
# Script might configured with command that might include the '|' character, in this case all pipe characters need to be replaced with <BMC_PIPE>
# e.g.: "my command | grep something" should be redefined as "my command <BMC_PIPE> grep something"
#
# Script arguments = Script arguments separated by a space character that will be passed during execution. e.g: script that measuring a log file size and should get an argument with the name of the log file.
# Script timeout = Timeout in seconds
# Script poll Interval = Script poll interval time in seconds
# Script RegEx to search = A regular expression to search on the script results.
#
#
###############################################################################################################################
# Default configuration can be defined through a policy and applied on devices that are having less configuration than required.
# Use this feature in case you are having default configuration details cross all of your devices.
###############################################################################################################################
#
#
##############
### Examples:
##############
#
#
# Example 1.
# Configure device with 3 scripts to execute with RegEx 'ERR', all of the connection setting are provided
# clm-aus-013799,172.22.177.167,5985,2000,60,yossi,yossi123,0,0|scriptInstaneName1*C:/yossi/apps/myAppsCPU.bat**60*300*ERR|scriptInstaneName2*C:/yossi/apps/myAppsMEM.bat**60*300*ERR|scriptInstaneName3*C:/yossi/apps/myAppsSESSION.bat**60*300*ERR|
#
#
# Example 2.
# Configure device with 3 scripts to execute with no RegEx, only the username provided
# clm-aus-013799,172.22.177.167,5985,2000,60,yossi,,,|scriptInstaneName1*C:/yossi/apps/myAppsCPU.bat**60*300*|scriptInstaneName2*C:/yossi/apps/myAppsMEM.bat**60*300*|scriptInstaneName3*C:/yossi/apps/myAppsSESSION.bat**60*300*|
#
#
# Example 3.
# Configure device with default configuration (Port,Connection timeout,Connection poll interval,Username,Password,Authentication protocol,Connection protocol ) (Script timeout*Script poll Interval)
# clm-aus-013799,172.22.177.167,,,,,,,|scriptInstaneName1*C:/yossi/apps/myAppsCPU.bat|scriptInstaneName2*C:/yossi/apps/myAppsMEM.bat
- Pipe ( | ), and asterisk ( * ) characters are allowed as a separator between the setting in the device and script configuration.
- If a script is configured by using shell command and includes the pipe ( | ) and asterisk ( * ) characters, in this case all the pipe characters need to be replaced with <BMC_PIPE> and asterix character need be replaced with <BMC_STAR>
For example.: my command | grep abc should be redefined as my command <BMC_PIPE> grep abc
- Blank lines are not allowed in the file. Use # character as a comment.
- Security settings are not encrypted in the file based configuration and exposed to each user who has login access to this server (known as the monitoring server).
- Use the default configuration feature to define the security settings like, default configuration and leave the field blanks in the file.