This article applies to PRTG Network Monitor 14.x.10 or later


I would like to monitor Debian based systems via the PRTG Mini Probe interface. How can I implement such a “Linux Probe”? Is there an example of how to gather monitoring data directly from my Linux based device with a mini probe?


Important notice: The information in this article is outdated. Mini probes are deprecated as the OpenSSL version required to run them is out of support. You can no longer install new mini probes.


If you would like to monitor a Linux system, we recommend to take a closer look at our new Multi-Platform Probe!

Monitoring Linux Systems with the PRTG Mini Probe

Usually, PRTG monitors systems agentless so you do not have to install any software on target devices. PRTG probes connect directly to the remote system via SSH, WMI, SNMP, etc. to take the desired measurements. Agentless monitoring brings a lot of advantages for you because it is easy to set up and you do not have to maintain anything, but some situations require other methods than agentless.

For example, Linux monitoring is one of those because of its potential complexity and individual monitoring demands. In this case, installing a small piece of software on the target system might be a better idea to monitor data more easily. For this purpose, PRTG offers the option to use the PRTG Mini Probe interface .

PRTG Mini Probes work similar like the “big” local and remote probes but with a smaller set of sensor types. You are completely free in implementing and adjusting mini probes depending on which monitoring data you need. The Mini Probe API is publicly available so you can create your own individual probes. Or you simply extend the code of our PRTG Python Mini Probe proof-of-concept and add your own sensor types.

This article describes the Python-based open source code for a Mini Probe that you can run on any system that can run Python scripts.

Note: This article is provided for your information only. The steps described here have been tested carefully. However, we cannot offer deep technical support for customizing this proof of concept nor for writing your own mini probes.

Note: We do not further develop the currently available Mini Probe API because we plan major changes to the underlying API in PRTG. You can still use the Python Mini Probe, for example, if the available HTTP push sensors are not sufficient for your needs.


Python Mini Probe (Open Source)

You are free to use the Mini Probe API in order to implement probes and the corresponding sensors for any application scenario. So the Mini Probe helps you gather monitoring data from systems which do not run the supported Windows versions. You can find the full documentation of the Mini Probe API here.

Every PRTG installation already provides several natively available sensors for Linux monitoring. These gather monitoring data via SNMP or SSH connections but cannot run on a probe directly under Linux which is often demanded by PRTG users. So, in order to demonstrate the capabilities of the Mini Probe interface and to give you a starting point for implementing your own probe for Linux, we provide you a proof of concept for the Mini Probe: the Python Mini Probe.


Python Mini Probe for Linux

This Mini Probe proof of concept is written in Python. It runs the monitoring processes directly on a Debian based system and delivers the results back to the PRTG core server via the PRTG Mini Probe interface. We have successfully tested the Python Mini Probe on Debian, Ubuntu, and Raspbian.

For example, set up the Python Mini Probe on a small Raspberry Pi in your server room and get monitoring results directly from there! Of course, you can also enhance the functionalities of this open source implementation as you wish to get other desired data. Below we describe the sensors which this package contains by default and give instructions for running it on a Linux machine.

Get the Python Mini Probe on GitHub!


Requirements

You need to fulfill only a few prerequisites to monitor with the Python Mini Probe:

  • PRTG Core Server: version 14.x.10 or later
  • A Debian based system: e.g., Ubuntu, Debian, Raspbian
  • Python 2.7 or later: see python.org
  • Packages python-dev and build-essential (or at least gcc)
  • The package management system pip (see pip: Installation)

Important: Version 15.2.6 comes with major changes. Please see the migration documentation on GitHub to update from a previous version.

Note: In previous versions of the Python Mini Probe (before 15.2.6) you needed to install the following Python modules manually: pyasn1, pysnmp, requests. These modules are now included in the installer.


Installation

Please follow the steps below to get the Python Mini Probe up and running:

1) Prepare your PRTG server:

  1. Set your PRTG server to use HTTPS: In the PRTG web interface, navigate to Setup | System Administration | User Interface, section Web Server, and choose Secure HTTPS server in section TCP Port for Web Server.
    Note: Other connection methods are not allowed!
  2. In the PRTG web interface, navigate to Setup | System Administration | Core & Probes and define the settings as following.
  3. Define an Access Key for the Python Mini Probe. You can also use an existing one.
  4. Add an appropriate IP filter in section Allow IPs. Use, for example, any.
  5. Allow Mini Probe connections: Go to section Probe Connection Settings and choose Allow Mini Probes to connect.
  6. Now check that you can reach your PRTG server from the machine on which the Python Mini Probe will run: e.g., execute the command
    wget https://<your_PRTG_server>

2) Prepare the Python Mini Probe:

  1. Download and copy the Mini Probe folder to your Linux machine: Get it on GitHub!
  2. Name the target directory with the unzipped files PythonMiniProbe
  3. Run the Python Mini Probe installer: for example, use the command 
    sudo python setup.py install 
    and afterwards 
    sudo python setup.py configure

You have to provide the following information in the command shell:

  • Please provide the username the script should run under: Enter the username the mini probe script will use to run on the Linux machine. At the moment, only root is supported here!
  • Please provide the desired name of your Mini Probe [Python MiniProbe]: Enter a name which will be displayed for the Mini probe in the PRTG web interface. If you do not enter anything, it will appear as the default Python MiniProbe.
  • Please provide the Probe GID (any unique alphanumerical sting): The Probe GID is a unique identifier for the probe. Enter any string.
  • Please provide the IP/DNS name of the PRTG Core Server: Enter the address of your PRTG server to which the Mini Probe will connect.
  • Please provide the port the PRTG web server is listening to (IMPORTANT: Only SSL is supported)[443]: The default port for SSL connections is 443. It will be used automatically because no other connections methods are allowed, so you can leave this field empty.
    Note: You can specify a custom Mini Probe port in the Core & Probes settings as of PRTG version 14.x.13.
  • Please provide the base interval for your sensor [60]: Enter the scanning interval of the sensors on the Mini Probe in seconds. Default is 60 seconds.
  • Please provide the Probe Access Key as defined in the PRTG Core: Enter an access key to connect to the core server. For details, see PRTG Manual: System Administration—Core & Probes.
  • Please provide the path the probe files are located: Enter the path to the Python Mini Probe folder.
  • Do you want the mini probe flushing buffered and cached memory [y/N]: Please do not use this option in productive environments because this is an experimental feature!
After completing the setup, the Python Mini Probe will start automatically. You can start and stop the process using the following commands: 
sudo service prtgprobe start 
sudo service prtgprobe stop

3) Approve the Probe Connection

The last thing to do is: Approve the new probe connection in the PRTG web interface! The acknowledgement works like for a new remote probe connection.

Then you can work with the Python Mini Probe in the PRTG web interface as usual, for example, add sensors, review monitoring data, create notifications.


Default Sensors

By default, the Python Mini Probe contains the following sensors to monitor your Linux device:

  • CPU Load: Monitors the CPU load (average) on the system running the Mini Probe.
  • Disk Space: Monitors the free disk space on the system.
  • HTTP: Monitors a web server via HTTP.
  • Memory: Monitors free memory on the system.
  • Ping: Monitors the availability of a target device using ICMP.
  • Port Range: Checks the availability of a port range on the target device.
  • Probe Health: Monitors probe internal parameters to indicate the probe health.
  • SNMP Custom: Monitors a numerical value which is returned by a specific OID via SNMP.
  • SNMP Traffic: Monitors the traffic on a specified interface via SNMP.
  • DNS: Monitors a DNS server and supports all DNS types which are currently available in the Windows probe (A, AAA, NS, SOA, PTR, MX, CNAME)
  • APT: Checks if system updates are available.
  • External IP: Shows the external IP address of the probe.
  • NMAP: Monitors the availability of systems on a network.

You can adjust these default sensors or add even new ones to the probe package. Please refer to PRTG Manual: Mini Probe API for more information.


Debugging

In the case of issues with your Python Mini Probe, enable debugging:

  1. Open the file probe.conf
  2. Replace the line debug: with debug:True

This will enable detailed logging. The logs will be stored in the created \logs subfolder of the Mini Probe. For further debugging, stop the Mini Probe process (see above). Navigate to the folder that contains the file probe.py and run the command python probe.py

You will get the details and traceback on major errors directly on the console.



Please note that the Python Mini Probe is not maintained since years and therefore we do not provide support for it.

I invite you to have a look at the pyprobe instead, available here: https://gitlab.com/paessler-labs/prtg-pyprobe. You will find all the information you need there. Please, note that the later is provided as is and not officially supported.

At the moment, our development team is also working on a new official probe call multi-platform probe, which can runs on multiple Linux distributions and devices. The latter is in Alpha version and therefore is not feature complete yet, but our developers will continue to add more sensors and feature to it.

Here is the corresponding KB article if you want to have a look and give it a try: https://kb.paessler.com/en/topic/90140-what-is-the-multi-platform-probe-and-how-can-i-use-it


More


Disclaimer:
The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.