[NTLUG:Discuss] Redhat Network alert script for the console?

Kenneth Loafman ken at lt.com
Thu May 8 07:20:43 CDT 2003


Here's a scirpt I use on the console, but you'll have to unwrap it.
[OT: do we accept attachments in this mailing list?]  The secret is the 
"--nox" option which makes it run from the console.  See "man up2date".

If you try too often, they lock the IP address out for a day, so I try 
every 5 minutes.  To email back to youself, just add the appropriate 
sendmail command instead of the "cat /tmp/up2date".

#! /bin/bash

# every few minutes
while [ true ]; do

     up2date --nox -u >& /tmp/up2date

     if [ "`grep -s 'Demo service currently disabled' /tmp/up2date`" != 
"" ]; then
	echo `date -R` No luck
     else
	echo `date -R` Success
         cat /tmp/up2date
	break
     fi

     sleep 300

done



Tom Woody wrote:
> I really like the RedHat alert icon in Redhat 8, and I was wondering if
> anyone had ever put together a similar script that could be ran from a
> cron job to monitor servers.  I don't like letting the RHN automagically
> update my servers...but I would like to get an email from a server if it
> sees that a newer version of a particular RPM is out, so I can evaluate
> it.  As it is now, when I get the Red Hat Errata emails from Bugtraq I
> need to check if I have that RPM installed, and its just time that could
> be better spent.
> 
> I have also though of doing something like this on my own, every day
> checking the rpms on the updates ftp site, comparing it to a known
> installed list and sending an email if there are differences...but I
> didn't know if someone had already done something similar.
> 






More information about the Discuss mailing list