Sunday, May 18, 2008

Some useful links and scripts ...

http://java.sun.com/javase/6/webnotes/trouble/other/matrix6-Unix.html has some very useful info on how to debug java applications deployed on Linux/Unix.

Also, here is a little script which would dump all system stats as well as stats for processes owned by user -


#!/bin/sh

TERM=vt100
export TERM

LOGDIR=./

time=$(date)
min=${time:14:2}
today="`date +%m%d%y`"

FNAME=$LOGDIR/$today
# echo $FNAME
# exit 0
touch $FNAME

echo "______________________________________________________" >> $FNAME
echo " $time" >> $FNAME
echo "______________________________________________________" >> $FNAME
echo "**************** TOP *******************************" >> $FNAME
top -b -n 1 >> $FNAME

#
# Get every socket out there, resolve IP addresses, and print which
# process has that socket open
#
echo "**************** NETSAT *******************************" >> $FNAME
netstat -ap >> $FNAME
echo "**************** Process Status *******************************" >> $FNAME
ps -auxww >> $FNAME

#
# How much memory are the processes using? This will be a percentage
# of the total.
#
echo "**************** Process MEMORY Consumption ************" >> $FNAME
ps aux | awk '{sum +=$4}; END {print sum}' >> $FNAME

#
# A busy system will have the kernel use up a lot of memory. But, the
# +/- buffers/cache entry should show free buffers if not, then we have
# memory issues.
#
echo "**************** FREEMEM *******************************" >> $FNAME
free >> $FNAME

echo "****************************************************" >> $FNAME

#
# Get all the processes and then find their open sockets.
#
#
echo "**************** OPEN SOCKETS ***************" >> $FNAME
/usr/sbin/lsof -p `ps -u root -opid | grep -v PID | awk 'sub(/^[ \t]+/, "")' | awk '{ str1=str1 $0 "," }END{ print str1 }'` >> $FNAME
echo "****************************************************" >> $FNAME

echo " $time" >> $FNAME
echo "**************** END *******************************" >> $FNAME
echo "****************************************************" >> $FNAME
exit 0


Tuesday, March 25, 2008

Couple of linux commands/scripts that came in handy ...

Here is on to get a listing of the all the files stored in one or more tar files.

for i in *.tgz; do tar -xvzf $i; done > a.txt

Here is one to count the number of files in a folder:

ls -al wc -l

e.g. ls -al a* wc -l

Tuesday, February 19, 2008

Looking at Server, Application and Network Management ...

A relatively new territory to me for the most part.

The only big names that came to me are:
-Tivoli (now a part of IBM)
- Computer Associates Unicenter
- Nagios - Open Source!

Researching some more on some of the prominent players (as per the various internet search engines). In no particular order:
* Nagios
* ZenOSS
*Hyperic
* BixData
*GroundWorks

More on this topic to follow ...