Is there any timeframe when the mini probe will support redhat linux?
Article Comments
So i was able to get the prob installed with Python, but it is not creating the service to start the mini probe. Any suggestions?
May, 2016 - Permalink
Ok, i can get the probe to run on Redhat 6.7. The I will be looking into the issues with the scripts not running correctly.
05/04/2016 12:40:09 - ERROR - Ooops Something went wrong with 'mpprobehealth' sensor 3300. Error: list index out of range 05/04/2016 12:40:09 - ERROR - Ooops Something went wrong with 'mpdiskspace' sensor 3302. Error: list index out of range
May, 2016 - Permalink
We'll have to wait until the colleague who wrote the script is available; that will be next Monday :)
May, 2016 - Permalink
Hi,
I created an init script for CentOS 6 and have also fixed the problems with the probehealth and diskspace sensors. Here is the init script:
#!/usr/bin/env bash
#
# prtgprobe PRTG Python Mini Probe
#
# chkconfig: 2345 90 10
### BEGIN INIT INFO
# Provides: prtgprobe
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: will run the MiniProbe as service
# Description: This will run the PRTG Python Miniprobe as a service
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/opt/miniprobe
DAEMON=$DIR/probe.py
DAEMON_NAME=prtgprobe
# This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
DAEMON_USER=prtgprobe
# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid
do_start () {
echo -n "Starting $DAEMON_NAME: "
sudo -u $DAEMON_USER $DAEMON &
sleep 1
ps -ef | grep -v grep | grep probe.py | awk '{print $2}' > $PIDFILE
RETVAL=$?
[ $RETVAL -eq 0 ] && echo_success || echo_failure
echo
return $RETVAL
}
do_stop () {
echo -n "Shutting down $DAEMON_NAME:"
if [ -e $PIDFILE ] ; then
kill `cat $PIDFILE` >/dev/null 2>&1
rm -f $PIDFILE
fi
RETVAL=$?
[ $RETVAL -eq 0 ] && echo_success || echo_failure
echo
return $RETVAL
}
case "$1" in
start|stop)
do_${1}
;;
restart|reload|force-reload)
do_stop
do_start
;;
status)
status -p $PIDFILE "$DAEMON"
RETVAL=$?
;;
*)
echo "Usage: /etc/init.d/$DAEMON_NAME {start|stop|restart|status}"
exit 1
;;
esac
exit 0
Here is a patch for diskspace.py:
--- PythonMiniProbe/miniprobe/sensors/diskspace.py 2016-12-02 16:17:17.678956685 +0000
+++ PythonMiniProbe-el6/miniprobe/sensors/diskspace.py 2016-12-02 16:22:50.152923982 +0000
@@ -83,7 +83,7 @@
def read_disk(self):
disks = []
channel_list = []
- for line in os.popen("df -k -xtmpfs -xdevtmpfs"):
+ for line in os.popen("df -k -xtmpfs -xdevtmpfs -P"):
if not line.startswith("Filesystem"):
disks.append(line.rstrip().split())
for line in disks:
Here is a patch for probehealth.py:
--- PythonMiniProbe/miniprobe/sensors/probehealth.py 2016-12-02 16:17:17.679956697 +0000
+++ PythonMiniProbe-el6/miniprobe/sensors/probehealth.py 2016-12-02 16:27:07.411992291 +0000
@@ -173,8 +173,8 @@
def read_disk(self):
disks = []
channel_list = []
- for line in os.popen("df -k"):
- if line.startswith("/"):
+ for line in os.popen("df -k -xtmpfs -xdevtmpfs -P"):
+ if not line.startswith("Filesystem"):
disks.append(line.rstrip().split())
for line in disks:
channel1 = {"name": "Total Bytes " + str(line[0]),
I also edited probe.py and miniprobe.py so that I could change the location of the probe.conf and probe.log file.
Hope this helps someone else,
Ben
Dec, 2016 - Permalink
Very nice, thanks a bunch! :) You may want to push your changes to https://github.com/PaesslerAG/PythonMiniProbe so we can review and integrate it :)
Dec, 2016 - Permalink
It's not officially tested, but have you tried it already? As the prerequisites should be available on RHEL as well...
May, 2016 - Permalink