Hi all,
Don't know if anyone knows of a more elegant solution than this (or
perhaps an existing solution?) but I've a few Ubuntu boxes that I
admin, and I've never any idea of when there are package updates. Now
I know that Andy has provided a script (see
http://www.bitfolk.com/customer_information.html#toc_3_Keeping_your_VPS_up_…)
that notifies you when updates are available, but it's 'yet another
thing'(c) that you have to run.
I use Logwatch on all my servers, and so I wondered if it was possible
to write an add-on for that that would integrate such information into
the daily report - turns out there is (and it isn't too difficult to
do either!)
Firstly, obtain a copy of Andy's local-apt.pl script and copy it into
/etc/logwatch/scripts/services. At this point, rename the script
'apt-updates' (but you can call it whatever you want). Then create a
file in /etc/logwatch/conf/services and call it apt-updates.conf
(again, you can call this whatever you want, but it must match the
name given to the script). Inside this script, you only need the
following two lines: (title can be customised if you prefer)
Title = "Package Updates"
LogFile = NONE
To test this is working, execute the following line:
sudo logwatch --service apt-updates --debug high
(obviously replace 'apt-updates' bit if you've changed the script name)
Assuming your server requires some updates, the list of packages will
be displayed in the output (and also from now on in your daily
Logwatch report).
Hope this helps :) (and thanks to Andy for providing the above script)
James