Distributing script files to remote computers (Windows)


PATROL for Scripting enables you to use custom scripts to monitor your environment. You can execute scripts remotely or locally as per your requirement. If script files do not exist on remote computer, PATROL for Scripting copies the respective script to the remote computer for execution. 

Script files that are to be distributed to different remote computers must be located at the %PATROL_HOME%\TROMS\Conf\Scripts\ScriptFileTransfer\Devices directory. The configured script file to be executed will be copied from this location to the remote device. 

Warning

Note

  • To use the script file transfer feature from a monitoring system to a remote devices, samba and c$ should be enabled.
  • If the configured device has both IPV4 and IPV6, check the force discovery attribute for IPV4. If the force discovery does not have IPV4, add IPV4 to force discovery since network sharing is not available with IPV6.


To save your scripts in a user defined folder in the devices directory

To execute specific scripts on particular devices, perform the following: 

  1. In the %PATROL_HOME%\TROMS\Conf\Scripts\ScriptFileTransfer\Devices directory, create a new folder with the configured device name
  2. 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. 

Warning

If you want to execute a script that has dependencies on other files, create a ZIP file with the required files and the script. The ZIP files will be copied to the remote device.

Example

Suppose C:\root\allScripts\myScript\systemHealth.ps1 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.ps1 file exists at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.ps1 or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.ps1 location
  • checks if a .zip file with the same name as the script file exists at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.zip or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.zip location.

Warning

Notes

If the script is found on the monitoring system it will be copied automatically to the remote device.

  • If the script path on the remote device does not exist, it will be created automatically.
  • Compressed (ZIP) file must contain the script files for execution. Compressed (ZIP) files are extracted on the remote device.

Similar instructions on how to save your scripts to the Devices directory are documented at %PATROL_HOME%\TROMS\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 is supported as well, if you would like to execute a script that
##        contains a dependencies to other files, you can create a .zip 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:
##            C:\allScripts\myScript\systemHealth.bat
##
##        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.bat file exist on the %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.bat
##                or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.bat
##
##            2. Check if there is a .zip file with the same name as the script file in the location:
##                %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.zip
##                or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.zip
##
##
##                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 file (ZIP) must contains the script file to execute
##
##                4. Compress files (ZIP) will be extracted on the remote device
##
## ####################################################################################################################################################

To save your scripts in the current directory

To execute specific scripts on particular devices, perform the following: 

  1. In the %PATROL_HOME%\TROMS\Conf\Scripts\ScriptFileTransfer\Devices directory, create a new folder with the configured device name
  2. 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.

Warning

If you want to execute a script that has dependencies on other files, create a ZIP file with the required files and the script. The ZIP files will be copied to the remote device.

Example

Suppose C:\root\allScripts\myScript\systemHealth.ps1 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.ps1 file exists at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.ps1 or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.ps1 location
  • checks if a .zip file with the same name as the script file exists at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.zip or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.zip location.

Warning

Notes

If the script is found on the monitoring system it will be copied automatically to the remote device.

  • If the script path on the remote device does not exist, it will be created automatically.
  • Compressed files (ZIP) must contain the script file to execute. Compressed files (ZIP) are extracted on the remote device.

Similar instructions on how to save your scripts to the Devices directory are documented at %PATROL_HOME%\TROMS\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, if you would like to execute a script that
##       contains a dependencies to other files, you can create a .zip 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:
##            C:\root\allScripts\myScript\systemHealth.ps1
##
##       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.ps1 file exist on the %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.ps1
##                or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.ps1
##
##            2. Check if there is a .zip file with the same name as the script file in the location:
##                %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\Devices\myDevice\systemHealth.zip
##                or at %PATROL_HOME%\TROMS\Conf\ScriptFileTransfer\systemHealth.zip
##
##
##                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 files (ZIP) must contains the script file to execute
##
##                4. Compress files (ZIP) will be extracted on the remote device
##
##
## ####################################################################################################################################################

 

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

BMC PATROL for Scripting 2.0