Core Related Server Scripts

This is a page for scripts having to deal with core files in the var directory

coreview.sh

This will produce a summary of age, user, IP address from core.* files

#coreview.sh
#
# 2004 10 25 ghavin
#  posted first rev of script to GoA forum
#
# 2004 11 02 tolip
#  first shot at grabbin user data from core files
#
# 2004 11 07 tolip
#  I changed output filenames from core.* to coreview.* to avoid them in the parsing of core.*
#  cleaned up the user data search a bit, 
#  still needs redundancy removed from each core section

ls -C1 -t /usr/local/games/plServers/var/core.* > cores.lst
echo "Begin core list:" > coreview.txt
for core in `cat cores.lst`; do
  ls -l -h -1 $core >> coreview.txt
  strings $core|head -20|grep -i "Game_Server" >> coreview.txt

# the following will grab the name and IP address of the user if it is in the core file (see below)
# the sed thingy just replaces the comma and semi-colon with newline to make small strings from big ones

  strings $core | sed 's/,\|;/\n/g' |grep -U --file=coreview.search.strings.txt >> coreview.txt

  echo >> coreview.txt
done
rm cores.lst

# the following lines use less to display the file
less coreview.txt

# The above script relies on a file with the search strings in it (see below)
# assumes the existance of coreview.search.strings.txt
# in this file are the patterns of interest, season to taste
# to look for a specific user or IP address just append correct data to correct string

#coreview.search.strings.txt should not contain words with spaces
# uncomment the strings u want in your search
# the strings file should only contain the words of interest no extra comments


#SSH_CONNECTION=               
#PlayerID=          
#SrcAddr=
#Acct:
#ERR

CoreRelatedScripts (last edited 2008-12-27 16:35:30 by localhost)