Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Install an enhanced SMART monitoring package' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Install an enhanced SMART monitoring package
Authored by: geppo1982 on May 21, '06 03:49:29AM
I wrote a simple package to install smartmontool precompiled binaries into your /usr/local/bin folder; you can download it from:
http://geppo1982.altervista.org/smartmontools_5.36.dmg.tgz
(copy and paste this link into your browser address bar, do not direct click on it).


If you do not have a /usr/local/bin folder you can create it entering the following command into Terminal:
sudo cd /; mkdir usr; mkdir usr/local; mkdir usr/local/bin

To launch smartd open ScriptEditor and paste the following code:
set mailAddress to "youremailaddress"
set mainDisk to do shell script "mount | grep \" on / \" | cut -d \" \" -f 1"
do shell script "echo " & mainDisk & " -n standby -T permissive -s L/../../7/09 -H -l selftest -l error -f -m " & mailAddress & " | /usr/local/bin/smartd -c - -i 3600"
Then substitute youremailaddress with your real e-mail address (smartd will send you and e-mail when it will detect a new error on your disk) and save the script as "application".

If you want to launch smartd at startup add the application you created to your Login Items.

[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: hamarkus on May 21, '06 10:14:48AM

Thanks for the binary. Running smartd from the command line now works.

The Applescript, unfortunately, gives me an error on compiling:
"expected end of line but found ..." , essentially it expects an end of line after the "mount | grep " part.



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: geppo1982 on May 21, '06 11:01:26AM
Download the applescript application here:
http://geppo1982.altervista.org/Launch_smartd.tgz
Then open it with Script Editor, replace youremailaddress with your real e-mail address and save.

I hope it will work.

[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: hamarkus on May 21, '06 12:46:49PM

Thanks, it works fine now.
There was just one quirk. In the folder created by expanding the .tgz archive, two files were present. One named 'Launch smartd.1.app' and the second 'Launch smartd.app'. The former, the compiled script I presume, insisted on launching Classic, which I do not have installed. The second, the uncompiled script I would guess, could be opened with Scripteditor and saved as an application from there.



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: smkolins on May 21, '06 12:52:07PM

great progress is making this usable.

Some suggestions - I'm not sure but perhaps it needs to be built as a universal binary, and include the man files in usable form - or make a GUI wrapper around the whole thing so that average users can configure it?

I'm not a programmer but I am a sysadmin of a school system and getting warnings on drive failing seems like a very good idea - though I wonder how the email warning would work - where's the smtp connection?

---
Possess a pure, kindly, and radiant heart!



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: geppo1982 on May 21, '06 03:02:14PM
I don't now how smartd sends e-mail but you can check if this feature works on your system by entering the following command in Terminal and then checking your mailbox.
maindisk=`mount | grep " on / " | cut -d " " -f 1`; \
echo $maindisk -m youremailaddress -M test | \
/usr/local/bin/smartd -c - -q onecheck
Remember to change youremailaddress with your real e-mail address.

[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: hamarkus on May 22, '06 02:07:48AM

I get the following message when I try this:

Test of mail to xxx@xxx produced unexpected output (78 bytes) to STDOUT/STDERR:
postdrop: warning: unable to look up public/pickup: No such file or directory



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: geppo1982 on May 22, '06 05:41:37AM

On my PowerBook with a fresh Tiger (10.4.6) intallation this command works well. What's your OS version?



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: hamarkus on May 22, '06 06:08:41AM

Tiger 10.4.6 as well (with all sharing services turned off, if that should matter, just guessing what the reference to the dropbox might mean).

So, you actually get an e-mail?



[ Reply to This | # ]
It works!
Authored by: hamarkus on May 22, '06 06:22:01AM

I must have miss-typed something before. When I tried it again, I got the test e-mail. Thanks to the great powers of Unix and to you for your help.



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: mnewman on May 21, '06 04:08:23PM

But, you really don't want it as a login item, do you?

You want it to run when the machine boots up so that that the smartd daemon is running even if no one logs in.

Can you put a compiled Applescript in /Library/StartupItems?

---
Mike Newman
Saipan and Narita Layover Pages:
http://www.mgnewman.com



[ Reply to This | # ]
Install an enhanced SMART monitoring package
Authored by: mnewman on May 21, '06 08:32:30PM

I finally got this working as a proper system startup item in /Library/StartupItems.

The binary (shell script) needs to go in a sub-directory in /Library/StartupItems and both the binary and subdirectory need to have the same name. That directory must also contain a valid StartupParameters.plist file. And, you need to set all the permission right (just copy what another startup item has: owner=root, group=wheel, etc.).

(Sorry for the duplicate post, above. Can someone delete it?)

---
Mike Newman
Saipan and Narita Layover Pages:
http://www.mgnewman.com



[ Reply to This | # ]