Ubuntu Update Overview Script

Ubuntu Update Overview Script

RaymiiRaymii Member
edited September 2012 in General

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


Quis custodiet ipsos custodes?
https://raymii.org - https://cipherli.st
Thanked by 1ErawanArifNugroho


Sign In or Register to comment.