Solaris prtdiag output

Vikrant posted a comment on my previous post on getting hardware information in Solaris asking if I could explain the output of the prtdiag command in Solaris. Unfortunately the output varies quite a bit depending on what hardware you have, but here’s the output from my Ultra10.

$ /usr/platform/`uname -i`/sbin/prtdiag
System Configuration: Sun Microsystems sun4u Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 440MHz)
System clock frequency: 110 MHz
Memory size: 1024 Megabytes

========================= CPUs =========================

Run Ecache CPU CPU
Brd CPU Module MHz MB Impl. Mask
--- --- ------- ----- ------ ------ ----
0 0 0 440 2.0 12 9.1

========================= IO Cards =========================

Bus# Freq
Brd Type MHz Slot Name Model
--- ---- ---- ---- -------------------------------- ----------------------
0 PCI-1 33 1 ebus
0 PCI-1 33 1 network-SUNW,hme
0 PCI-1 33 2 SUNW,m64B ATY,GT-C
0 PCI-1 33 3 ide-pci1095,646
0 PCI-2 33 2 pci108e,1000-pci108e,1000
0 PCI-2 33 2 SUNW,hme-pci108e,1001 SUNW,qsi-cheerio

No failures found in System

The “System Configuration” line shows vendor and model information as well as the processor version and speed. “System clock frequency” is the bus speed on the motherboard of the system. The processor speed is typically a multiple of the clock frequency.

The “Memory size” shows the total memory in the system. On most server-class systems there is additional output to show what size memory modules are in each slot in the system. This can be very useful for determining if memory can be added or if it will need to go in place of existing chips.

The “CPU” section has detailed information on each processor in the system. Again, this is far more interesting in a larger, multi-processor system. All the processors in a machine should have identical information. I don’t believe Sun systems allow mixing different processors.

The “I/O Cards” section will have information on cards added to the system but may also list I/O devices (drive controllers etc.) built into the motherboard.

So that’s the highlights. If anyone wants to send me the prtdiag output from a larger system I’ll gladly add that here with some details.

sun, solaris, system administration, sysadmin, unix

Top 50 Local TV Commercials

The Phat Phree has compiled an impressive list of the Top 50 Local TV Commercials. These are the low budget, lower talent commercials for mom-and-pop businesses and small chains that your local television channel features late at night.

The compilation is quite impressive although the top five are all for the same business. They’re funny, but I don’t think they deserved to get all five places.

Here are a couple of my favorites.

Jhoon Rhee Taekwondo

This is really part commercial, part sing-along.

The Des Moines Renaissance Faire

I bet the announcer came with the venue.

Eagle Insurance

Just wrong.

For more of these gems including discount food, talking tamales and a number of the worst raps ever check out the whole list.

Thanks to Kirsten for pointing this out to me.

funny, commercial, local commercials, low budget

Using the find Command in Linux and UNIX

The find command allows users to do a comprehensive search spanning the directory tree. find also allows the setting of more specific options to filter the search results and when you’ve found what you’re looking for find even has the option to do some work on those files.

Finding Files by Age

What if a user wants to determine if there are any really old files on their server? There are dozens of options for the find command but the first thing find requires is the path in which to look.

In this example we will change our working directory to the / (root) directory and run the find command on the working directory by giving . as the path argument. The following command sequence looks for any files that are more than 20 years, 7300 days, old.

Finding files older than 20 years

# cd /
# find ./ -mtime +7300
# cd /tmp
# ls -ld orbit-root
drwx------ 2 root root 8192 Dec 31 1969 orbit-root

By default find prints the name and path to any files which match the criteria listed. In this case it has found a file in ./tmp/orbit-root which has not been modified in more than 7300 days.

You’ve probably noticed that the date on this file is a bit suspect. While the details are unimportant it is worth understanding that anything on a Linux system with a date of December 31, 1969 or January 1, 1970 has probably lost its date and time attributes somehow. It may have also been created at some time when the system’s clock was horribly wrong.

If we wanted to search the root directory without changing our working directory we could have specified the directory in the find command like this:

# find / -mtime +7300

The command found the same file in this case but has now described it starting with / instead of ./ because that is what was used in the find command.

The following command sequence will look for some newer files. The process starts in the user’s home directory and looks for files less than three days old.

Finding Any Files Modified in the Past 3 Days

$ cd ~
$ find . -mtime -3.

Now we start to really see the power of the find command. It has identified files not only in the working directory but in a subdirectory as well! Let’s verify the findings with some ls commands:

