InterNetworking Systems, Lucent Technologies Lucent Technologies

Tech Corner

Shell Script to Strip Admin Start/Stop Accounting Logs


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 *
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 ..

Copyright © 2000 Lucent Technologies. Use of this site indicates you accept the Terms of Use and the Privacy Statement. For comments or questions about this site, contact us.