PRTG Manual: SSH Script v2 Sensor

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.

i_betaThis 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

SSH Script v2 Sensor

i_square_cyanFor 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:

Requirement

Description

Enabled Beta Sensors experimental feature

This sensor requires that the Beta Sensors experimental feature is enabled.

i_square_cyanFor more information, see the Knowledge Base: What are beta sensors and how can I use them?

File storage

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.

Knowledge Base

Add Sensor

Setting

Description

Path

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/scripts directory 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.

i_round_redMake sure that the script has executable rights.

i_round_redTo show the expected values and sensor status, your scripts must return the expected JSON format to standard output (stdout).

i_round_redIf you use custom sensors on the cluster probe, copy your files to every cluster node.

i_square_cyanFor more information on how to create custom sensors and for the return format, see section Custom Sensors.

Basic Sensor Settings

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

i_square_cyanFor more information about basic sensor settings, see section Sensor Settings.

Script Specific

Script Specific

Script Specific

Setting

Description

Path

The path of the script file that this sensor runs.

i_round_redPRTG 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

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.

i_round_blueMake 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.

i_round_blueMake 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:

  • Inherit port from parent device (default): Use the port number as defined in the Credentials for Linux/Solaris/macOS (SSH/WBEM) Systems section of the parent device settings.
  • Do not inherit port (enter a custom SSH port): Define a custom port number below and do not use the port number from the parent device settings.

Custom SSH Port

This setting is only visible if you select Do not inherit port (enter a custom SSH port) above.

Enter the port number (between 1 and 65535) that this sensor uses for the SSH connection. Enter an integer.

Specific Sensor Settings

Specific Sensor Settings

Specific Sensor Settings

Setting

Description

Parameters

If your script file catches command-line parameters, define them here. Enter a string or leave the field empty.

i_round_redYou need to escape special characters and whitespaces in your parameters and surround them with double quotation marks ("). See section Escape Special Characters and Whitespaces in Parameters for details.

i_round_blueIn SSH scripts, you can use alphanumeric characters and the special characters ".", "_", "-", "=", and "/" outside of quoted strings.

Sensor Display

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.

i_round_blueYou can set a different primary channel later by clicking b_channel_primary 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.
    i_round_redYou 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

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.

i_podThis option is not available when the sensor runs on the hosted probe of a PRTG Hosted Monitor instance.

i_round_blueIn 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 b_inherited_enabled under the corresponding setting name to disable the inheritance and to display its options.

i_square_cyanFor more information, see section Inheritance of Settings.

Channel List

i_round_blueWhich 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

i_round_blueThis channel is the primary channel by default.

[Value]

The value that the script file returns in one channel

i_square_cyanFor more information about the return value format, see section Custom Sensors.

More

i_square_blueKNOWLEDGE BASE

What are beta sensors and how can I use them?

What security features does PRTG include?