Which scripting languages are supported?

The following script types are supported where a handler is installed:

Windows: AMP (from Agent 10.3.0 RC), DOS Batch, JavaScript, Perl, PHP, PowerShell, Python, Ruby, VBS and CMD

Linux and macOS: Shell scripts and interpreted languages (Perl, PHP, Python, Ruby)

For a check to be reported as passed or failed, what return codes should be returned by the script?

The check will be reported as passed when the return code from the script is 0. All other return codes will cause the check to be reported as failed.

We have reserved the exit codes 1 to 999 for use for the system scripts. As such we would suggest returning an exit code greater than 1000 in your scripts to ensure the text output is displayed correctly in the Dashboard.

How can I display detailed script result information on the Dashboard when running as a Script Check or Automated Task?

Any information sent to standard out will be uploaded and displayed on the Dashboard up to a maximum of 255 characters.

Is there a size limit when uploading a script?

We support the upload of scripts up to a maximum of 65535 characters in size.

Is there a size limit to the script output?

We support the script outputs up to a maximum of 1000 characters.

What should be entered in the Command Line?

The Command Line may be used to pass run time parameters to the script. The actual parameters that should be passed to the script will depend on the script itself. For example if running chksdsk, the disk to query may be passed as a command line parameter.

I cannot access the Script Manager dialog to add or edit a script?

Scripts can only be managed by those users who have Superuser, Administrator, a login with the required Custom Scripts permissions enabled or the Agent Key (where Dashboard access is enabled) level access to the Dashboard.

How often can I run a Script Check?

Script Checks may be configured to run as a 24x7 Check and/or a Daily Safety Check (once per day) and are added via Dashboard Controls.

The available 24x7 Check frequencies depend on the installed version of the Agent, generally this is every five or fifteen minutes on servers and every thirty or sixty minutes on workstations. But Windows Agent 10 introduced the additional thirty, sixty or one hundred and twenty minutes for servers and five, fifteen or one hundred and twenty minutes for workstations. Mac Agent 2.0 introduced an additional one hundred and twenty minutes frequency for workstations with five and fifteen minute monitoring included from Mac Agent 2.1.0.

Is scriptrunner.exe used by the Agent?

scriptrunner.exe is part of the Agent and used to run the Automation Manager .amp scripts on the device.

I have a script that I want to run when a check fails. How would I configure this?

Just add the script as an Automated Task (Windows and Mac) and for the schedule, select On Check Failure then the Check that when failed will trigger the script. On Check Failure Automated Tasks can also be added when configuring a Check (where supported).

I received an Invalid Scripts Arguments message, what can cause this?

This may be an issue with the script itself, caused by insufficient permissions as the credentials the Advanced Monitoring Agent service is set to run under are the same credentials that will be used to run the to the script or it may be an issue with the Script Host on the machine itself.

Is an interpreter required to run the script on the device?

Depending on the scripting language used, it may be necessary to install an interpreter on the device to allow it to run the script. The Agent itself does not include an interpreter.

Are there any special requirements for bash scripts?

To ensure a bash script runs successfully, declare the bash interpreter in the script: #!/bin/bash

For example:


echo "Hello world"

exit 0

What is the maximum script timeout period?

The maximum script timeout period is 3600 seconds. Although we would advise caution when adding a timeout of this length on servers as if the time taken to run all 24x7 checks exceeds the data overdue alert setting (default 1.5 times 24x7 monitoring frequency, so 7.5 minutes if using 5 minute monitoring) then a data overdue alert may be generated as all of the Checks have not complete in this period. If it is necessary to do this, then either increase the data overdue alert setting to 2.5 times (or more) 24x7 monitoring frequency or decrease 24x7 monitoring frequency to 15 minutes.

I checked the device and the Automated Task script ran, when will the result appear on the Dashboard?

The Automated Tasks results are uploaded by the Agent the next time it communicates back to the Dashboard after the script has ran, as such there may be a delay between the Task completing on the device and the result appearing in the Dashboard.

What can cause an "unknown error" in a batch script?

This error may be caused where the script output contains specials characters. For example, including "cls" in the script can add a special character to the output when run through cscript.

Why is \0\ returned in my script?

To prevent the removal of the leading 0 in arguments, from Agent 9.5.4 any part of the command that begins with 0 is wrapped in \ so the full argument is preserved when executed or processed.

Although we have provided the mechanism to run your own scripts on your servers and workstations. We are not responsible for custom scripts made or used in conjunction with this product. We are not liable for loss incurred from system, hardware or data loss. It is the customer/developers responsibility to verify the integrity, actions and impact of any custom scripts.

What do you want to do?