bubbaQ Posted January 25, 2009 Author Share Posted January 25, 2009 Version 0.0.4 of smarthistory is now posted. Link is in OP. New in this version: - added option to wake up drives (I set a cron job with this option once a week) - added more tokens in the token config file - fixed bug in Google chart parameters when y-value = 0 I'm very interested in feedback, and in suggestions for improvements, as well as default thresholds to use for each SMART parameter. Quote Link to comment
JarDo Posted January 25, 2009 Share Posted January 25, 2009 I believe I have everything configured properly to create HTML reports with graphs. See my attached smarthistory.program.conf. Data files are being created, but they are flat text. Am I missing a step, doing something wrong, or being impatient? Am I supposed to execute some other script to create reports from the data files? Quote Link to comment
bubbaQ Posted January 25, 2009 Author Share Posted January 25, 2009 What is the command line you are using? Also, post one of your smarthistory data files so I can see what is in them. Quote Link to comment
JarDo Posted January 25, 2009 Share Posted January 25, 2009 I'm not using any command line parameters at the moment. I'm using the conf file (see prior post) to configure everything and simply executing a "php smarthistory.php" command daily via cron. I've zipped and attached all the data files for you to see. Quote Link to comment
bubbaQ Posted January 25, 2009 Author Share Posted January 25, 2009 OK. Running it via cron will save the data, but you won't see output. To see the output, run it from the command line. Also, it appears that you only have data from Jan 24 for all but one of your drives. Possibly they are all spun down today? Quote Link to comment
NLS Posted January 25, 2009 Share Posted January 25, 2009 Is there a way to update bubbaRAID's version from this? Quote Link to comment
bubbaQ Posted January 25, 2009 Author Share Posted January 25, 2009 Just unzip it to /boot/smarthistory Quote Link to comment
NLS Posted January 25, 2009 Share Posted January 25, 2009 super and then do I need to restart something? (not the whole system hopefully) Quote Link to comment
bubbaQ Posted January 25, 2009 Author Share Posted January 25, 2009 and then do I need to restart something? Nope. Just run it. Quote Link to comment
NLS Posted January 26, 2009 Share Posted January 26, 2009 Erm... what, the php? How? Can you "newbie spell it" for me a bit? Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 Just wait... a new BubbaRaid will be posted tonight. And I will update the OP in this thread with more install instructions. Quote Link to comment
NLS Posted January 26, 2009 Share Posted January 26, 2009 thanks after .20 I see this: Array Status ok and started Smart History Alerts: 9 device(s) active, 0 sleeping, 1 did not return SMART data. Why you think? Is there a way to get more info about this? Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 Is there a way to get more info about this? There will be soon.... in the next version. Or you can run smarthistory from telnet with the -debug ON option, or the -report ALL command line option. cd /boot/smarthistory php smarthistory.php -output ALL php smarthistory.php -debug ON Quote Link to comment
JarDo Posted January 26, 2009 Share Posted January 26, 2009 OK. Running it via cron will save the data, but you won't see output. Oh. I didn't realize that. To see the output, run it from the command line. This worked. I see that the HTML is sent to STDOUT Also, it appears that you only have data from Jan 24 for all but one of your drives. Possibly they are all spun down today? Yes. That was the case. I wrote a User Script file for unmenu to spin up my drives and show a report. It works, except that the switch to spin up the drives doesn't appear to have any affect: #define USER_SCRIPT_LABEL SMART History Report #define USER_SCRIPT_DESCR Run SMART paramater tracking database Report echo "<pre>" cd /boot/smarthistory php smarthistory.php -wake ON Am I using the wrong syntax to override conf file settings with a command line switch? Actually, I just tried enabling the wake=ON parameter in the conf file and that didn't wake my drives up either. Quote Link to comment
dhy8386 Posted January 26, 2009 Share Posted January 26, 2009 Yeh for some reason doesnt work for me either. Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 Yup... found a bug in the spin-up routine. New version 0.0.5 is now posted. Link is in OP. Default also now prints a status message so you always see some output... you can suppress it with "-quiet ON" Quote Link to comment
Joe L. Posted January 26, 2009 Share Posted January 26, 2009 Very nice. Here is an unmenu User-Script to get the output to the screen with all the graphs. It is all of 4 lines long!! (my smarthistory.php is in /boot/smarthistory) cat 50-unmenu_user_script_smarthist-graph #define USER_SCRIPT_LABEL SMART History Report #define USER_SCRIPT_DESCR Run SMART parameter tracking database Report cd /boot/smarthistory php smarthistory.php -wake ON -output HTML -graph IMAGE -report ALL The output looks really nice, it even shows one of my drives has had another sector re-allocated since the last time it was run. The only critique I have is that the graph might be made a little wider to take advantage of the available screen space. This is especially noticeable on those graphs with long legend names. To fix was easy, I just changed the smaryhistory.program.conf file to make the image wider (I increased it from 150 pixels to 300 pixels wide). ; igs is the graph size (in pixels) of in-line IMG graphs (HTML output only) ;igs=150x85 igs=300x85 The button in unmenu under User-Scripts looks like this: Pressing it results in graphs like this (you can see the change in the reallocated sector count from 3 to 4): And, it appears as if my two oldest drives are showing up as "warnings" in yellow... They have racked up some hours spinning away for the past three years. All in all, a VERY nice addition to the tools we have on our servers to monitor their health... and VERY easy to integrate in unMENU... Nice Job bubbaQ!! Joe L. Quote Link to comment
NLS Posted January 26, 2009 Share Posted January 26, 2009 Is there a way to get more info about this? There will be soon.... in the next version. Or you can run smarthistory from telnet with the -debug ON option, or the -report ALL command line option. cd /boot/smarthistory php smarthistory.php -output ALL php smarthistory.php -debug ON ...hmmmm plot is getting thicker, probably the one that doesn't report SMART data is "sdg"... the interesting part is that I DO NOT have a drive sdg! I have sda to sdh and I have hda to hdc! In fact I couldn't have sdg even if I wanted as the mobo has six SATA ports (and 2 ATA - having 3 devices). Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 the interesting part is that I DO NOT have a drive sdg! Yes you do... it is your Flash drive! Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 I see that the HTML is sent to STDOUT Yes. I did that so it would be easy to integrate with other tools, like unMENU. You can capture the output by redirecting it to a file, then open the file in your browser. Quote Link to comment
Joe L. Posted January 26, 2009 Share Posted January 26, 2009 This morning I ran the smarthistory.php by using the User-Script button I created. It reported that one of my disks had failed. I investigated and found the serial number matched my parity drive, BUT I found the parity drive had not failed at all. All the drives were sleeping when I ran the report. Perhaps you did not wait long enough after spinning it up before reading the SMART attributes? Joe L. Looking at the output on the screen, from the smarthistory report, it showed: *** DRIVE 9QJ0JPJS: FAILED S.M.A.R.T. HEALTH TEST!!!! 9QJ0JPJS: OK - ATA_Error_Count is 9QJ0JPJS: OK - Raw_Read_Error_Rate is 9QJ0JPJS: OK - Spin_Up_Time is 9QJ0JPJS: OK - Start_Stop_Count is 9QJ0JPJS: OK - Spin_Retry_Count is 9QJ0JPJS: OK - Calibration_Retry_Count is 9QJ0JPJS: OK - Power_Cycle_Count is 9QJ0JPJS: OK - Reallocated_Sector_Ct is 9QJ0JPJS: OK - Seek_Error_Rate is 9QJ0JPJS: OK - Temperature_Celsius is 9QJ0JPJS: OK - Reallocated_Event_Count is 9QJ0JPJS: OK - Current_Pending_Sector is 9QJ0JPJS: OK - Power_On_Hours is 9QJ0JPJS: OK - Offline_Uncorrectable is 9QJ0JPJS: OK - UDMA_CRC_Error_Count is 9QJ0JPJS: OK - Multi_Zone_Error_Rate is The actual SMART output looks like this: smartctl -a -d ata /dev/sdg (parity) smartctl version 5.38 [i486-slackware-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF INFORMATION SECTION === Model Family: Seagate Barracuda 7200.11 Device Model: ST31000340AS Serial Number: 9QJ0JPJS Firmware Version: SX15 User Capacity: 1,000,204,886,016 bytes Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Mon Jan 26 07:42:13 2009 EST SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED See vendor-specific Attribute list for marginal Attributes. General SMART Values: Offline data collection status: (0x82) Offline data collection activity was completed without error. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 625) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 219) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x103b) SCT Status supported. SCT Feature Control supported. SCT Data Table supported. SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 117 099 006 Pre-fail Always - 155933054 3 Spin_Up_Time 0x0003 091 084 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 427 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 070 060 030 Pre-fail Always - 11582645 9 Power_On_Hours 0x0032 096 096 000 Old_age Always - 4044 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 11 12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 93 184 Unknown_Attribute 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0 188 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 074 043 045 Old_age Always In_the_past 26 (0 4 27 19) 194 Temperature_Celsius 0x0022 026 057 000 Old_age Always - 26 (0 16 0 0) 195 Hardware_ECC_Recovered 0x001a 036 024 000 Old_age Always - 155933054 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 SMART Error Log Version: 1 No Errors Logged SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Extended offline Aborted by host 50% 1233 - # 2 Short offline Completed without error 00% 1232 - SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay. Joe L. Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 I had the same thing happen last night... I believe you are correct that it did not give the drive time to spin up. I am not spinning up the drives manually, but allowing smarthistory to do it.... It looks like I'll need to do it manually before calling smarthistory. New version will be posted today. Quote Link to comment
SSD Posted January 26, 2009 Share Posted January 26, 2009 I had an idea. Smartctl is called from a number of different user tools to get drive temperature and report drive health. If you created an alternate smartctl that called the real one behind the scenes, you could read the output and use the opportunity to record the smart attributres for the drive. That might be a good way to get more data points and not "waste" any smart output. It would require no updates to any existing scripts or user instructions. This would be an alternative / adjunct to the cron based method. Quote Link to comment
bubbaQ Posted January 26, 2009 Author Share Posted January 26, 2009 I could make a command line option "--passthrough" that would override everything, ignore the smarthistory configuration, update history data, and just return the smartctl results back. The parameter after --passthrough would have to be the command line to pass to smartctl, like this php smarthistory --passthrough "/dev/hda -a --nocheck=standby" It would have to be a "fake" smartctl script that would take the command line to the script (which is the command line the user thinks is going to smartctl), package all the parameters into a quoted string, then call smarthistory as above. Need to make it safe, and ensure that smarthistory is present and working, and if not, run smartctl directly. Quote Link to comment
NLS Posted January 26, 2009 Share Posted January 26, 2009 the interesting part is that I DO NOT have a drive sdg! Yes you do... it is your Flash drive! aaaaaah so it is normal that we don't get SMART data right? maybe this should be "hidden" then? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.