Sun, 17 Feb 2013 19:49:24 +0100
Logs check's only yesterdays events, better mailbox check
#!/bin/bash # ############################################################################# # Copyright (C) 2005-2012 # # Michiel Broek <mbse@mbse.dds.nl> # the Netherlands # # This file is part of SlackSecCheckScripts. # # This package is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # # SlackSecCheckScripts is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with MBSE BBS; see the file COPYING. If not, write to the Free # Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ############################################################################# PATH=/sbin:/usr/sbin:/bin:/usr/bin umask 077 TZ=UTC; export TZ LANG=C; export LANG SECUREDIR=`mktemp -d /tmp/_securedir.XXXXXX` || exit 1 trap "/bin/rm -rf $SECUREDIR ; exit 0" EXIT INT QUIT PIPE if ! cd "$SECUREDIR"; then echo "Can not cd to $SECUREDIR". exit 1 fi TMP=$SECUREDIR/tmp if [ -x /usr/sbin/smartctl ] && [ -f /etc/smartd.conf ]; then kill -0 `pidof /usr/sbin/smartd` 2>/dev/null if [ "$?" != "0" ]; then printf "\nWarning: smartd is not running.\n" fi DISKS=$( egrep '^[^#]*(dev)' /etc/smartd.conf | awk '{ print $1 }' ) for f in $DISKS ; do # /usr/sbin/smartctl -H -i -l error -l selftest $f /usr/sbin/smartctl -q errorsonly -H -l error $f > $TMP if [ -s $TMP ]; then printf "\nS.M.A.R.T. error information for disk %s\n\n" $f cat $TMP fi # Most harddisk manufactures specify 60 degrees Celsius, warn a little below that TEMP=$( /usr/sbin/smartctl -A $f | grep ^194 | awk '{ print $10 }' ) if [ ! -z "$TEMP" ] && [ ${TEMP} -ge 53 ]; then printf "\nS.M.A.R.T. high temperature for disk %s, %s degrees Celsius\n" $f $TEMP fi done fi