Script Writing Guidelines
You can upload, deploy and run your own scripts as both Daily and 24x7 Monitoring Checks that generate Alerts and display in the All Devices view and relevant Client Reports.
You can also upload, deploy and run your own scripts as Automated Tasks (Windows and Macs) that display results in the All Devices view and the Automated Tasks Report.
When you submit passwords in your custom automation manager scripts, N-sight RMM validates those passwords to ensure they do not include the following unsupported characters: " ‘ / \ $ `
If there are unsupported characters, the validation field indicates which characters are not supported so you can adjust your passwords.
The following list provides an overview of basic requirements for authoring a script to use in N-sight RMM:
- The Windows Agent supports the following script types when an interpreter installed: AMP, DOS Batch, JavaScript, Perl, PHP, PowerShell, Python, Ruby, VBS and CMD
- The Linux Agent and Mac Agent support Shell scripts and interpreted languages such as Perl, PHP, Python, Ruby for which there is a handler installed
- The status of the script —pass or fail —can be reported to the All Devices view through exit codes. Zero indicates success, and any other number indicates a failure
- Exit codes 1 to 999 are reserved for system scripts usage. We recommend you return an exit code greater than 1000 in your scripts to ensure the text output is displayed correctly in the All Devices view.
- Rather than create custom scripts for each eventuality, arguments can be passed to the script and applied when the script runs
- As the Agent service executes the script, user or desktop interaction (including dialogs and messages) is not possible
- Scripts up to a maximum of 65535 characters in size and a script output size of 10000 characters are supported
#!/bin/bash
"Hello world"
exit 0
We provide the mechanism to run your own scripts on your servers and workstations; however, 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/developer's responsibility to verify the integrity, actions and impact of any custom scripts.
What do you want to do?
- Check the requirements for returning Script results to the UI
- Determine whether the end user can interact with the script
- Parse Command Line Arguments to the script
-
Upload the Script to the N-sight RMM UI
- Deploy the Script on one of more devices
- Learn about the Windows Automation Manager
- View script Troubleshooting suggestions
- Read our scripting FAQs