The SSH Script v2 sensor connects to a Linux/Unix system via Secure Shell (SSH) and executes a script file that is located on the target system.
This sensor is in beta status. The operating methods and the available settings are still subject to change. Do not expect that all functions work properly, or that this sensor works as expected at all.
SSH Script v2 Sensor
For a detailed list and descriptions of the channels that this sensor can show, see section Channel List.
Sensor in Other Languages
Dutch: SSH Script v2
French: SSH Script v2
German: SSH Script v2
Japanese: SSH Script v2
Portuguese: SSH Script v2
Russian: SSH Script v2
Simplified Chinese: SSH Script v2
Spanish: SSH Script v2
Remarks
Consider the following remarks and requirements for this sensor:
This sensor requires that you store your script file in the /opt/paessler/share/scripts directory on the target system. Make sure that the script has executable rights.
Credentials
This sensor requires credentials for Linux/Solaris/macOS (SSH/WBEM) systems in the settings of the parent device.
Distributions
This sensor does not support all Linux/Unix and macOS distributions.
Lookups
This sensor uses lookups to determine the status values of one or more channels.
Return format
For more information about the return value format, see section Custom Sensors.
IPv6
This sensor supports IPv6.
Scanning interval
The minimum scanning interval of this sensor is 30 seconds.
The recommended scanning interval of this sensor is 1 minute.
Performance impact
This sensor has a medium performance impact.
Multi-platform probe
You can add this sensor to a multi-platform probe.
Select the script files that you want to use with this sensor. The list shows all script files that are available in the /opt/paessler/share/scriptsdirectory on the target system. PRTG creates a sensor with the same parameters for each file that you select. The sensor executes the script with every scanning interval. For a script file to appear in this list, store the target file in this directory.
Make sure that the script has executable rights.
To show the expected values and sensor status, your scripts must return the expected JSON format to standard output (stdout).
If you use custom sensors on the cluster probe, copy your files to every cluster node.
For more information on how to create custom sensors and for the return format, see section Custom Sensors.
Basic Sensor Settings
Basic Sensor Settings
The sensor has the following default tags that are automatically predefined in the sensor's settings when you add the sensor:
scriptsensor
ssh
sshscriptsensor
For more information about basic sensor settings, see section Sensor Settings.
Script Specific
Script Specific
Setting
Description
Path
The path of the script file that this sensor runs.
PRTG shows this value for reference purposes only. We strongly recommend that you only change it if the Paessler support team explicitly asks you to do so. Wrong usage can result in incorrect monitoring data.
SSH Settings
SSH Settings
Setting
Description
Connection Timeout (Sec.)
Define a timeout in seconds for the connection. This is the time that the sensor waits to establish a connection to the host. Keep this value as low as possible. Enter an integer.
Make sure that the connection timeout is a value that is higher than the shell timeout to avoid potential errors.
Shell Timeout (Sec.)
Define a timeout in seconds for the shell response. This is the time in seconds the sensor waits for the shell to return a response after it has sent its specific command (for example, cat /proc/loadavg). The maximum value is 300 seconds (5 minutes). Enter an integer.
Make sure that the shell timeout is a value that is lower than the connection timeout to avoid potential errors.
SSH Port Inheritance
Define which port this sensor uses for the SSH connection:
In SSH scripts, you can use alphanumeric characters and the special characters ".", "_", "-", "=", and "/" outside of quoted strings.
Sensor Display
Sensor Display
Setting
Description
Primary Channel
Select a channel from the list to define it as the primary channel. In the device tree, PRTG displays the last value of the primary channel below the sensor's name. The available options depend on what channels are available for this sensor.
You can set a different primary channel later by clicking below a channel gauge on the sensor's Overview tab.
Graph Type
Define how this sensor shows different channels:
Show channels independently (default): Show a graph for each channel.
Stack channels on top of each other: Stack channels on top of each other to create a multi-channel graph. This generates a graph that visualizes the different components of your total traffic. You cannot use this option in combination with manual Vertical Axis Scaling (available in the channel settings).
Stack Unit
This setting is only visible if you select Stack channels on top of each other above.
Select a unit from the list. PRTG stacks all channels with this unit on top of each other. By default, you cannot exclude single channels from stacking if they use the selected unit. However, there is an advanced procedure to do so.
Debug Options
Debug Options
Setting
Description
Result Handling
Define what PRTG does with the sensor result:
Discard result (default): Do not store the sensor result.
Store result: Store the sensor result and the last response in the \Logs\sensors subfolder of the PRTG data directory on the probe system. The file name is Result of Sensor [ID].log. This setting is for debugging purposes. PRTG overwrites this file with each scanning interval.
This option is not available when the sensor runs on the hosted probe of a PRTG Hosted Monitor instance.
In a cluster, PRTG stores the result in the PRTG data directory of the master node.
Inherited Settings
By default, all of these settings are inherited from objects that are higher in the hierarchy. We recommend that you change them centrally in the root group settings if necessary. To change a setting for this object only, click under the corresponding setting name to disable the inheritance and to display its options.
Which channels the sensor actually shows might depend on the target device, the available components, and the sensor setup.
Channel
Description
Downtime
In the channel table on the Overview tab, this channel never shows any values. PRTG uses this channel in graphs and reports to show the amount of time in which the sensor was in the Down status.
Execution Time
The execution time of the script
Status
The status that the script returns
Up status: OK
Warning status: Warning
Down status: Error
Unknown status: Unknown
This channel is the primary channel by default.
[Value]
The value that the script file returns in one channel
For more information about the return value format, see section Custom Sensors.