What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Advanced SSH Script Sensor Orphans Processes

Votes:

0

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?

http-advanced linux scriptsxml ssh-script-advanced-sensor

Created on Oct 1, 2018 4:30:34 PM

Last change on Oct 1, 2018 6:18:26 PM by  Stephan Linke [Paessler Support]



2 Replies

Votes:

0

What kind of Linux is that if I may ask? Haven't seen this yet :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Oct 2, 2018 6:17:38 AM by  Stephan Linke [Paessler Support]



Votes:

0

We first observed the behavior on RHEL 6.10, and I recreated the issue above on Oracle Linux (a RHEL derivative) 7.5.

Created on Oct 2, 2018 1:35:17 PM




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.