Documentation contents

Script sensors

Reuse PRTG scripts and Nagios plugins unchanged, or write your own.

Applies to Adekio 1.1 · 2 min read

PRTG EXE/Script and EXE/Script Advanced sensors, and Nagios plugins, run unchanged.

1. Upload the script

Settings > Monitoring > Scripts > New script: drop the file (.ps1, .bat, .cmd, .vbs, .py, .sh, .pl or .exe, 1 MiB at most). The extension chooses the interpreter (PowerShell without profile, cmd, cscript, python, /bin/sh…).

The output format is recognised automatically:

Format Content
PRTG EXE/Script value:message
PRTG EXE/Script Advanced XML or JSON <prtg>: channels, units, limits, <error>, <text>, difference mode
Nagios exit code and perfdata
Adekio {"status", "message", "metrics": [{"name", "value", "unit", "warn", "crit"}]}

2. Create the profile

Profiles > New profile, Script protocol: the script, its arguments (same placeholders as PRTG: %host, %device, %windowsuser, %windowspassword, %linuxuser…; or {host}, {user}, {password}) and the timeout (60 s by default, 15 min at most). Channels become script.<channel> series with their limits; a threshold set in the profile replaces the script’s.

3. Apply it to an item

Item’s page > Monitoring > the script’s profile, credential optional. The credential is given to the script in its environment variables, under PRTG names (prtg_windowsuser…) and Adekio names (ADEKIO_USER, ADEKIO_PASSWORD), rather than on the command line. Test now runs the script once and shows the status, message and each channel, without saving anything.

Where it runs

On the server, or on the collector that polls the item: the collector downloads the script once and checks it with its SHA-256 fingerprint. collector.scripts: false forbids scripts on a collector.

Rights

Scripts run with the service account (NT SERVICE\Adekio on Windows, adekio on Linux), without a sandbox. Give it the rights the script needs, and keep script management to monitoring administrators.

Was this page helpful?

Report a problem on this page
↑↓ pour naviguer Entrée pour ouvrir Échap pour fermer