We use RedHat Enteprise Linux in our Environment and would like to get the status of systemd-Services in PRTG. What would be the best way to achieve this in PRTG? Is it somehow possible to do it via SNMP?


Take this article as basis and create the folder /var/prtg/scripts Make a new script file eg. vi query_process.sh Add the lines below;

#!/bin/sh 
pgrep $1 2>&1 1>/dev/null
if [ $? -ne 0 ]; then echo "1:$?:$1 Down" else echo "0:$?:OK" fi

Save the file and make it executable with:chmod +x query_process.shIf not executable, the sensor wont allow you add the script by name when adding the sensor.

Add the ssh script sensor in PRTG to the device (make sure your SSH Credentials have been set correctly) Set the parameter field of the sensor to the process name -eg.ntpd

ps -e

will give you a list of available processes to query.


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.