Created
January 26, 2020 07:37
-
-
Save narfel/7e34750dca76924cc9a90ed33f10ce63 to your computer and use it in GitHub Desktop.
Home Assistant: apt packages sensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensor.yaml: | |
------------ | |
- platform: command_line | |
name: "Apt Sensor" | |
command: "ssh -o StrictHostKeyChecking=no <user>@<host> -p 22 -i /config/sshkey/id_rsa /path/to/get_apt.sh" | |
scan_interval: 43200 #check every 12h | |
command_timeout: 60 | |
get_apt.sh: | |
----------- | |
LANG=C apt-get upgrade -s |grep -P '^\d+ upgraded'|cut -d" " -f1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment