Re: smartd's email notifcations
Sven Köhler <[email protected]>
| Newsgroups | gmane.linux.utilities.smartmontools |
|---|---|
| Message-ID | <[email protected]> |
Am 09.11.2014 um 19:33 schrieb Christian Franke: > 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 :-) I'm using Gentoo. So yes, it's built from source. I will have a look at the configure parameter the package maintainer chose and then I will ask the maintainer to fix this shortcoming of the package. >> 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. Do you mean "Yes, I have to specify it to get emails." or "Yes, I get the emails without specifying it" ? If I have to specify it to get mails, then why does the man-page state that -U 198 is the default? Usually, one does not need to specify something that is default. If you mean something else (for example that 198 is the attribute chosen by most manufacturers), then the man-page of smartd.conf should be reworded to reflect that. (the same holds for the -C option) One of the annoying things is that I can't test my smartd configuration (or at least I don't know how) without having a failing harddisk at hand, so I rely on the man-page to be as clear as possible. >> 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. Right, I should have specified that I didn't have state persistence enabled. >> 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. So when attribute 5 changes within the first 24 hours after the email, then I won't get an email at all about the events that happened within these 24 hours? Note that I have -R 5!, so to my understanding there will be LOG_CRIT messages. > 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. And if there were syslog message within the first 24 hours after the email was sent? In my case: At 2am today, reallocated sector count increased which triggered an email. I already know that it increased even further from looking at the syslog. So you're saying there will not be another email tomorrow at 2am? >> 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 ... " It's a pity that this isn't supported. Regards, Sven ------------------------------------------------------------------------------