in reply to Re: SMART info from drives in win32 using WMI
in thread SMART info from drives in win32 using WMI

Thanks for the reply, but Dumper doesn't provide me with anything useful; if I replace the last part of the code with
my $DriveCollection = $WMIServices->InstancesOf("Win32_DiskDrive" ); foreach my $Drive ( in( $DriveCollection ) ) { print Dumper $Drive; print $Drive->{'Status'}; }
I get a huge dump of a data structure and then the text 'OK' -the property 'Status' is documented in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_diskdrive.asp but not hinted at anywhere in the Dumper output. I can't find a corresponding page for querying SMART info, hence my question.

Replies are listed 'Best First'.
Re^3: SMART info from drives in win32 using WMI
by McDarren (Abbot) on May 17, 2006 at 14:05 UTC
    Well, again let me point out that I know next to nothing about WMI, so I could be very well just blowing air out my rear-end here. However, looking at that "link" you gave I see the following:
    For IDE, this polling consists of sending the READ_SMART_STATUS comman +d. If this status indicates an error, a WMI event will be launched th +at includes the SMART attribute data.

    It doesn't actually specify what is returned in the absence of an error. Your reply infers that print $Drive->{'Status'}; produces 'OK' ...could it be that this is the entirety of the status?

    Cheers,
    Darren :)

      Oops, I mistyped
      MSStorageDriver_FailurePredictData
      (wrote 'MMStorage...'). Anyway, the
      $Drive->{'Status'}
      post was an example of pulling data from one of the data structures. Note, however, that the query is on
      Win32_DiskData
      which doesn't contain SMART info. I've looked at a header file (wmidata.h) in the MS DDK and gleaned a couple of the properties that the data stucture should have (SelfTestStatus, TotalTime + others). However, I can't even get that to work. Perhaps this is too win32 specific, but I can't figure out where else to ask about it. Besides, I'd hoped somebody had a clever answer about figuring out which attributes could be found. Thanks for the help though. Dumper will probably come in handy later :-p

        The quoted documentation says (or at least implies) that it only sends SMART info if a "failure" is detected (and waiting for SMART to decide something has failed is what makes it mostly useless, as I recently noted).

        - tye