email SMART attributes

  • Hello all,


    Currently I log on my OMV once in a while just to take a look at the SMART attributes of my disks (not talking about tests, just look at information like 5 (reallocated sectors count), 7, 196, 197 etc).


    Is there a way to automate this so my OMV would send me an email every day for example with these values ? Again I do not want to do selftests etc, just a quick peek at the SMART values.


    Also, why is there no 187 and 188 (reported uncorrectable errors and command timeout) ?


    Thanks

    • Offizieller Beitrag

    Is there a way to automate this so my OMV would send me an email every day for example with these values ?

    You can write a small script which is writing the SMART values in a files and sends you the file by e-mail. You can run the script as scheduled job.
    Something like this:


  • Please, sane temp file handling and no hardcoded device paths :)

  • What's wrong with hardcoded paths?


    They can change. If you're interested in SMART data from every connected disk then simply query every connected disk (using the /dev/sd? regex in Linux). Hardcoded paths are always wrong especially in some scripts or cron jobs. You add a disk, forget to adjust all the paths here and there, feel save since 'monitoring active' and then hell breaks loose and you realize problems with your disk only since it failed.


    At one former customer they configured paths to be backed up in a hard coded way. Then something changed and the share containing the most recent data wasn't covered any more. Since the IT department outsourced everything to IBM they didn't test restores and then they rolled out a nice script that started to recursively delete all the share's contents in certain situations. Guess how surprised they were realizing that the entire media production of a whole month (9555 product images they needed for all advertisements accross Europe -- this agency did/does everything for both MediaMarkt and Saturn) was simply lost.


    TL;DR: don't use hard coded paths ;)

  • Awesome ! It works flawlessly I created the script with nano and used mv to move it to bin, I added it in my scheduled jobs to run every week that's perfect thanks !


    When I checked the smart errors I only had some (about 15) on my system drive, and all were ABRT; it seems that each time I go look at this drive attributes it records that error because I checked the tab 4 times today and it reported 4 errors, each at the time I checked. Drive otherwise does not show any other problem (raw values for 5, 7, 196, 197, 198, 199 are all 0).

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!