From a7f89980e5b3f4b9a74c70dbc5ffe8aabd28be28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 6 Jul 2014 18:04:32 +0200 Subject: Imported Upstream version 2.9.3 --- scripts/checksel | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 scripts/checksel (limited to 'scripts/checksel') diff --git a/scripts/checksel b/scripts/checksel new file mode 100755 index 0000000..63ea9a9 --- /dev/null +++ b/scripts/checksel @@ -0,0 +1,30 @@ +#!/bin/sh +# +# checksel +# +# This script runs ipmiutil sel, writing any new records to syslog, +# and will then clear the SEL if free space is low. +# +# The IPMI SEL should not normally be cleared, because the history +# of the events is important, but if the IPMI SEL fills up, no new +# events are logged, so saving the previous SEL events and clearing +# the SEL must be done occasionally, as needed. +# +# app=`basename $0` +# pdir=`echo $0 |sed -e "s/$app//"` +pdir=/usr/bin +ddir=/var/lib/ipmiutil +# First check to see if the IPMI SEL is enabled on this system. +# If not, do nothing else. +$pdir/ipmiutil sel -v >/dev/null 2>&1 +if [ $? -eq 0 ]; then + # Write new SEL events to syslog, and check if free space is low + $pdir/ipmiutil sel -w |grep "WARNING: free space" + if [ $? -eq 0 ]; then + today=`date +%y%m%d` + # The old SEL records are in syslog, but save a copy in $ddir also. + $pdir/ipmiutil sel -e >$ddir/ipmisel_${today}.txt + # Clear the IPMI SEL + $pdir/ipmiutil sel -d + fi +fi -- cgit v1.2.3