HDD Health (S.M.A.R.T.) monitoring script

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

HDD Health (S.M.A.R.T.) monitoring script

Post by BSOD2600 »

I wrote a script that takes the data output from HDD Health, a free S.M.A.R.T. monitor for Windows, and outputs it for Cacti. It reads the report file (ex: WDC WD740GD-75FLA1.txt)., which lists the names for the various attributes. Then it reads the data file (ex: WD-WMAKE1359731.hdd). for the updated attribute values. While the report file has values, you'll notice that the file is not updated until closure of the program.

The graphs are pretty boring (as they should be), but with the threshold addition being added into the next version of Cacti, it will play a vital role in monitoring a HD's health and possible failure prediction.

You'll notice the graph will have many values that are empty. This is perfectly normal. This happens because I added all of the SMART attributes from the various hard drive makers at my house. Some have values others don't.

One can add in additional values to be monitored. Just need to add it to the data input method, data templates and graph.
Attachments
hddhealth.zip
script and needed templates.
(51.11 KiB) Downloaded 2015 times
Sample graph
Sample graph
hdd.png (21.25 KiB) Viewed 29536 times
Last edited by BSOD2600 on Sat Feb 25, 2006 1:14 pm, edited 1 time in total.
mindstormmaster
Posts: 6
Joined: Sat Mar 12, 2005 11:14 pm

Post by mindstormmaster »

Does something like this exist for Linux based systems?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Sure http://smartmontools.sourceforge.net/

I could've written the script around this programs output, but it's commandline based and not as friendly as something GUI driven.
laffen
Cacti User
Posts: 56
Joined: Tue Jul 13, 2004 2:57 am
Location: Norway

Post by laffen »

BSOD2600 wrote:Sure http://smartmontools.sourceforge.net/

I could've written the script around this programs output, but it's commandline based and not as friendly as something GUI driven.
I would think commandline tools are more friendly to scripting than GUI tools.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Possibly. I still prefer to look at a GUI for the SMART values (and the various other things HDD Health shows) instead of Cacti or the raw text output in the command line.
User avatar
Onkel_Tom
Posts: 16
Joined: Sat Apr 23, 2005 7:48 pm
Location: Germany

Post by Onkel_Tom »

It would be very nice to have smartmontools under Linux also working with cacti. Does somebody work on that and also want to share?
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

I guess its not possible, having one script for all different Harddisk types.
each OEM has an different S.M.A.R.T output. which means, you need a individual script for ex. MAXTOR, IBM, HITACHI, SAMSUNG and so on.

tom
http://www.lounge-radio.com/
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Onkel_Tom: That would require a compleatly different script. Since I'm not a linux user, this is not a priority for me.

sumsum: Why do you need seperate scripts? I added most of the common SMART values found in several brands of hard drives I have at my house. Heck, the available values still differ from model to model from the same company.

If you want to add more unique SMART values HDD Health reports, it's fairly easy. What are the other values you want to monitor that it currently does not?
User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

Post by sumsum »

BSOD2600 : sorry my fault i'm coming from the linux section ;) where I use smartmontools. it grabs all the information about the S.M.A.R.T Data, and those information differ from each OEM regarding the output report.
http://www.lounge-radio.com/
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Having trouble importing the templates for some reason I am getting unmet dependancies...
Cacti has imported the following items:

Round Robin Archive
[success] Daily (5 Minute Average) [update]
[success] Weekly (30 Minute Average) [update]
[success] Monthly (2 Hour Average) [update]
[success] Yearly (1 Day Average) [update]

GPRINT Preset
[success] Normal [update]

Data Input Method
[success] Win32 - HDD Health (local) [update]

Data Template
[success] Win32 - HDD Health (local) [update]
+ Found Dependency: (Data Input Method) Win32 - HDD Health (local)
+ Found Dependency: (Data Input Field) RawReadErrorRate
+ Found Dependency: (Data Input Field) StartStopCount
+ Found Dependency: (Data Input Field) SpinUpTime
+ Found Dependency: (Data Input Field) ReallocatedSectorCount
+ Found Dependency: (Data Input Field) SeekErrorRate
+ Found Dependency: (Data Input Field) PowerOnHoursCount
+ Found Dependency: (Data Input Field) SpinRetryCount
+ Found Dependency: (Data Input Field) CalibrationRetryCount
+ Found Dependency: (Data Input Field) PowerCycleCount
+ Found Dependency: (Data Input Field) Temperature
+ Found Dependency: (Data Input Field) ReallocationEventCount
+ Found Dependency: (Data Input Field) CurrentPendingSectorCoun
+ Found Dependency: (Data Input Field) Off-lineScanUncorrectable
+ Found Dependency: (Data Input Field) UltraATACRCErrorCount
+ Found Dependency: (Data Input Field) WriteErrorRate
+ Found Dependency: (Data Input Field) ReadChannelMargin
+ Found Dependency: (Data Input Field) SeekTimePerformance
+ Found Dependency: (Data Input Field) PoweroffRetractCount
+ Unmet Dependency: (Data Input Field)
+ Found Dependency: (Data Input Field) TACounterDetected
+ Found Dependency: (Data Input Field) TACounterIncreased
+ Found Dependency: (Data Input Field) HardwareECCrecovered
+ Found Dependency: (Data Input Field) HDD Data File
+ Found Dependency: (Data Input Field) HDD Report File