$ ls –alt
total 56
drwxrwxr-x 2 tclark authors 4096 Feb 3 17:45 examples
-rw------- 1 tclark tclark 8793 Feb 3 14:04 .bash_history
drwx------ 4 tclark tclark 4096 Feb 3 11:17 .
-rw------- 1 tclark tclark 1066 Feb 3 11:17 .viminfo
-rw-rw-r-- 1 tclark tclark 0 Feb 3 09:00 example1.fil
-rw-r--r-- 1 tclark authors 0 Jan 27 00:22 umask_example.fil
drwxr-xr-x 8 root root 4096 Jan 25 22:16 ..
-rw-rw-r-- 1 tclark tclark 0 Jan 13 21:13
-rw-r--r-- 1 tclark tclark 120 Aug 24 06:44 .gtkrc
-rw-r--r-- 1 tclark tclark 24 Aug 18 11:23 .bash_logout
-rw-r--r-- 1 tclark tclark 191 Aug 18 11:23 .bash_profile
-rw-r--r-- 1 tclark tclark 124 Aug 18 11:23 .bashrc
-rw-r--r-- 1 tclark tclark 237 May 22 2003 .emacs
-rw-r--r-- 1 tclark tclark 220 Nov 27 2002 .zshrc
drwxr-xr-x 3 tclark tclark 4096 Aug 12 2002 .kde
$ cd examples
$ ls -alt
total 20
drwxrwxr-x 2 tclark authors 4096 Feb 3 17:45 .
-rw-rw-r-- 1 tclark tclark 0 Feb 3 17:45 other.txt
-rw-rw-r-- 1 tclark authors 360 Feb 3 17:44 preamble.txt
drwx------ 4 tclark tclark 4096 Feb 3 11:17 ..
-rw-r--r-- 1 tclark authors 2229 Jan 13 21:35 declaration.txt
-rw-rw-r-- 1 tclark presidents 1310 Jan 13 17:48 gettysburg.txt

So we see that find has turned up what we were looking for. Now we will refine our search even further.

Finding .txt Files Modified in the Past 3 Days

Sometimes we are only concerned specific files in the directory. For example, say you wrote a text file sometime in the past couple days and now you can’t remember what you called it or where you put it. Here’s one way you could find that text file without having to go through your entire system:

$ find . -name '*.txt' -mtime -3

Now you’ve got even fewer files than in the last search and you could easily identify the one you’re looking for.

Find files by size

If a user is running short of disk space, they may want to find some large files and compress them to recover space. The following will search from the current directory and find all files larger than 10,000KB. The output has been abbreviated.

Finding Files Larger than 10,000k

# find . -size +10000k

Similarly a – could be used in this example to find all files smaller than 10,000KB. Of course there would be quite a few of those on a Linux system.

The find command is quite flexible and accepts numerous options. We have only covered a couple of the options here but if you want to check out more of them take a look at find’s man page.

Most of find’s options can be combined to find files which meet several criteria. To do this we can just continue to list criteria like we did when finding .txt files which had been modified in the past three days.

Easy Linux CommandsFor more tips like this check out my book Easy Linux Commands, only $19.95 from Rampant TechPress.

Buy it now!

Easy Linux Commands: Book Review 3

Robert Vollman has now posted a review of my book Easy Linux Commands on Amazon.

He makes many good points but one I keep hearing from just about everyone is that almost all of the content of Easy Linux Commands can be applied on other UNIX and UNIX-like systems.

Here is Robert’s full review:

My shelf is full of technical books on a variety of topics, including Linux. But there have been times when someone new to the IT world will ask me for a book to get them started in a particular area. Alas, most of my books are thousand-page, exhaustively-detailed volumes that would be so inaccessible that the only use a beginner could get out of it would be to kill a few spiders.

But now, thanks to Jon Emmons and Terry Clark, I finally have a book I can give a young student, or a previously “Windows-only” PC user. “Easy Linux Commands” is just what it claims to be: an easy introduction to the command-line world.

Being easy to read and accessible is this book’s chief selling point. The book is not only under 200 pages, with lots of pictures, big text and barely 30 lines per page, but it’s also structured in the exact same familiar fashion as countless other books. Furthermore, I don’t find the author’s style overly technical. His writing style is very informal and almost conversational. Judge for yourself by visiting his blog “Life After Coffee,” where he occasionally includes excerpts from the book. In fact, if something is not clear, Jon Emmons is very accessible and answers questions quickly and happily.

Also notice that I said this books introduces you to the command-line world, not Linux. I said that for two reasons:
1. Almost everything in this books applies equally well to Unix. Very little in this book is actually Linux-specific.
2. Even though Linux has graphical user interfaces, like Gnome and KDE, this book covers command-line Linux only.

One word of caution. Don’t be thrown by the “Become a Linux Command Guru” picture stamped on the front cover. You won’t be a guru. This covers the basics, and only a little more. But this book will get you past square one and allow you to use some of those big books for becoming a guru (instead of an exterminator).

Easy Linux CommandsCheck out my book Easy Linux Commands, only $19.95 from Rampant TechPress.

Buy it now!

linux, book

How to reset a lost Oracle Enterprise Manager password

Below documents how I was able to reset the ias_admin password for an Oracle Application Server 9i instance. This may or may not work on other versions or products. If in doubt, check with support.

Oracle’s Enterprise Manager Web Site will enforce use of the current Administrator (ias_admin) password when you log in to Enterprise Manager, stop the Enterprise Manager Service, or change the ias_admin password. If you have forgotten your ias_admin password then you must reset it using the following procedure while you are logged on to your system as the person who installed Oracle Application Server:

1. Edit the following file and locate the line that defines the credentials property for use the ias_admin user:


The jazn-data.xml with the credentials entry in boldface type:



2. Remove the entire line that contains the credentials property from jazn-data.xml.

3. Set a new password with emctl set password reset new_password

I hope this helps if folks have this same problem, but as I mentioned above, mileage may vary. If you’re unsure, check with support.

oracle, application server, oas