Good morning!
I have an advanced SSH Script Sensor in PRTG. It runs a script that has a chance to hang indefinitely. When it runs, I can see on the target server that the sshd process gets created as expected, and we have subprocesses for the script and the commands:
[user@server ~]# ps -ef | grep prtg root 26698 1553 30 11:22 ? 00:00:00 sshd: prtgadm [priv] prtgadm 26707 26698 0 11:22 ? 00:00:00 sshd: prtgadm@notty prtgadm 26708 26707 0 11:22 ? 00:00:00 -bash prtgadm 26719 26708 0 11:22 ? 00:00:00 /bin/bash /var/prtg/scriptsxml/disk_free.sh prtgadm 26764 26719 0 11:22 ? 00:00:00 stat -f -c %b /user/prtg_test_monitor [user@server ~]#
When the script hangs indefinitely, PRTG will try to kill it after the timeout (shell timeout is 10 seconds in my case). I've found that, while the sshd processes get killed correctly, the shell is not killed, but orphaned. The process and it's subprocesses linger:
[user@server ~]# ps -ef | grep prtg prtgadm 26708 1 0 11:22 ? 00:00:00 -bash prtgadm 26719 26708 0 11:22 ? 00:00:00 /bin/bash /var/prtg/scriptsxml/disk_free.sh prtgadm 26764 26719 0 11:22 ? 00:00:00 stat -f -c %b /user/prtg_test_monitor [user@server ~]#
Is there a way to get PRTG to correctly kill it's sshd process and all subprocesses?
Add comment