Distributing script files to remote computer (Linux)
To save your scripts in a user defined folder in the devices directory
To execute specific scripts on particular devices, perform the following:
- In the %PATROL_HOME%\TRO\Conf\Scripts\ScriptFileTransfer\Devices directory, create a new folder with the configured device name
- Place the script files for the respective remote device in the newly created folder.
If the script files do not exist on the remote device, they are obtained from the user defined folder in the Devices directory or from the parent directory (ScriptFileTransfer) directory.
Example
Suppose /root/allScripts/myScript/systemHealth.sh is the script file you want to execute on the myDevice remote device.
If the script file does not exist on the myDevice remote device, the KM checks if it exists on the monitoring system. The KM,
- checks if the systemHealth.sh file exists at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.sh or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.sh location
- checks if a .zip file with the same name as the script file exists at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.zip or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.zip location
- checks if a .tar file with the same name as the script file exists at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.tar or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.tar location.
Similar instructions on how to save your scripts to the Devices directory are documented at %PATROL_HOME%\TRO\Conf\Scripts\ScriptFileTransfer\Devices\Readme.txt. The file contents are as follows:
##
## ## Instructions ##
##
## Script files transfer:
## ######################
##
## A. The configured script to execute will be copied from this location if the
## script does not exist on the remote server.
##
## B. Create a new folder with the name of the configured device within the Devices directory and place all of
## the remote device unique scripts that you would like to execute for this device.
## If the script does not exist on the remote device, it will be taken from the
## device directory that you created or from the parent directory named ScriptFileTransfer.
##
## C. Compress file ZIP and archive file TAR are supported as well, if you would like to execute a script that
## contains a dependencies to other files, you can create a .zip file or a .tar file that will gather
## all of the files including the script file. those files will be copied to the remote device.
##
## Example:
## --------
## Assuming that the script file that you would like to execute on the remote device named myDevice is:
## /root/allScripts/myScript/systemHealth.sh
##
## If the script does not exist on the remote device named myDevice we will check if it is exist on the
## monitoring system accordantly:
##
## 1. Check if systemHealth.sh file exist on the %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.sh
## or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.sh
##
## 2. Check if there is a .zip file with the same name as the script file in the location:
## %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.zip
## or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.zip
##
## 3. Check if there is a .tar file with the same name as the script file in the location:
## %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.tar
## or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.tar
##
##
## Notes:
## -----
## 1. Based on this order, if the script found on the monitoring system it will be copied automatically
## to the remote device
##
## 2. If the script path on the remote device does not exist, it will get created automatically
##
## 3. Compress and archive files (ZIP/TAR) must contains the script file to execute
##
## 4. Compress and archive files (ZIP/TAR) will be extracted on the remote device
##
## 5. Files permissions will be changed to 700 (owner can read, write and execute)
##
## ####################################################################################################################################################
To save your scripts in the current directory
To execute specific scripts on particular devices, perform the following:
- In the %PATROL_HOME%\TRO\Conf\Scripts\ScriptFileTransfer\Devices directory, create a new folder with the configured device name
- Place the script files for the respective remote device in the newly created folder.
If the script files do not exist on the remote device, they are obtained from the user defined folder in the Devices directory or from the current directory.
Example
Suppose /root/allScripts/myScript/systemHealth.sh is the script file you want to execute on the myDevice remote device.
If the script file does not exist on the myDevice remote device, the KM will check if it exists on the monitoring system. The KM,
- checks if the systemHealth.sh file exists at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.sh or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.sh location
- checks if a .zip file with the same name as the script file exists at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.zip or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.zip location
- checks if a .tar file with the same name as the script file exists at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.tar or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.tar location.
Similar instructions on how to save your scripts to the Devices directory are documented at %PATROL_HOME%\TRO\Conf\Scripts\ScriptFileTransfer\Readme.txt. The file contents are as follows:
##
## ## Instructions ##
##
## Script files transfer:
##
## A. The configured script to execute will be copied from this location if the
## script does not exist on the remote server.
##
## B. Create a new folder with the name of the configured device within the Devices directory and place all of
## the remote device unique scripts that you would like to execute for this device.
## If the script does not exist on the remote device, it will be taken from the
## device directory that you created or from the current directory.
##
## C. Compress file ZIP and archive file TAR are supported as well, if you would like to execute a script that
## contains a dependencies to other files, you can create a .zip file or a .tar file that will gather
## all of the files including the script file. those files will be copied to the remote device.
##
## Example:
## --------
## Assuming that the script file that you would like to execute on the remote device named myDevice is:
## /root/allScripts/myScript/systemHealth.sh
##
## If the script does not exist on the remote device named myDevice we will check if it is exist on the
## monitoring system accordantly:
##
## 1. Check if systemHealth.sh file exist on the %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.sh
## or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.sh
##
## 2. Check if there is a .zip file with the same name as the script file in the location:
## %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.zip
## or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.zip
##
## 3. Check if there is a .tar file with the same name as the script file in the location:
## %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/Devices/myDevice/systemHealth.tar
## or at %PATROL_HOME%/TRO/Conf/ScriptFileTransfer/systemHealth.tar
##
##
## Notes:
## -----
## 1. Based on this order, if the script found on the monitoring system it will be copied automatically
## to the remote device
##
## 2. If the script path on the remote device does not exist, it will get created automatically
##
## 3. Compress and archive files (ZIP/TAR) must contains the script file to execute
##
## 4. Compress and archive files (ZIP/TAR) will be extracted on the remote device
##
## 5. Files permissions will be changed to 700 (owner can read, write and execute)
##
##
## ####################################################################################################################################################