Command to show top ten CPU users on the system
# UNIX95= ps -e -o "vsz pcpu ruser pid stime time state args" sort -rn head -10
To get Yesterday
perl -e '$yesterday = localtime(time-24*60*60),print "$yesterday\n"'
perl -e '$yesterday = localtime(time-86400),print "$yesterday\n"'
perl -le 'print scalar localtime time - 86400'
Disk related Stuff
######### To find out from which disks OS booted From #########
#echo boot_string/s adb /stand/vmunix /dev/kmem
######### To find out if there are Stale in LVs #########
# /usr/sbin/vgdisplay -v awk '/LV Name/ { print $3 }' xargs /usr/sbin/lvdisplay -v grep -i -e "lv name" -e "lv status" -e stale -e '?'
######### To find out timestamp when the kernel was built/linked #########
# echo "linkstamp?s" adb /stand/vmunix
######### To get the LVM PVID and VGID from a disk #########
To get the LVM PVID and VGID from a disk. Please note that each unique ID consists of 2 longs (2 x 4 Bytes). The 1st long is a host ID (uname -i) and 2nd long is a timestamp. So the PVID tells you when some issued a pvcreate from what machine. The VGID does the same for the vgcreate.
PVID e.g::
# echo "0d8200?UY" adb /dev/dsk/c0t6d0
2008: 2010702141 2002 Jan 2 10:31:16
VGID e.g.:
# echo "0d8208?UY" adb /dev/dsk/c0t6d0
2010: 2010702141 2002 Jan 2 07:29:06
######### To get free space (Size in MB ) on all Volume Groups in a system #########
/usr/sbin/vgdisplay egrep -i 'VG NamePE SizeFree PE' awk 'BEGIN {print "VGname Free_space(MB)"} {a=$NF;getline;b=$NF;getline;c=$NF;print a,b*c}'
######### To get man pages in printable format #########
# man ls col –b ssp expand
CSTM/STM Stuff
####CPU boards:####
echo "selclass qualifier cpu;info;wait;infolog" /usr/sbin/cstm
####LAN cards:####
echo "selclass qualifier lan;info;wait;infolog" /usr/sbin/cstm
####Memory:####
echo "selclass qualifier memory;info;wait;infolog" /usr/sbin/cstm
####Disks:####
#echo "selclass qualifier disk;info;wait;infolog" /usr/sbin/cstm
#echo "selclass qualifier cpu;info;wait;infolog"cstm > /tmp/cpu.info
#echo "sel path system\ninfolog\nexit"cstmgrep "System Serial Number"
# echo "selclass type disk;info;wait;infolog" /usr/sbin/cstm grep "Serial Number"
How to check if largefiles are set
# mkfs -F vxfs -m /dev/vgxx/lvolx
# fsadm -F hfs /dev/vgxx/lvolx (hfs filesystem)
# fsadm -F vxfs /mountpoint
moving disk across system ( Old Method for LVM1.0) my old page ;-)
vgexport -p -v -m plan_map /dev/vgXX (Preview)
vgexport -v -m plan_map /dev/vgXX
add the disk
ioscan -fnC disk
cd /
mkdir /dev/vgXX
cd /dev/vgXX
mknod /dev/vgXX/group c 64 0xNN0000
vgimport -p -v -m plan_map /dev/vgXX /dev/dsk/c0t0d0…..(Preview)
vgimport -v -m plan_map /dev/vgXX /dev/dsk/c0t0d0…..
One Liner
######Remove control-M's from a windows text file.######
cat $1 tr -d "\015"
######To strip out unprintable characters from a file.######
#cat myfile tr -Acd "[[:print:]][\012]" > newfile
######Remove control-M's from a windows text file.######
cat $1 tr -d "\015"
######Error Code Library.######
/usr/include/sys/errno.h
######Shows LV Status and Stale PEs on LV######
# /usr/sbin/vgdisplay -v awk '/LV Name/ { print $3 }' xargs /usr/sbin/lvdisplay -v \ grep -i -e "lv name" -e "lv status" -e stale -e '?'
######CPU Speed.######
#echo itick_per_usec/D adb -k /stand/vmunix /dev/kmem
######you can check the fs_async paramater with.######
echo "fs_async/D" adb -k /stand/vmunix /dev/kmem
######Shows OS install date######
#swlist -a install_date -l product grep -i os-core
######From which Disk system BootED.######
# echo "linkstamp?s" adb /stand/vmunix
######lsof ######
# # lsof +aL1 /tom
######Man Page Reformat.######
# # man ls col –b ssp expand
######Use adb to query the kernel for the size of physical memory.######
# echo phys_mem_pages/2d adb /stand/vmunix /dev/kmem ( For 11.23)
# echo phys_mem_pages/D adb -k /stand/vmunix /dev/mem (For 11.11)
# echo physmem/D adb -k /stand/vmunix /dev/mem (For 10.x) b. multiply output of adb by 4096 to get the size of RAM.
# To see large file support f_flag: 16 large files are activated f_flag: 0 large files are inactive # /usr/sbin/fstyp -v /dev/vgxx/lvolxgrep f_flag
########## Script to get CSTM version from multiple servers ######
# echo "selclass qualifier cpu;infolog" /usr/sbin/cstm grep Version
# remsh 'echo "exit" /usr/sbin/cstm grep "Version "'
# remsh remotesys '/usr/sbin/cstm < /dev/null' grep "^Version"
Create a new software depot for patches
Creating a separate software depot for your patches is useful, when space is tight and patches have dependencies.
Assuming you have two patches PHNE_20000 and PHNE_20001. unshare all two patches by typing the following commands.
sh PHNE_20000
sh PHNE_20001
Next, we have to create a new software depot on the directory
/newdir/depot
mkdir /newdir/depot
swpackage -s PHNE_20000.depot -d /newdir/depot
Register your new depot on the sd-ux.
swreg -l depot /newdir/depot
Copy the next patch to the newly created software depot.
swcopy -s `pwd`/PHNE_20001.depot PHNE_20001 @ /newdir/depot
You are now ready to install your patches
swinstall -s /newdir/depot
And Villagers were
happy ever after....
No comments:
Post a Comment