starcat Posted December 19, 2009 Share Posted December 19, 2009 Running periodically smartctl and seeing how drives are doing is quite essential. I was wondering if there is any wrapper around smartctl which will run it periodically and report trend analysis, increasing error rates with drives, etc. Would be great if that sort of thing can be integrated within unMenu directly and be part of the web interface to unRAID. Link to comment
starcat Posted December 19, 2009 Author Share Posted December 19, 2009 Found this one here, any other links? http://lime-technology.com/wiki/index.php?title=UnRAID_Add_Ons#SmartHistory Link to comment
bubbaQ Posted December 19, 2009 Share Posted December 19, 2009 Once unRAID 5.x is out, I hope to have time to release a new version of SmartHistory that will incorporate some improvements. Link to comment
wholly Posted December 19, 2009 Share Posted December 19, 2009 Found this one here, any other links? http://lime-technology.com/wiki/index.php?title=UnRAID_Add_Ons#SmartHistory I was considering a twice a day cron job to wget the smarthistory page to collect stats... I haven't done it yet though. I think part of my delay iss umnenu's dislike of multiple requests. Rob Link to comment
starcat Posted December 19, 2009 Author Share Posted December 19, 2009 Was able to play a bit more with SmartHistory and it's great! BubbaQ, congrats and thanks for this tool! Rob, how is the web page called, which URL does it have? Link to comment
wholly Posted December 19, 2009 Share Posted December 19, 2009 Seems like the url is: http://tower:8080/user_scripts?command=SMART+History+Report Rob Link to comment
starcat Posted December 19, 2009 Author Share Posted December 19, 2009 Got it, thanks! Link to comment
Joe L. Posted December 19, 2009 Share Posted December 19, 2009 Seems like the url is: http://tower:8080/user_scripts?command=SMART+History+Report Rob That assumes you have unMENU installed, as that page is one served by unMENU, and is just one of the user-script buttons available on it. Link to comment
wholly Posted December 20, 2009 Share Posted December 20, 2009 Agreed - I had assumed the link referenced unmenu but now I've followed it. Yeah, I really should have mentioned the part about umenu. Link to comment
starcat Posted December 20, 2009 Author Share Posted December 20, 2009 Yes, I have unMenu installed and that link worked fine for me. Thanks! Link to comment
Joe L. Posted December 20, 2009 Share Posted December 20, 2009 Yes, I have unMenu installed and that link worked fine for me. Thanks! You'll find a button for it on the user-scripts page in unMENU. The actual "button" is just a shell script itself, named so unMENU will add it to the user-scrips page, and with a few special comment lines to label and describe the button. It is named 50-unmenu_user_script_smarthist-graph In my file the top two define the button label and description. Two of the following are commented out leaving its contents as: #define USER_SCRIPT_LABEL SMART History Report #define USER_SCRIPT_DESCR Run SMART paramater tracking database Report cd /boot/smarthistory php smarthistory.php -wake ON -output HTML -graph IMAGE -report ALL It basically needs "php" installed to work, and it needs "smarthistory.php" installed in /boot/smarthistory When you press the button, the URL you gave is the one submitted to the unmenu web-server. It in turn runs the shell script and sends the output to your browser. The script changes directory to /boot/smarthistory and then runs smarthistory.php using the "php" interpreter. Not too bad for 4 lines of script. (To create a working button on a web-page) Joe L. Link to comment
wholly Posted December 20, 2009 Share Posted December 20, 2009 cd /boot/smarthistory php smarthistory.php -wake ON -output HTML -graph IMAGE -report ALL [/b] Actually that is what you could drop in a cron job and bypass the unMenu server and get consistent collection of smart status. Rob Link to comment
Joe L. Posted December 20, 2009 Share Posted December 20, 2009 cd /boot/smarthistory php smarthistory.php -wake ON -output HTML -graph IMAGE -report ALL [/b] Actually that is what you could drop in a cron job and bypass the unMenu server and get consistent collection of smart status. Rob And, since the "button" is a shell script, you could simply schedule it as the script to run.! In other words, the script in cron would be /boot/unmenu/50-unmenu_user_script_smarthist-graph Link to comment
wholly Posted December 20, 2009 Share Posted December 20, 2009 I should have thought about that. I know I didn't want to go back to the web server as it only handles one request at a time (an amazing job for scripted code btw) Link to comment
Joe L. Posted December 21, 2009 Share Posted December 21, 2009 I should have thought about that. I know I didn't want to go back to the web server as it only handles one request at a time. Yes... The "User-Scripts" buttons are just shell scripts with two special "comments" to define the label and description of the button. The web-page just renders all the buttons it finds (all those matching the naming pattern for the buttons) You can add buttons for just about anything you like. If you wanted a button to see the free space you could create one with #define USER_SCRIPT_LABEL Free Space #define USER_SCRIPT_DESCR Disk Free Space report echo "<pre>" df It just needs to be named with a leading number, followed by "-unmenu_user_script_XXXXXXXXXXXXXXX" where XXXXXXXXXXXXXXX is anything you like that is descriptive. The leading number determines where it is put in the list of buttons on the page. (Lower number are towards the top) I specifically made the buttons shells scripts so they could be "developed" and tested without any web-interaction at all. They can just be run as shell scripts. (an amazing job for scripted code btw) Yes, it is really amazing what we accomplished with just an "awk" script, even with the small limitation that it cannot handle overlapping requests. It just means I cannot have embedded .jpg images on a page since only one could be rendered by an "img" tag. (I don't even handle those tags) Thanks for the feedback though... The unMENU project was originally conceived to allow people to visualize the suggestions for improving the user-interface. It evolved into a nice tool in its own right. Joe L. Link to comment
Joe L. Posted December 21, 2009 Share Posted December 21, 2009 Just an FYI, It equally easy to create a whole new plugin page in unMENU as it is to create a user-script button. Just create a file named 200-unmenu-smarthistory.cgi Put in it the following 4 lines (yes, it is a shell script too) and put it in the same folder as the other unmenu files. #define ADD_ON_MENU=Smart History #define ADD_ON_URL=smarthistory cd /boot/smarthistory php smarthistory.php -wake ON -output HTML -graph IMAGE -report ALL Then restart the unMENU process and it will re-scan for plug-ins as it re-starts. The new link will appear in the top menu, and it will be on its own page. More complex web-pages like myMain are a bit more complicated... but you can do whatever you like. the output of whatever you write is expected to be html, and it is sent to the browser. The output of the new plugin looks like this: Not too shabby for 4 lines of shell script. (These two drives have been spinning in my server since I put it online, a bit over 4 years ago. There's nothing wrong with them, but the smart history report is warning me they are getting old. Aren't we all ) Link to comment
bubbaQ Posted December 21, 2009 Share Posted December 21, 2009 I hope you have some replacements on hand for those 4-year old Hitachi 500GB drives....that's playing with a wee bit of fire. You can of course, change the 26000 hour threshold in SmartHistory if you like to keep drives for longer than 3 years. Link to comment
prostuff1 Posted December 21, 2009 Share Posted December 21, 2009 I hope you have some replacements on hand for those 4-year old Hitachi 500GB drives....that's playing with a wee bit of fire. You can of course, change the 26000 hour threshold in SmartHistory if you like to keep drives for longer than 3 years. I have an old WD 160GB that I pulled from an old iMac that looks like so: WD-WCAL94036151: WARNING - Power_On_Hours it is now 31170 (warning threshold is 20000) I could really care less about this drive though. It is my cache drive and if it goes I will just pull another smaller drive from a machine I have sitting around. Link to comment
starcat Posted December 21, 2009 Author Share Posted December 21, 2009 How often do you run SmartHistory (twice a day was mentioned?) and any best practice to add it persistently to crontab, perhaps with an example? Thanks. Link to comment
prostuff1 Posted December 21, 2009 Share Posted December 21, 2009 How often do you run SmartHistory (twice a day was mentioned?) and any best practice to add it persistently to crontab, perhaps with an example? Thanks. smart history is built into BubbaRAID and to be honest I am not sure how often it runs. All I know is that I periodically check the BubbaRAID homepage and it updates with this status. How often you run it is entirely up to you and how paranoid you are about your drives. If I were to schedule this I would probably run it once every other day or so, but then most of the drives in my array have not changed and have become pretty stable (except for one seagate 1TB which is giving me fits; hopefully fixed that though). Link to comment
starcat Posted December 26, 2009 Author Share Posted December 26, 2009 Joe, I was wondering why preclear isn't part of the unMenu User Scripts page? Is there any particular reason? Thanks! Link to comment
Joe L. Posted December 26, 2009 Share Posted December 26, 2009 Joe, I was wondering why preclear isn't part of the unMenu User Scripts page? Is there any particular reason? Thanks! It needs to be interactive... to be able to get confirmation you are not accidentally clearing the wrong drive, and to constantly update the display to show its progress. In its present form there is no easy way to make it into a web-page. Joe L. Link to comment
starcat Posted December 26, 2009 Author Share Posted December 26, 2009 Yes, I see, thanks! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.