About Me

Freelance web developer, network engineer, and graphic artist based out of Chapel Hill, NC

Latest Articles

Solaris Fixing Windows MySQL Intro

Listening to

Another Day in the Clouds
Cardamar

Reading

Eaters of the Dead
Michael Crichton

Featured Images

Interesting Links

xkcd The Penny Arcade Andrawes Photography

Struggling with Solaris

To save a static route, add it to /etc/init.d/inetinit:
route add net 10.8.0.0 -netmask 255.255.0.0 -gateway 10.1.1.17

CPU Loads without the 'top' command

This mpstat command will display the cpu loads at 5 second intervals, 2 times:
# mpstat 5 2 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 63 4 58 19 5 128 2 6 2 0 179 1 2 2 94 1 54 5 70 2136 1122 135 2 5 2 0 185 1 5 2 91 CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl 0 0 0 2 13 5 102 0 2 0 0 104 0 1 0 99 1 1 0 1 2078 1073 134 0 1 0 0 16 0 0 0 100 #
To view the processes that are hogging up your cpu, use the prstat command:
# prstat -s cpu -n 5 PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 79 root 3904K 2752K sleep 0 0 0:00.00 0.1% picld/7 1814 root 1704K 1472K cpu1 43 0 0:00.00 0.0% prstat/1 61 root 2296K 1520K sleep 50 0 0:00.00 0.0% syseventd/12 145 root 2304K 1192K sleep 58 0 0:00.00 0.0% rpcbind/1 172 root 1112K 680K sleep 0 0 0:00.00 0.0% keep_sshd_alive/1 Total: 104 processes, 224 lwps, load averages: 0.00, 0.00, 0.01 #
to see whos doing what on the system:
# w 4:05pm up 22 day(s), 20:55, 129 users, load average: 3.90, 3.15, 1.99 User tty login@ idle JCPU PCPU what bishop pts/1 26Mar07 9days 1 ssh -l root 10.8.100.111 hudson pts/2 26Mar07 26:55 2:32 2:31 ssh -l root 10.8.100.113 ripley pts/7 26Mar0714days -tcsh hicks pts/3 26Mar07 7days 13:28 9:31 -tcsh
to see what ports are open or being used:
netstat -a | grep LISTEN tcp 0 0 *:21 *:* LISTEN udp 0 0 *:69 *:* LISTEN tcp 0 0 *:23 *:* LISTEN tcp 0 0 *:5920 *:* LISTEN

Adding new disks

dmesg
devfsadm -v
fsck /dev/rdsk/<disk>
mount /dev/dsk/<disk> <mountdir>