[collectd] plugin tail as source for smartcl tmp

Bruno Friedmann bruno at ioda-net.ch
Tue Apr 13 22:40:24 CEST 2010


I've seen the contrib exec-smartctl but my smartctld also log into syslog the Temp change.
so i think tail plugin would be more appropriate. Right ?

I think this exercice can also complete the wiki page about tail plugin.

Context : two drive to monitor sda & sdb
smartctld is logging temp change in /var/log/messages when it appear

Apr 13 19:26:26 chewbacca smartd[2505]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 44 to 43
Apr 13 19:26:26 chewbacca smartd[2505]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 37 to 36
Apr 13 20:26:27 chewbacca smartd[2505]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 43 to 42
Apr 13 20:56:26 chewbacca smartd[2505]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 42 to 41
Apr 13 20:56:27 chewbacca smartd[2505]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 36 to 35
Apr 13 21:26:26 chewbacca smartd[2505]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 41 to 40
Apr 13 21:26:26 chewbacca smartd[2505]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 35 to 34
Apr 13 22:26:24 chewbacca smartd[2505]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 40 to 39


Regex : (this is not my favorite & master domain ... :-)

With this grep  -e "smartd.*194.*[0-9]$" /var/log/messages
I can get all lines of

But after digging conf, website and wiki I can figure out how to write the RegExp inside conf
to get a gauge

-- 

     Bruno Friedmann



More information about the collectd mailing list