Tuesday, March 26, 2013

Basic monitoring commands for solaris SUN 5.10

Hey Friends,

Please find some basic commands which may come in your use while extracting resource status of the server, details of the sun server. These commands can be collected and put together to run simultaneously in a script and append the o/p to a file. which can be read easily later.

below append shows the symbol of two "GREATER THAN SIGN" so please use those sign in two numbers. as i tried to show but it changed to any code. sorry for the inconvinience caused.



#sar 2 5 append /tmp/logs.txt :- SAR is a utility to provie information about system performance.
#sar -mu 2 5 append /tmp/logs.txt :- it will provide detail about current CPU usage
#/usr/sbin/prtdiag -v append /tmp/logs.txt :- prtdiag will show complete hardware details, like CPU, MEMORY, Serial Number, Firmware, OBP, etc.
#/usr/sbin/prtconf |grep -i "Memory" append /tmp/logs.txt :- it will extract Hardware config information. here we are extracting only Memeory detail with grep.
#vmstat 2 5 append /tmp/logs.txt :- It provide current usage of memory detail.
#psrinfo -p append /tmp/logs.txt :- it carries information about processor. -p will show number of socket.
#prinfo -pv append /tmp/logs.txt :- it will show -p socket -v virtual CPU.
#/usr/sbin/prtdiag -v append /tmp/logs.txt :- detailed hardwareinformation.
#ps -ef |grep -i ora append /tmp/logs.txt :- ps command is to check the process. to check if it is running or not
#sar -d 2 5 append /tmp/logs.txt :- to check the server disk utilization currently.
#ps -ef |grep -i scx append /tmp/logs.txt :- it is to check if SCOM agent is running or not.
#uname -a append /tmp/logs.txt :- it gives details about OS version installed.
#hostname append /tmp/logs.txt :- the hostname of the server.
#uname append /tmp/logs.txt :- the solaris OS
#cat /etc/release append /tmp/logs.txt :- it will show the release of SUN OS.
#/usr/sbin/top append /tmp/logs.txt :- top is a utility to shows you current CPU, Memory, SWAP usage.
#top append /tmp/logs.txt
#/usr/bin/zonename append /tmp/logs.txt :- will show whether the server is physical or VM. if the o/p comes global then  it is physical
#cat /etc/resolve.conf append /tmp/logs.txt :- it will show the DNS name of the server. i.e. where the server is going to get resolved.

all above commands can be put together in /tmp and any directory. giving executable rights only. it will extract the infomration and put it under tmp file logs.txt

to create a script file :-

#touch logs.sh
or
$touch logcollector.sh
$
now open the same file in vi editor and insert all below lines. and the save and quit with :wq!

uname -a append /tmp/logs.txt
hostname append /tmp/logs.txt
uname append /tmp/logs.txt
cat /etc/release append /tmp/logs.txt
/usr/bin/zonename append /tmp/logs.txt
cat /etc/resolve.conf append /tmp/logs.txt
sar 2 5 append /tmp/logs.txt
sar -mu 2 5 append /tmp/logs.txt
/usr/sbin/prtdiag -v append /tmp/logs.txt
/usr/sbin/prtconf |grep -i "Memory" append /tmp/logs.txt
vmstat 2 5 append /tmp/logs.txt
psrinfo -p append /tmp/logs.txt
prinfo -pv append /tmp/logs.txt
/usr/sbin/prtdiag -v append /tmp/logs.txt
ps -ef |grep -i ora append /tmp/logs.txt
sar -d 2 5 append /tmp/logs.txt
ps -ef |grep -i scx append /tmp/logs.txt
/usr/sbin/top append /tmp/logs.txt
top append /tmp/logs.txt
echo |format
raidctl |more
and then run the script, it wil collect all required information in a while and you can read or get the desired information.

Love Sharing
Amit Chopra

No comments: