Skip to content

Instantly share code, notes, and snippets.

@Samgarr
Created October 27, 2016 18:51
Show Gist options
  • Save Samgarr/1e957034abbb6d8b39f7710bdf8a5e83 to your computer and use it in GitHub Desktop.
Save Samgarr/1e957034abbb6d8b39f7710bdf8a5e83 to your computer and use it in GitHub Desktop.
Monitoring debian security updates with Prometheus Textfile collector. Don't forget run node_exporter with appropriate parameters!
# based on https://www.robustperception.io/monitoring-directory-sizes-with-the-textfile-collector/
33 * * * * unattended-upgrade --dry-run -d 2> /dev/null | grep 'Checking' | wc -l | sed -ne 's/^\([0-9]\+\).*$/security_updates_count \1/p' > /var/lib/node_exporter/textfile_collector/security_updates_count.prom.$$ && mv /var/lib/node_exporter/textfile_collector/security_updates_count.prom.$$ /var/lib/node_exporter/textfile_collector/security_updates_count.prom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment