Sensor of the Week: SSH Script Sensor

 Originally published on September 10, 2014 by Florian Staffort
Last updated on March 03, 2022 • 7 minute read

When it comes to monitoring Linux or Unix systems, PRTG Network Monitor offers various interesting possibilities: Use one of PRTG's sensors for Linux monitoring via SNMP (Simple Network Management Protocol), SSH (Secure Shell), or WBEM (Web-Based Enterprise Management). Especially the SSH Script sensor offers you real freedom in customizing your Linux monitoring: Just write a script which returns the desired data from your Linux system (for example, the validity of your SSL certificate used by an Apache instance, see screenshot below), and you can monitor all changes and detect issues before they become a problem.

 

The SSH Script sensor connects to a Linux/Unix system via SSH (Secure Shell). Optionally it allows you to use a private key instead of a user name and password. The sensor allows you to execute a script file located on the target system and then shows the execution time, and one value returned by the executable file or script. If you set a limit in PRTG for this value, you'll get notified if the sensor surpasses this value and goes into error state.

The following examples are typical areas of application for the SSH Script sensor—you can find detailed descriptions of the scripts in the Paessler Knowledge Base:

  • Check if a service on a specific port of your target system is running (Knowledge Base),
  • Monitor the used disk space of a volume under Linux/Unix (Knowledge Base),
  • Check if an external service, needed by your monitored application, is available via an open port. This application is of importance, if an external service is restricted to the IP address of your target system, meaning that the PRTG probe is blocked to monitor the external service. The only way to monitor is to execute a script checking the external service on the target system itself. By returning a PRTG conform result the SSH Script sensor is able to process the data—so you'll see directly in PRTG if an external service is available on a specific port of your target system, or
  • Monitor the business processes of your web shop, for example, the number of new orders in the last 24 hours, the number of registered users, or the number of new customer tickets—as long as your SSH script returns a valid data structure for PRTG, virtually any data your business relies on can be monitored.

If you're looking for more detailed information on the SSH Script sensor, please have a look at the above mentioned examples and take a look at the PRTG manual. For deeper insights into your Linux systems also take a look at the Python Mini Probe, which enables you to run a mini probe directly on the Linux target system.

 

All Sensors of the Week

You have missed other articles of our "Sensors of the Week" blog series? Just take a look at the last 10 sensors:

Subscribe to our RSS feed to always stay up to date on new articles!