Graph Template
[success] Win32 - HDD Health [update]
Cacti has imported the following items:

Round Robin Archive
[success] Daily (5 Minute Average) [update]
[success] Weekly (30 Minute Average) [update]
[success] Monthly (2 Hour Average) [update]
[success] Yearly (1 Day Average) [update]

Data Input Method
[success] Win32 - HDD Health (local) [update]

Data Template
[success] Win32 - HDD Health (local) [update]
+ Found Dependency: (Data Input Method) Win32 - HDD Health (local)
+ Found Dependency: (Data Input Field) RawReadErrorRate
+ Found Dependency: (Data Input Field) StartStopCount
+ Found Dependency: (Data Input Field) SpinUpTime
+ Found Dependency: (Data Input Field) ReallocatedSectorCount
+ Found Dependency: (Data Input Field) SeekErrorRate
+ Found Dependency: (Data Input Field) PowerOnHoursCount
+ Found Dependency: (Data Input Field) SpinRetryCount
+ Found Dependency: (Data Input Field) CalibrationRetryCount
+ Found Dependency: (Data Input Field) PowerCycleCount
+ Found Dependency: (Data Input Field) Temperature
+ Found Dependency: (Data Input Field) ReallocationEventCount
+ Found Dependency: (Data Input Field) CurrentPendingSectorCoun
+ Found Dependency: (Data Input Field) Off-lineScanUncorrectable
+ Found Dependency: (Data Input Field) UltraATACRCErrorCount
+ Found Dependency: (Data Input Field) WriteErrorRate
+ Found Dependency: (Data Input Field) ReadChannelMargin
+ Found Dependency: (Data Input Field) SeekTimePerformance
+ Found Dependency: (Data Input Field) PoweroffRetractCount
+ Unmet Dependency: (Data Input Field)
+ Found Dependency: (Data Input Field) TACounterDetected
+ Found Dependency: (Data Input Field) TACounterIncreased
+ Found Dependency: (Data Input Field) HardwareECCrecovered
+ Found Dependency: (Data Input Field) HDD Data File
+ Found Dependency: (Data Input Field) HDD Report File
Cacti has imported the following items:

Round Robin Archive
[success] Daily (5 Minute Average) [update]
[success] Weekly (30 Minute Average) [update]
[success] Monthly (2 Hour Average) [update]
[success] Yearly (1 Day Average) [update]

Data Input Method
[success] Win32 - HDD Health (remote) [update]

Data Template
[success] Win32 - HDD Health (remote) [update]
+ Found Dependency: (Data Input Method) Win32 - HDD Health (remote)
+ Unmet Dependency: (Data Input Field)
+ Unmet Dependency: (Data Input Field) PoweroffRetractCount
+ Unmet Dependency: (Data Input Field) SeekTimePerformance
+ Unmet Dependency: (Data Input Field) ReadChannelMargin
+ Unmet Dependency: (Data Input Field) WriteErrorRate
+ Unmet Dependency: (Data Input Field) UltraATACRCErrorCount
+ Unmet Dependency: (Data Input Field) Off-lineScanUncorrectable
+ Unmet Dependency: (Data Input Field) CurrentPendingSectorCoun
+ Unmet Dependency: (Data Input Field) ReallocationEventCount
+ Unmet Dependency: (Data Input Field) Temperature
+ Unmet Dependency: (Data Input Field) PowerCycleCount
+ Found Dependency: (Data Input Field) CalibrationRetryCount
+ Unmet Dependency: (Data Input Field) SpinRetryCount
+ Unmet Dependency: (Data Input Field) PowerOnHoursCount
+ Unmet Dependency: (Data Input Field) SeekErrorRate
+ Unmet Dependency: (Data Input Field) ReallocatedSectorCount
+ Unmet Dependency: (Data Input Field) StartStopCount
+ Unmet Dependency: (Data Input Field) SpinUpTime
+ Unmet Dependency: (Data Input Field) RawReadErrorRate
+ Unmet Dependency: (Data Input Field) TACounterDetected
+ Unmet Dependency: (Data Input Field) TACounterIncreased
+ Unmet Dependency: (Data Input Field) HardwareECCrecovered
+ Found Dependency: (Data Input Field) HDD Data File (*.hdd)
+ Found Dependency: (Data Input Field) HDD Report File (*.txt)
+ Found Dependency: (Data Input Field) Remote Computer
How could I be screwing the import up... it seems pretty easy from your readme. :(
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Looks like you already had the templates imported previously? Try deleting them (data template, graph template and data input methods) and try again. It wouldn't hurt to update your cacti version too to 0.8.6h + patches.
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Upgraded to 0.8.6h +patches...

Deleted and re-imported but the same errors appear. The templates also create the data import methods that you specify in your readme. So those steps are not needed any longer?
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Correct, they are not needed.

Not sure why that single Data Input Field in failing though. When you look at the Date template, are all the fields which appear in the sample graph present?
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Yeah. Everything looks ok (keeping in mind my limited knowledge of creating templates) once I have imported all the templates but just wondering why the errors even appear.
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Possibly a cacti 0.8.6g or h bug? Not sure since I created this script/template almost a year ago.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest