Re: smartd's email notifcations
Christian Franke <[email protected]>
| Newsgroups | gmane.linux.utilities.smartmontools |
|---|---|
| Message-ID | <[email protected]> |
Sven Köhler wrote: > Hi, > > configuring email notifications of smartd is a pretty unpleasant > experience, I have to say. I'm still not sure that I've got it right, > and I'm not even sure whether smartd supports what I want. > > In smartd, I currently have > -m root -M daily -H -t -l error -l selftest -R 5! -R 187! -W 2,45,50 > > And smartd is started with -s /var/lib/smartd to make the states > persistent across reboots and restarts of smartd. > (BTW: State persistence makes so much sense to me that it should be > enabled by default, IMHO.) Do you build smartmontools from source? If yes, simply add ./configure options --with-savestates or --enable-savestates. If not, ask the package maintainer to do this :-) > Do I have to specify -U 198 to get emails about offline sectors? The > documentation claims that -U 198 is the default. So I hope I'll get emails. Yes, but note that the HDD may not set this attribute as expected. > In addition, I want to get an email whenever the reallocated sector > counter increases (that's why I have -R 5!). But until recently, I > didn't have -M daily in smartd.conf and -M once was the default, > apparently. If state persistence is enabled, -M daily is the default since smartd 5.42, see man page. > So I got exactly one email from smartd saying the counter > increased. I never got a second or even a third email, even though the > counter continued to increase. > > So I added -M daily, but the documentation says that -M daily means that > I get daily reminder emails. My interpretation is that once the > reallocation sector count has increased, I get one mail per day forever > - even if it does not increase further. That would be less than ideal, > to be honest. A mail is sent when smartd logs the corresponding LOG_CRIT messages to syslog, but only if the last message of this type was sent more than one day before. This means that daily reminder mails will be sent for error states (like SMART failure, over temperature) which persisted. In case of an event (attribute change), no reminder is sent later because there is no syslog message. > Sure, reminder emails make sense for certain things (like failing > attributed, non-zero offline sector count). But they don't make sense > for other things (like reallocated sector count). > > Is there any way to tell smartd to send an email whenever the > reallocated sector count changes - and only if it has changed since the > last email? No. You need to parse the LOG_CRIT level messages in syslog: "... SMART Prefailure Attribute: 5 Reallocated_Sector_Ct changed ... " Regards, Christian ------------------------------------------------------------------------------