Re: smartd's email notifcations
Christian Franke <[email protected]>
| Newsgroups | gmane.linux.utilities.smartmontools |
|---|---|
| Message-ID | <[email protected]> |
Sven Köhler wrote: > Am 09.11.2014 um 19:33 schrieb Christian Franke: >>> 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" ? The latter. The man page is correct, IMO. > 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. As usual: SHTDI [1] :-) https://www.smartmontools.org/newticket >>> 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. There will be LOG_CRIT messages for each event, but the corresponding mail is disabled for 24 hours. >> 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? Yes. Only error states(!) which persisted would trigger another mail. >>> 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. > https://www.smartmontools.org/newticket Regards, Christian [1] https://cygwin.com/acronyms/#SHTDI ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk