# House style: the UserParameter calls sudo, and the rule below allows the
# SCRIPT -- never the tool it invokes. One line per script that needs root.
#
# s6_services.sh DOES need root, and the note that used to stand here claiming
# otherwise was wrong. The servicedir itself is readable, but s6 creates
# /run/s6-rc/servicedirs/<svc>/supervise as drwx------ root root, and that is
# where the status file lives that s6-svstat reads. Measured 2026-09-22 on
# rt-2, srv-crb2-1 and nfs-2, identically:
#   sudo -u zabbix s6-svstat -o up,wantedup /run/s6-rc/servicedirs/ssh
#   s6-svstat: fatal: unable to check ...: Permission denied
# That is s6's design, not a misconfiguration. Without this line all 77 s6
# items per router were unsupported -- and s6.services.failed still answered 0,
# because unreadable services were skipped silently.
zabbix ALL=(root) NOPASSWD: /usr/lib/aep-zabbix-checks/s6_services.sh
# incus_stats.sh: /var/lib/incus/unix.socket ist 660 root:incus-admin, und
# zabbix gehoert nicht in diese Gruppe. Die Alternative -- zabbix in
# incus-admin aufnehmen -- gaebe volle Incus-Kontrolle; sudo auf genau dieses
# Skript ist die engere Freigabe (PAKET-0.3.0.md Paragraph 2).
# dhcp_stats.sh braucht KEINE Zeile: dhcpd.conf und dhcpd.leases sind
# 644 root:root und als zabbix lesbar -- nachgemessen auf rt-4.asag2, nicht
# angenommen.
zabbix ALL=(root) NOPASSWD: /usr/lib/aep-zabbix-checks/incus_stats.sh
zabbix ALL=(root) NOPASSWD: /usr/lib/aep-zabbix-checks/zfs_stats.sh
zabbix ALL=(root) NOPASSWD: /usr/lib/aep-zabbix-checks/k8s_cert_expiry.sh
zabbix ALL=(root) NOPASSWD: /usr/lib/aep-zabbix-checks/fw_rules_drift.sh
# pdns_check.sh braucht root NUR fuer ping/rping: /run/pdns ist 0700 root und
# der Controlsocket srw-rw---- root:pdns. Gegenprobe als zabbix (23.09.):
# "Unable to connect to remote '/var/run/pdns/pdns.controlsocket': Permission
# denied". Die Alternative -- zabbix in die Gruppe pdns -- gaebe Schreibzugriff
# auf den Controlsocket und damit "pdns_control quit"; diese Zeile ist das
# engere Recht. soa_serial, api und respawns laufen OHNE sudo (nachgemessen:
# UDP an 127.0.0.1, Keydatei 0640 root:zabbix, /var/log/pdns/current 0644).
zabbix ALL=(root) NOPASSWD: /usr/lib/aep-zabbix-checks/pdns_check.sh
