About Me

My Photo
Unix/Linux System Administrator, Backup Administrator

Saturday, August 9, 2008

system diagnostic commands (Sun Solaris)

Diagnostic Command - (Sun Solaris)
by Jeff Hunter, Sr. Database Administrator
Use the following command to obtain detailed diagnostics information about your system configuration and hardware state :
# /usr/platform/`uname -i`/sbin/prtdiag -v
It will display you:
System Configuration: Sun Microsystems  sun4u 
Memory size: 1.75GB
CPU details , I/O devices
Memory Configuration 
usb Devices 
keyboard      mouse
Environmental Status Fan Speeds:
HW Revisions 
System PROM revisions:
OBP 4.6.5 2002/06/03 16:49
POST 2.0.1 2001/08/23 17:13
Use the following command to obtain detailed system information about your Sun Solaris installation:
# /usr/sbin/prtconf
System Configuration:  Sun Microsystems  sun4u
Memory size: --Megabytes
System Peripherals (Software Nodes):
# uptime
uptime reports load averages over 1-, 5- and 15-minute intervals. Typically, load averages are divided by the number of CPU cores to find the load per CPU. Load averages above 1 per CPU indicate that the CPUs are fully utilized. A general rule of thumb is that load averages that are persistently above 4 times the number of CPUs will result in sluggish performance.
# prstatmL è Solaris 10 allows us to directly monitor the amount of time threads wait for a processor via the prstat -mL command in the LAT category
# psrinfo –v èwill provide the number of CPU and there speed

Disk I/O Components

# iostat

If a disk is more than 60% busy over sustained periods of time, this can indicate overuse of that resource. The %b iostat statistic provides a reasonable measure for utilization of regular disk resources

HD info(vendor, RPM, capacity)

# iostat –E ( it will show you the disk space size and serial number.)
The DTrace Toolkit provides a way to directly measure disk utilization via the iotop -CP command.

Disk Errors

iostat -eE reports on disk error counts since the last reboot. Keep in mind that several types of events (such as ejecting a CD or some volume manager operations) are counted in this output. Once these error messages rise above 10 in any category, further investigation is warranted.

PORT enable / disable

vi /etc/inetd.conf


To mount /root/sparc.iso file under /mnt directory.
issue the following commands.

# lofiadm -a /root/sparc.iso /dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /mnt
to unmount
# umount /mnt
# lofiadm -d /dev/lofi/1

Note: lofi = loopback file driver

To break lock on NIS server

#imp tsaini [/var/etc] >lockadm -f netgroup -b RCS

Ilom Alom Break
you are connected to the console
alom odr ilom ? standard at the t2210 is the newer ilom
where its like
set /HOST send_break_action=break
and then
start /SP/console
to enter the console
To change the DISPLAY setting in solaris.
To see your current settings and the possible settings...
# fbconfig -prconf
To change it:
# fbconfig -res video-mode -depth 8or24
Memory usuage by process

Display processes with the highest CPU utilization

# ps -eo pid,pcpu,args | sort +1n
# ps aux
ps command reports a snapshot on information of the current active processes. Advantage of ps command is that system admins will be able to see where the memory is used.
To see only the memory resources occupied by each category of processes, such as Apache httpd, MySQL mysqld or Java, use the following command:
# ps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort –nr
Sorting the output
* M : sorts the output by memory usage. Pretty handy for figuring out which version of openoffice.org to kill.
* P : sorts the process by the percentage of cpu time they are using.
* T : sorts by cumulative cpu time used
* A : sorts by age of the process, newest process first
Using split and cat to help edit large files.
# That's 10Mb
split -b 10000000 filename.txt
# makes xaa  xab  xac  xad  xae  xaf ...
# grep for what you want, edit that file with emacs
cat xaa  xab  xac  xad  xae  xaf > new1.txt
# Using wildcards with cat seems to work fine too: 
cat x?? > new2.txt
Checking whether it's running in 32-bit mode or 64-bit mode

64-bit mode

% isalist -v 
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
% isainfo -v
64-bit sparcv9 applications
32-bit sparc applications

32-bit mode

% isalist -v 
sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
% isainfo -v
32-bit sparc applications
print the version of OBP
% prtconf -V
OBP 3.3.2 1996/06/28 08:43
% /usr/platform/`uname -i`/sbin/prtdiag -v | grep OBP
OBP 3.11.1 1997/12/03 15:53   POST 3.11.4 1997/05/27 02:26
{2} ok .version
Release 3.23 Version 1 created 1999/07/16 12:08
OBP 3.23.1 1999/07/16 12:08
POST 2.0.2 1998/10/19 10:46
{2} ok 

print the version of Open Windows

% showrev -w
OpenWindows version: 
OpenWindows Version 3.6.1 25 January 1999

Examining gcc behavior

% gcc -v -x c /dev/null

Display the version of CDE

% /usr/ccs/bin/what /usr/dt/bin/dtmail
        CDE Version 1.3.4
To find out top 10 largest file/directories is taking up the most space in a /var directory/file system:
# du -a /var | sort -n -r | head -n 10
If you want more human readable output try:
# du -ha /var | sort -n -r | head -n 10
find / -size +2000 -exec ls -s {} \; | sort -nr | more
find and delete files form specific date-
/usr/bin/find /local/ftp/pub/[Aa]lgo* -type f -mtime +14 -ls -exec /usr/bin/rm -f {} \; > /tmp/cleanftp.algo.cron.log.`/usr/bin/date +\%a` 2>&1

No comments: