1
0
Fork 0
forked from infra/ansible

Zabbix: Fix cronjob that generates the SSH target list

This commit is contained in:
Greg Sutcliffe 2026-05-28 17:17:40 +01:00
commit f3a05e1b72
Signed by: gwmngilfen
SSH key fingerprint: SHA256:dNHcz65ApR68w2TkCIAXDBdt4oNL62Fyx48U7dXWuk0

View file

@ -11,6 +11,8 @@ TMP_FILE=$(mktemp)
if [ -s "$TMP_FILE" ]; then
mv "$TMP_FILE" /etc/zabbix/ssh-targets.txt
chmod 644 /etc/zabbix/ssh-targets.txt
# creating and moving a file breaks selinux, so set it to match a file the agent can already read
chcon --reference=/etc/zabbix/fedora.psk /etc/zabbix/ssh-targets.txt
else
rm -f "$TMP_FILE"
fi