Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. WMI Query to get disk error count

WMI Query to get disk error count

Scheduled Pinned Locked Moved Support
1 Posts 1 Posters 12.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    B
    BillLortz
    wrote on last edited by
    #1

    Just in case it would be helpful to someone else, I'm posting the WMI Query I use to get the total number of disk errors for my hard drive.  I have a system that I stumbled on that had a disk that was failing.  I found the SMART Data was fairly useless, but Windows has a special class that gave me the data I was interested in - MSFT_StorageReliabilityCounter.  If you google it, you'll see that it has a bunch of useful info.  I decided that ReadErrorsTotal would be a good indicator of a problem drive.

    Unfortunately, the query tended to return two entries for a given DeviceID that were almost identical, so I arbitrarily chose the one that ended with the text "reliabilitycounter".  The other one on my system had some sort of SCSI Id that I wasn't sure would be consistent.  On my system without any "where" clause, the query returns 4 entries - two for DeviceId 0 and two for DeviceId 1.  I'm assuming those correspond to physical drives 0 and 1.  If you want to monitor another drive instead of 0, just change the "0" in the "Where" statement to the other drive number.  You could have multiple queries, one for each drive on your system.

    WMI.Query(root\microsoft\windows\storage,SELECT * FROM MSFT_StorageReliabilityCounter where '(DeviceId=0) AND (ObjectID like "%reliabilitycounter")',ReadErrorsTotal)

    This query returns an unsigned 64 bit integer.  I have the frequency set to 3600 seconds and 90 days of history in NetXMS.

    I hope this helps someone so that they don't have to go through hours of research to get this data, and they don't waste too much time trying to use the SMART data which declared my drive that has 4248 total read errors as perfectly fine - even though it is barely functioning.

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    Powered by NodeBB Contributors
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups