Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Ubuntu Update Overview Script
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.

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

https://raymii.org/cms/p_Ubuntu_update_mailer

Thanked by 1ErawanArifNugroho

Comments

  • NickkNickk Member
    edited September 2012

    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.

  • AsadAsad Member
    edited September 2012

    @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

    #Permission is hereby granted, free of charge, to any person obtaining a copy
    #of this software and associated documentation files (the "Software"), to deal
    #in the Software without restriction, including without limitation the rights
    #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    #copies of the Software, and to permit persons to whom the Software is
    #furnished to do so, subject to the following conditions:
    #
    #The above copyright notice and this permission notice shall be included in
    #all copies or substantial portions of the Software.
    #
    #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    #FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL  THE
    #AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    #THE SOFTWARE.
    

    So yes, go ahead, edit it for yum :)

  • @AsadHaider and if you don't mind, please share the changes?

  • @Raymii Yep, of course.

    Cheers.

Sign In or Register to comment.