Shell Script to Strip Admin Start/Stop Accounting Logs
Description:
This Shell Script will strip the start and stop records for Administrative logins to a
PortMaster (TM) which are sent to the RADIUS (TM) Accounting Log as of ComOS Release
3.8.
The RADIUS Accounting Log could impact disk-space availability if left unchecked with
the new messages.
Shell Script Implementation:
:
# This script will strip admin records from RADIUS
# accounting logs and place the results in detail.real
# run daily or hourly from cron Sites may wish to add
# more error checking to be extra careful, if low on
# space
cd /usr/adm/radacct
for i in *
do
cd $i
if [ -s detail ]; then
mv detail detail.tmp
perl -e '$/ = "";while (<>) { print unless /Service-Type =
Administrative-User/i; }' < detail.tmp >>detail.real
rm detail.tmp
cd ..
fi
done
|