New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Ubuntu Update Overview Script
Bash script to mail Ubuntu updates
This is a bash script for Ubuntu, to be run by cron on a set interval. It checks if there are apt-updates, and if so, mails an overview of the packages which can be updated, whith their local version, the version available and an URL to the Ubuntu package site where you can see the changelog. I wrote this as an addition for my Nagios monitoring, that only shows how many updates there are, this is a lot more verbose
Example output:
If there are no updates:
No updates available for host vps11.sparklingclouds.nl on date 21.09.2012
If there are updates:
--- Updates for host: vps11.sparklingclouds.nl ---
Date: 21.09.2012
Total updates available: 44
-- Package: apport --
Installed: 2.0.1-0ubuntu12
Candidate: 2.0.1-0ubuntu13
Package Information: http://packages.ubuntu.com/precise/apport
-- End package apport --
-- Package: base-files --
Installed: 6.5ubuntu6
Candidate: 6.5ubuntu6.2
Package Information: http://packages.ubuntu.com/precise/base-files
-- End package base-files --
-- Package: bind9-host --
Installed: 1:9.8.1.dfsg.P1-4ubuntu0.2
Candidate: 1:9.8.1.dfsg.P1-4ubuntu0.3
Package Information: http://packages.ubuntu.com/precise/bind9-host
-- End package bind9-host --
-- Package: build-essential --
Installed: 11.5ubuntu2
Candidate: 11.5ubuntu2.1
Package Information: http://packages.ubuntu.com/precise/build-essential
-- End package build-essential --
-- Package: dbus --
Installed: 1.4.18-1ubuntu1
Candidate: 1.4.18-1ubuntu1.1
Package Information: http://packages.ubuntu.com/precise/dbus
-- End package dbus --
The script
Thanked by 1ErawanArifNugroho
Comments
Quite handy. I assume it could be modified quite easily to work on Debian?
It runs on Debian. The only thing not working then are the Package Information links.
@Raymii Cool scipt, mind if I edit it to work with RHEL systems?
Would be useful to stick on the servers that I set up and forget about.
@AsadHaider
So yes, go ahead, edit it for yum
@AsadHaider and if you don't mind, please share the changes?
@Raymii Yep, of course.
Cheers.