Script Execution - How to verify whether the script has really done the work?

In SapphireIMS, there is a provision to push custom scripts (such as Batch, VB script, Bash) to end points.

User should first create a script package (from Settings > Package and Policy Management > Script Package), then post that script to end points (Settings > Automation Tasks > Script Execution).

SapphireIMS script framework allows the script package to be downloaded to the end points and just invoke the script and shows “Script executed successfully.” as status. It doesn’t know the actual task to be achieved by that script and will not know how to verify whether the script has done its intended task.

In some cases, user wants to verify whether it really done it’s intended task. To achieve this, we have an option in SapphireIMS.

*User should write script in such way that it redirects specific error code/message to a text file. During script package configuration, select Enable Redirection option and specify the redirection file name, and success pattern. Success pattern can be exact string match, substring presence, not equals, not contains conditions. *

Our framework will read the redirected file and look for configured success pattern. If the pattern is found in the redirected file, it will tell the job as success. Otherwise, it will fail the job with error message “Script execution failed due to success pattern condition mismatch.”

With this, the user can verify whether actual task is completed successfully or some failure. In case if the job fails in specific set of machines with above error, run the script manually in the failed system to understand what is causing failure.

1 Like