The task was to monitor the availability of the SFTP server. Since it's just not available for ssh, we decided to use lftp and made the following script:
Created item with external check "test-sftp.sh[{HOST.CONN},{$SFTP_PASSWORD},{$SFTP_USER}]" and two dependent.
Checks themselves work, but zombie began to spawn. Like that:
Processes are spawned to thousands, until the zabbix server stops working. At this point, as a workaround, I created a cron job that kills zombie processes, but I want to know how to fix this in the usual way?
Code:
if result=$(lftp -u "$3,$2" sftp://$1 -e 'ls;quit' 2>&1); then
rc=$?
stderr="none"
else
rc=$?
stderr=$result
fi
echo "{\"error\": \"$stderr\", \"exit_code\": \"$rc\"}"
Checks themselves work, but zombie began to spawn. Like that:
Code:
zabbix 32680 0.0 0.0 0 0 ? Zs 06:42 0:00 [ssh] <defunct>