“My computer sometimes just runs slow,” “the fan on my laptop won’t turn off sometimes,” and “my network connection keeps dropping.” These are amongst the most annoying off problems to solve for our users because they are intermittent. And to exacerbate things, many of these users have these problems at home or at remote locations, making it difficult for systems administrators to see them.
There is something I use in these cases, though, that has helped isolate these problems from time to time. Simply tell users to Control-Option-Command-Shift-Period when they have these problems. Doing so will run the sysdiagnose command and then open a Finder window with the output of the command. Sysdiagnose takes a quick snapshot of many common logs and performance data, zips it up and opens a Finder window, pointing to where it is (/var/tmp with the filename containing a date stamp of when the command was run). This file contains output from allmemory, lsof, top, netstat, sysctl, spindump, fs_usage, system_profiler, mount, airport, odutil and many others. Each is in its own log and easy to navigate.
When running /usr/sbin/sysdiagnose from the command line there are a couple of options. My favorite is -f (which I think must be short for favorite) which allows me to write to my file to a directory I specify rather than some random object in a tmp directory. You can also get even more output using -t. Verbose logging is obtained using -h and passing a pid will also provide information about the pid. So let’s say that process 10883 is giving me some problems. I could run the following to get some good output on my desktop:
sysdiagnose -h -t -f ~/Desktop
Anyway, hope you enjoy!
krypted May 13th, 2013