Open dapuzz opened 5 months ago
Hi!
If systemctl -a doesnt list inactive services, you could create a static switch for each service, maybe you could try something like this:
- command: systemctl is-active kodi.service || true
scan_interval: 300
sensors:
- type: binary
name: Kodi
command_on: systemctl start kodi.service
command_off: systemctl stop kodi.service
payload_on: active
Let me know if it works for you!
Hi Adrian, Copying your example
systemctl -a | awk '/hyperion.service|pure-ftpd.service/ {print $1 "," $4}'
create the switch just when the service is running. As soon as the switch is turned off, it became unavaiable I suppose because the systemctl -a does not return anything if the service is not active.Do you have any suggestion? Thank you