Blog O' Matty


Quieting the shell during login sessions

This article was posted by Matty on 2007-06-09 14:53:00 -0400 -0400

Most of the Solaris systems I access through an SSH shell session display a bunch of cruft (e.g., do you have mail?, etc.) when I login. To reduce the amount of chatter, I recently created a .hushlogin file in the home directory of each server I support:

$ touch HOME/.hushlogin

When this file is present, the logic in /etc/profile will limit what is displayed. Niiiiiice!

All Solaris core files are not created equally!

This article was posted by Matty on 2007-06-09 14:49:00 -0400 -0400

While playing around with the Solaris process.max-core-size resource control last week, I noticed some interesting behavior. If you set the system wide maximum size of a core with projmod:

$ projmod -sK “process.max-core-size=(privileged,1048576,deny)”
system**

and then attempt to generate a core file:

$ su - test

$ ./coreme 2097152 &
Calling malloc() to allocate 2097152 bytes of heap space [1] 2641

$ kill -ABRT 2641

The core file that is produced will match the value of the resource control:

$ ls -la core
-rw——- 1 test other 1048576 May 22 14:29 core

Now the interesting part. If you have global core file support enabled, the size of the core file written to the global core file directory is not limited in size:

$ ls -al /var/core

total 6692 drwxr-xr-x 2 root root 512 May 22 14:29 . drwxr-xr-x 44 root sys 1024 May 22 14:28 .. -rw——- 1 root root 3411254 May 22 14:29 core.coreme.2641

This is definitely something to watch out for, and it was a complete surprise to me.

Accessing webdav shares from the command line

This article was posted by Matty on 2007-06-09 11:40:00 -0400 -0400

I have been using webdav as a centralized storage system for a the past year or so. I typically use the OS X built-in DAV support, but recently needed to be able to access my DAV share through the shell. After a bit of poking around on the web, I came across the cadaver command line DAV client. Cadaver is pretty slick, and operates very similar to an FTP client. You can use ls to view files, delete to delete files, and put to place files in a DAV share. To use cadaver, you can execute it with the share you want to access:

$ cadaver http://localhost:8080/dav

Once you are connected, you can feed one or more commands to the cadaver prompt:

dav:/dav/> ls 404 Not Found Listing collection `/dav/': collection is empty.

dav:/dav/> put orca-snapshot-r529.tar Uploading orca-snapshot-r529.tar to `/dav/orca-snapshot-r529.tar’: Progress: [=============================>] 100.0% of 262 bytes succeeded.

dav:/dav/> ls Listing collection `/dav/': succeeded. orca-snapshot-r529.tar 10045440 Jun 7 13:27

dav:/dav/> move orca-snapshot-r529.tar orca.tar Moving /dav/orca-snapshot-r529.tar' to /dav/orca.tar’: succeeded.

dav:/dav/> ls Listing collection `/dav/': succeeded. orca.tar 10045440 Jun 7 13:30

dav:/dav/> delete orca.tar Deleting `orca.tar’: succeeded.

Cadaver is a cool piece of software, and one that I will be using frequently!!

Monitoring Linux server performance with nmon

This article was posted by Matty on 2007-06-06 20:21:00 -0400 -0400

I recently came across Nigel’s monitor (nmon), which is an awesome text-based tool for visualizing a variety of CPU, memory, network and kernel performance data on Linux hosts. Nmon can be be run the without any arguments to display a base screen with CPU performance counters, or you can export the NMON environment variable with a list of performance counters you want displayed (you can also enable additional performance counters by typing the key that corresponds to the counter in the nmon display):

$ export NMON=cnDVk

$ ./nmon_x86_fedora5

Once nmon fires up, you will be greeted with a screen similar to the following:

Nmon performance monitor

Nmon is a great piece of software, and I am hopeful more distributions will include it in the future.

Solaris SMART support is finally becoming a reality!!

This article was posted by Matty on 2007-06-06 20:05:00 -0400 -0400

A while back I wrote a blog entry about the lack of SMART support in Solaris. Just recently, Eric Schrock added a FMA disk-transport diagnosis engine, which provides generic SMART monitoring as part of the base operating system. The disk-transport diagnosis engine currently only supports SATA disk drives, but SCSI support is right around the corner! This is exciting news, and I am stoked that SMART support is finally becoming a reality!!!!