I would like to use SSH script sensor to monitor process uptime. I have created a script under /var/prtg/scripts:
#!/bin/sh ps -C java -o etimes= 2>&1 1>/dev/null if [ $? -ne 0 ]; then echo "1:$?:$1 down" else echo "0:$?:OK" fi
and i get 0:1:OK as the result which is fine because the service/process is running but the command:
ps -C java -o etimes=
gives service/process uptime in seconds and i would like that number in my result. Something like "0:25444:uptime in seconds". I guess that is doable but i'm doing something wrong.
Ty.
Add comment