nv-l
[Top] [All Lists]

RE: [nv-l] TRAPD.LOG - archival

To: NV-L@lists.tivoli.com
Subject: RE: [nv-l] TRAPD.LOG - archival
From: lesdickert@att.net
Date: Thu, 18 Jul 2002 17:21:54 +0000
Here is a script that I use that does what Jason
described.  I left in the part of the script that
ftp's the archived copy to another server (our
development netview server) where we have more
disk space available.

Les Dickert
Trigon Blue Cross/Blue Shield

###############################################
#
#  This script checks to see if a new trapd.log.old
#  has been created (by comparing the output of
#  'ls -l trapd.log.old' with a previous output
#  of the same command), and if so, saves the new
#  copy of trapd.log.old.  This script will run
#  under control of the 'cron', probably once
#  an hour will be enough.
#
#  The purpose is to be able to save the trapd.log
#  events for longer periods of time.
#
#       Les Dickert
#       04-19-2001
#
###############################################

DIR=/usr/OV/log

( cd $DIR

#  Check to see if we have a newly created
#  trapd.log.old file.

L=`ls -l trapd.log.old | tr -d " "`

P=`cat trapd.log.ls`

if [ $L != $P ]
then

#  We have a new trapd.log.old file.
#  Make a copy and then ftp it over to
#  netviewd for safekeeping.

#  Create a unique filename to put a copy
#  of trapd.log.old into, and compress it.

   EXT=`date +%m%d%H%M`
   LOGFILE=trapd.log.${EXT}

   cp trapd.log.old $LOGFILE
   compress $LOGFILE

#  Create a .netrc file with the filename in
#  it for ftp to use.   We'll set the HOME
#  shell variable to this directory as that's
#  where ftp looks for the .netrc file.

   HOME=$DIR
   sed "s/LOG/${LOGFILE}.Z/" < netrc > $HOME/.netrc
   chmod 600 $HOME/.netrc
   ftp netviewd
   rm ${LOGFILE}.Z

#  Record the ls -l info about trapd.log.old
#  so we won't save it again till it changes.

   echo $L > trapd.log.ls
fi
)

### end of script #############################
> I think the problem you will run into is Netview continues to write to the
> same log file.  My recommendation would be to determine you 'archival'
> needs:  hourly, daily, weekly; traps 1, 2, 3, 6, 899, etc; etc.  Then write
> a simple script to extract your needed information, compress and viola.
> Have that script run by crontab so you have a date/time reference.
> 
> Now, if you dont need to archive at all by date, just copy off a version of
> the file at a specified time frame.
> 
> If you are worried about a simple syslog file, this is how my Admin group
> handles it:
> rm -f /tmp/syslog.out
> touch /tmp/syslog.out
> refresh -s syslogd
> 
> I hope I at least answered you question by saying I am unaware of any
> Netview specific mechanisims.
> 
> Jason Allison
> Principal Engineer
> ARINC Incorporated
> Office:  (410) 266-2006
> FAX:  (410) 573-3026
> 
> 
> -----Original Message-----
> From: Barr, Scott [mailto:Scott_Barr@csgsystems.com]
> Sent: Thursday, July 18, 2002 11:53 AM
> To: nv-l
> Subject: [nv-l] TRAPD.LOG - archival
> 
> 
> I am looking for the best way to maintain my trapd.log - I see there is an
> option for a "maintenance" script server setup. I want to keep several
> iterations of the log so history is available further back then whats in the
> current trapd.log. Any recommendations? The problem is Cisco (yah, go
> figure) sending in "Syslog" traps for EVERYTHING (content switches,
> firewalls, routers etc.) - I have no easy way to keep them out of the log (I
> can't filter syslog traps I need some of them but not all of them in the
> log)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: nv-l-unsubscribe@lists.tivoli.com
> For additional commands, e-mail: nv-l-help@lists.tivoli.com
> 
> *NOTE*
> This is not an Offical Tivoli Support forum. If you need immediate
> assistance from Tivoli please call the IBM Tivoli Software Group
> help line at 1-800-TIVOLI8(848-6548)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: nv-l-unsubscribe@lists.tivoli.com
> For additional commands, e-mail: nv-l-help@lists.tivoli.com
> 
> *NOTE*
> This is not an Offical Tivoli Support forum. If you need immediate
> assistance from Tivoli please call the IBM Tivoli Software Group
> help line at 1-800-TIVOLI8(848-6548)
> 

<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web