Archive
Posts in Linux
Finding orphaned RPMs on Linux hosts
If you use an RPM-based Linux distribution, you may have run into one or more cases were your system contains orphaned packages. An orphaned package is a package that doesn't have any packages that depend on it, and in a number of cases the package is no longer required for the system to function correctly. To view the list of orphaned packages on your Linux host, you can use the incredibly useful rpmorphan tool. To install it, you can fire up yum: Once installed, you can run it to view the list of orphaned packages on your system: To get additional information on what rpmorphan is doing, you can run it with the "-verbose" option…
$ read more →Wiping a hard drive with preclear_disk.sh
I recently picked up a couple of Seagate 1.5TB hard drives and based on the reviews I wanted to conduct an EXTENSIVE burn on each drive (a number of people have reported these drives suffered from the "click of death"). There are various tools to read and write data to a drive, but the most thorough tool I've found for Linux is preclear_disk.sh. Preclear writes a bunch of data to the drives, and checks to make sure the data read matches the data that was written (it writes out a special signature to assist with this). It also monitors hard drive SMART counters, and will report errors as it detects them…
$ read more →Getting an accurate view of process memory usage on Linux hosts
Having debugged a number of memory-related issues on Linux, one thing I've always wanted was a tool to display proportional memory usage. Specifically, I wanted to be able to see how much memory was unique to a process, and have an equal portion of shared memory (libraries, SMS, etc.) added to this value. My wish came true a while back when I discovered the smem utility. When run without any arguments, smem will give you the resident set size (RSS), the unique set size (USS) and the proportional set size (PSS) which is the unique set size plus a portion of the shared memory that is being used by this process…
$ read more →Getting DNS ping (aka nsping) to compile on Linux hosts
While debugging a DNS issue this week, I wanted to run my trusty old friend nsping on my Linux desktop. I grabbed the source from the FreeBSD source site, checked to make sure the bits were legit, then proceeded to compile it: Erf! The source archive I downloaded didn't compile, and from the error message it appears the function definition for dprintf conflicts with a function definition in libc. Instead of mucking around with map files, I changed all occurrences of dprintf to ddprintf…
$ read more →Getting notified when new hosts appear on your network
I had to debug an interesting network problem a few weeks back, and wanted to see when new hosts appeared on my network. While debugging the issue, I needed to find a way to get notified when a new host appeared (I didn't want to sit at a terminal reviewing the output from snoop and tcpdump). Enter arpwatch, which can be used to send alerts the first time a client issues an ARP request. This is actually quite handy, and the alerts you get my e-mail are rather useful: There are a slew of options to control who gets the e-mail, whether to use a saved packet capture instead of an active network connection, etc…
$ read more →