Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pulling log files off nokia IP330

Status
Not open for further replies.

dooby12

Technical User
Jun 18, 2003
67
GB
what is the best way to pull the log files of a Nokia IP330? i would like to take these log files of thebox and put somewhere on out network, where they can be backed up.
 
setup a automated logswitch and ftp them off. I believe Nokia's knowledge base has some scripts listed. Also I got the scripts I used from access2networks.com go to the downloads section, download cleanup.zip.
[cheers]
 
thanks rn4it, i had a look on access2networks.com but the link to download cleanup.zip seems dead. you know anywhere else i can get this from. also do you have a link to the nokia knowledgebase for this topic, ive tried with no luck.:(
 
That's odd, nokia support link is support.nokia.com, if you can't get the scripts, I'll upload them a little later today.
[cheers]
 
Here's the scripts you'll need you can use a cron job to schedule them. I have attached a cleanup which will delete the logfiles a day after they have been switch(ie. you would have todays and yesterdays logfiles, but any prior would be deleted. Make sure the ftp process is working before you schedule the cleanup. [cheers]
logwitch
#! /bin/csh
#
# This file was created by Access 2 Networks. # The purpose of the file is to run the fw logswitch command.
#
# The next line reads in environment variables for this session.
#
source /var/etc/pm_cshrc
#
setenv NAME `uname -n`
setenv DATE `date +%d%b%Y-%H%M`
# The next line runs the command.
#
fw logswitch $NAME-$DATE
-----------------------------------------------------------fwlog-ftp
#! /bin/csh
#
# This file was created by Access 2 Networks. # The purpose of the file is to ftp log files to an FTP server.
#
# The next line reads in environment variables for this session.
#
source /var/etc/pm_cshrc
#
# The next line sets the environment variable for NAME and FWLOG.
#
setenv NAME `uname -n`
setenv FWLOG `date +%d%b%Y-%H`
#
# The next line changes directories.
#
cd /opt/CPfw1-50-03/log
#
# The next line zips up the files and then deletes the original log files.
#
#tar -cvzf /opt/CPfw1-50-03/log`uname -n`-`date +%d%b%Y-%H%M`-fwlog.tgz $NAME-$F
WLOG* |xargs rm -rf
#
# The next section opens an ftp session and puts the files onto the ftp server.
# It uses the .netrc file for the username and password for the ftp setting.
#
cd /opt/CPfw1-50-03/log
ftp -i <ip of ftp server> << HERE
binary
mput $NAME*
lcd /var/admin
put $NAME*
close
quit
HERE
-----------------------------------------------------------
cleanup
#! /bin/csh
#
# This file was created by Access 2 Networks. # The purpose of the file is to delete files that are old.
#
# The next line reads in environment variables for this session.
#
source /var/etc/pm_cshrc
setenv NAME `uname -n`
#
# The next line finds files in the /var/backup directory and
# deletes any files that are more than 5 days old.
# This is defined by the number after the +.
#
find /opt/CPfw1-50-03/log/$NAME* -ctime +1 -exec rm {} \;
-----------------------------------------------------------.netrc
machine <ipaddress> login <ftpuserid> password <password>
 
thankyou rn4it, i will test this over next couple of days amd let you know how it goes.
 
NP, I'll be on vacation starting tomorrow, gone for a week, so I might not be able to respond, but you shouldn't run into any problems. Those our scripts that I used in production, I just removed IP's addresses, user ID's and passwords. Just keep them as separate scripts. Anyone who know's *nix scripting and vi should be able to help you.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top