Capture SMART disk status for Mac Os X

(imported topic written by tprichard)

We are looking to capture SMART drive information for out Mac TEM clients. I am able to get the info I need by using appendfile in a task to create a script that runs the diskutil command. Results are written to a text file. Then I can run an analysis that captures the data from the txt file.

I was hoping there might be a more direct route to grab the SMART info as well as the hard drive model.

I don’t have a whole lot of experience working with Mac so I thought I’d ask.

(imported comment written by NoahSalzman)

Yes, you have to do the two-step: a task that writes out the data and an analysis to read it in. We don’t currently have native inspectors to grab SMART status from drives.

Rather than appendfile, why not a simple “sh” Action with a one-liner like this:

diskutil info disk0 | grep SMART > /tmp/disk0_smart_status.txt

And then an analysis like:

(following text of first ":" of lines of file "/tmp/disk0_smart_status.txt") as trimmed string

(imported comment written by tprichard)

Thanks a lot Noah. That is a great help.

Care to comment on adding a pull of the disk0 serial number? I’m trying to use the command

system_profiler SPSerialATADataType SPParallelATADataType |grep “Serial”

In that case I get both the HD and the CD/DVD serial. I was thinking of doing that in the task and then just grabbing the first one from the txt file.