Reporting of HDERR (hard disk errors) (was Re: /usr/adm/unix.log)

Lenny Tropiano lenny at icus.islp.ny.us
Thu Sep 22 06:30:40 AEST 1988


In article <10585 at stb.UUCP> michael at stb.UUCP (Michael) writes:
|>I just discovered /usr/adm/unix.log
|>
...
|>#4. Is there any way to get these mesages into a more noticable place 
|>(such as SMRG's message queue?)

He's a little shell script I worked up that does this very thing.
Place the shell script in /usr/lbin/errnotify.sh, make it 755 permission.

-- cut here -- -- cut here -- -- cut here -- -- cut here -- -- cut here --
#
# Notify user of HARD DISK errors from /usr/adm/unix.log daily.
#
# By Lenny Tropiano
#    ICUS Software Systems   (...icus!lenny, lenny at icus.islp.ny.us)
#
# Place in /usr/lib/crontab:
#
#    59 23 * * * /bin/su root % /usr/lbin/errnotify.sh > /dev/null
#
DATE="`date '+%h %d'`"
grep "${DATE}" /usr/adm/unix.log | grep "HDERR" > /tmp/$$hderr
#
# See if there are any errors tonight.
#
set `wc /tmp/$$hderr`
LINES=$1
CHRS=$3
if [ ${CHRS} -ne 0 ]	
then
	echo "${LINES} hard disk errors occurred on ${DATE}" > /dev/error
	cat /tmp/$$hderr > /dev/error
fi
rm -f /tmp/$$hderr
exit 0
-- 
Paper-net: Lenny Tropiano          | @-net:         lenny at icus.islp.ny.us
           ICUS Software Systems   | !-net:      ...sbcs   \
           PO Box 1                |                boulder \
           Islip Terrace, NY 11752 |                talcott  !icus!lenny
Vocal-net: (516) 582-5525 [work]   |                pacbell /
           (516) 968-8576 [home]   |                hombre /
Telex-net: 154232428 ICUS          | Another-net:   attmail!icus!lenny



More information about the Unix-pc.sources mailing list