AptWatcher is a simple Sinatra app that helps you keep track of packages that need updating on your servers.
On each server you manage you set up a daily cron job that fetches the list of packages that need to be updated and sends that list to AptWatcher:
One line is interpreted as one service
{
"name": "service_name",
"version_installed": "1.0.0",
"version_available": "1.0.1"
}
{"name":"service_a","version_installed":"1.0.0","version_available":"1.0.1"}
{"name":"service_b","version_installed":"1.0.0","version_available":"1.0.1"}
{"name":"service_c","version_installed":"1.0.0","version_available":"1.0.1"}
@daily apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "{\"name\":\"$1\",\"version_installed\":\"$2\",\"version_available\":\"$3\"} \n"}' | curl -u user:pass --data-binary @- http://hostname/api/collector/upgrades/$(hostname)
If any packages are in that payload that weren't previously sent, a message is sent via a Slack incoming webhook with that list of new packages.
The easiest way to get going is deploying to Heroku:
Otherwise, you can bundle, create your database, migrate, and run:
$ bundle
Check the .env
file for the environment variables you can use to
configure the app.
AptWatcher is copyright © 2017 Obscured It is free software, and may be redistributed under the terms specified in the LICENSE file.
AptWatcher is maintained by the friendly crew at Obscured, an exception, performance, and uptime monitoring service for developers.