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?
This article applies to PRTG Network Monitor 14.x.10 or later
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.
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.
Please follow the steps below to get the Python Mini Probe up and running:
1) Prepare your PRTG server:
- 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!
- In the PRTG web interface, navigate to Setup | System Administration | Core & Probes and define the settings as following.
- Define an Access Key for the Python Mini Probe. You can also use an existing one.
- Add an appropriate IP filter in section Allow IPs. Use, for example, any.
- Allow Mini Probe connections: Go to section Probe Connection Settings and choose Allow Mini Probes to connect.
- 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
2) Prepare the Python Mini Probe:
- Download and copy the Mini Probe folder to your Linux machine: Get it on GitHub!
- Name the target directory with the unzipped files PythonMiniProbe
- Run the Python Mini Probe installer: for example, use the command
sudo python setup.py installand 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): 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 : 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.
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.
In the case of issues with your Python Mini Probe, enable debugging:
- Open the file probe.conf
- 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
You will get the details and traceback on major errors directly on the console.
Hey Paessler team,..
Very cool. We got the probe up and running. Works pretty well! For us, the next thing is to get it up and running out of the test environment in a real live situation.
We are going to use it in a cooled care with frozen fish in it. Fish is being transported every day around the country in big or small trucks, depending on the size/location. Well, the PRTG back-end and the mini probe will work great. We can measure it with a Watchdog(works!) and retrieve the data in the core by a mini probe (Works!) to see what the current (live) temperature is. But, we run into a problem.
We want to run an environment without "the internet of things" connection. By that i mean that without having a live internet connection in need. So, we tested it with an Wifi dongle on the raspberry and connect it to the headquarters Wi-Fi every time we get there. But the mini-probe doesn't have an cache for the sensoring it does?
Thanks,.. hope to hear from you.
Hey Paessler team,
Can you tell me how i can add more types of censoring to the mini-probe? There is an folder that seems to have the types of sensors in it,.. but... how can i add more? Is there an "easy" way?
Can the Python Mini Probe buffer results when the internet connection is lost?
To answer these questions, the mini-probe cannot cache or buffer results as of yet and to have more sensors, they would need to be programmed yourself, as of yet the ones that are available in the probe are all that we have programmed.
root@prtgprobe:/home/pro/PythonMiniProbe# bash install.sh This script will guide you to install the PythonMiniProbe installing python-dev and build-essentials Correct python version! Starting to install the miniprobe and requirements Traceback (most recent call last): File "setup.py", line 26, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools
I'm getting this Error when trying to install the probe. What am i doing wrong? ^^
Can you run
sudo pip install setuptools
...and see if it works then?
The requirements state that a Debian OS must be used. Looking through the files on GitHub, these are all Python scripts. What would be required to use this on a RedHat installation?
It should run on RedHat out of the box, given that Python is installed as described in the readme of the mini probe. However, it has only been tested on Debian, so your mileage may vary :)
i've got a lot of linux systems i'd like to monitor with the miniprobe and i'd like to have them all under one main folder, however prtg tells me that the different objects cant be moved since the are "fix". any possibility / workaround
No, probes are always on the same level as the local probe and therefore cannot be moved.
how group linux systems then? if i do "add device" under a mini probe it is only looking at the probe itself, even it allows me to add a device with different name / ip ?
I'm not sure what you mean - you don't necessarily need mini probes for monitoring linux hosts. If your PRTG server can reach them, you can also add them directly to the local probe (as a device).
yes but there i am not able to use the linux update sensor. is there an other way to monitor linux updates (standard debian installs)?
Hm, not without a custom script you need to come up with. From what I know it simply checks and parses apt-get -u upgrade...
are there any ambitions from paessler on getting (standard) things like this for linux systems working from the normal probes?
read: will i be able to monitor my apt / yum status from from windows probes in the future?
There are currently no plans for a native sensor outside our mini probes, I'm afraid.
I am not familiar with linux and trying to get the probe working on a Raspberry PI 3 running Raspbian Pixel. I am getting error: Installed distribution pyasn1 0.1.7 conflicts with requirement pyasn1>=0.2.3. When I run sudo apt-get install python-pyasn1 it tells me it's at the latest version. How do I update pyasn1 to be compatible with PRTG Mini Probe?
I have also tried sudo pip install pyasn1 and that states Requirement already satisfied: pyasn1 in /usr/lib/python2.7/dist-packages
Could you issue the following command on your pi:
pip install -Iv pyasn1==0.2.3
Does that do the trick?
Stephan Linke, Paessler Tech Support
That worked perfectly thanks Stephan :-) I had issues with sudo python setup.py configure. It would work but wouldn't save the inputs for key and PRTG server into the probe.conf file. I edited the file manually and saved the settings and all is working great! I notice their is no auto discovery option for the mini probe? Is that by design? Makes setting up SNMP for devices labour intensive as we need to add each sensor and item manually.
Yeah, the probe doesn't have an auto discovery feature as far as I'm concerned.
I agree that it's somewhat more work then :/
Stephan Linke, Paessler Tech Support
i'am not able to start the setup.py following error:
This script will guide you to install the PythonMiniProbe installing python-dev and build-essentials Installing PIP! Starting to install the miniprobe and requirements File "setup.py", line 36 with open(path, 'r') as file: ^ SyntaxError: invalid syntax There is an error in line 36,
Can you please help me?
I'm trying to install it on Raspberry3 using Debian Jessie
With what line did you try to start/setup the probe? Like, which command showed that error?
Stephan Linke, Tech Support Team
i'am logged in as normal user as example pi, then to become root:
sudo su then the following commands: root: cd PythonMiniProbe/ root: python setup.py install /home/pi/PythonMiniProbe# sudo python setup.py install File "setup.py", line 36 with open(path, 'r') as file: ^ SyntaxError: invalid syntax
...then the srcipts ends, the same for: bash install.sh
Could you try to get the installer script again from the github repo and make sure it's the same?
Stephan Linke, Tech Support Team
I tried within this way:
- remove the repo folder with:
- rm -r /home/pi/PythonMiniProbe
- Copy the actual git repository:
- git clone https://github.com/PaesslerAG/PythonMiniProbe
- change to folder within the downloaded files:
- cd /home/pi/PythonMiniProbe
- bash install.sh
Same error ... tried to user setup.py, same error ...
I'll ping the developer, maybe he has an idea :)
tronixinside, it would be nice to know what version of python you are running. You can run "python --version" to get that information.
How many this Mini Probes can support one Core Server? Limits are the same? 30?
Dear Vasiliy, thank you for the KB-Post. Yes, please use the same recommendation for mini Probes as for normal Remote Probes.
the Python miniprobe still works with current PRTG (18.4.45) yet the github project state is a bit sad with 3 unanswered PR and no activity since one year. Is Paessler still interested ? I ask because I could do a PR for it but if it is wasted time anyway I'd prefer not bother.
gpfr, to be honest, work's been halted on the mini probes for the time being.