Parsing Mac OS X System Profiler
Posted: February 4, 2011 Filed under: Deployment, Hardware, Mac OS X, Mac OS X Server, Scripting, Unix | Tags: Apple Remote Desktop, ARD, Asset Collection, Facter, hardware, parse, plist, Puppet, report, sysinfocachegen, System Profiler, system_profiler 3 Comments »It is pretty cool how Apple System Profiler has a command line equivalent (system_profiler). And it is pretty cool how system_profiler has a -xml option to allow for easier parsing. You might use this info for extracting asset information into a database or for puppet facter facts.
However if you’ve ever looked at that xml, you know that it is a tree full of unpredictable semi-structured data that was designed specifically for the GUI app. So even though you can parse it with your favorite plist parser, there is still a lot more work to do to get to the data you care about.
The tree structure is nice for a browsing through on a single machine, but not so good for reporting across many machines.
Apple stores most of the same data as key value pairs in its database for ARD reporting, but they do a lot of massaging of the data to get it that way.
It is possible to get at this data in an ARD database if you have an ARD collection server, but an ARD collection server isn’t for everyone and doesn’t serve every use case.
You can still get at the nicely formatted ARD information. ARD client includes a tool that outputs most, if not all of the asset information you care about in a much nicer structured format for reporting.
The tool is called sysinfocachegen and you use it like this:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/sysinfocachegen -p /tmp/com.yourorganization.systeminfo.plist
Just use your favorite language’s plist parser to read the plist.
Troubleshooting Firewire Drives
Posted: March 3, 2009 Filed under: Hardware | Tags: case, drive, fan, firewire, hard drive, hot, intermittent, lacie, overheating, western digital Leave a comment »If your firewire hard drive is failing intermittently or after transferring some data, it could be a heat issue. Symptoms might include i/o errors and spontaneous disconnects.
Simply removing the case (housing) from my Western Digital MyBook drive allowed it to work reliably enough to get all of the data off. I might continue to use it that way since it hasn’t failed since removing the housing.
I’ve seen this issue with LaCie cases as well. They get extremely hot and are prone to failure, especially if the case does not have a fan and the drive is used continuously for long periods of time, such for backups.
If you need to use a firewire drive for backup, I would invest in a good case with a fan if possible.