Smartmontools

Smartmontools + Blat

You can use Smartmontools to monitor your hard drive's SMART status and it will also help to predict disk failures. I like to use Blat for sending any error messages to my email. Blat Error Codes http://www.blat.net/examples/

NOTE:There is currently no way besides checking the size of the files, to see via WPKG if smartmontools is istalled or not. I know it will be coming soon, but I don't know when.

Download smartmontools from, just select the newest version: http://sourceforge.net/projects/smartmontools/files/ Save smartmontools into %SOFTWARE%\smartmontools\

Download blat from, just select the newest version: http://sourceforge.net/projects/blat/files/ Save blat into %SOFTWARE%\smartmontools\


Edit blat.reg and change the SMTP server, and the Sender values.

blat.reg contents:(Save blat.reg into %SOFTWARE%\smartmontools\) P.S. Double-entries are required for universal case - Blat deployed on either Windows 32 bit or Windows 64 bit editions. First-one is required for 32 bit deployment case, second - for both 64 bit Blat on W64 and 32 bit Blat on W64 (running under WoW).


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat]
"SMTP server"="Default.smtp.server.address"
"Sender"="Default.Sender@email.address"
"SMTP Port"="25"
"Login"=""
"Pwd"=""
"Try"="5"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Public Domain\Blat]
"SMTP server"="Default.smtp.server.address"
"Sender"="Default.Sender@email.address"
"SMTP Port"="25"
"Login"=""
"Pwd"=""
"Try"="5"

Edit smartd.conf and find the line containing DEVICESCAN then modify it to look similar to the following, also change to fit your email address in the configuration file.

smartd.conf contents:(Save smartd.conf into %SOFTWARE%\smartmontools\)

# Sample configuration file for smartd.  See man smartd.conf.

DEVICESCAN -a -o on -S on -s (S/../.././12|L/../../1/03) -m your@email.address

<packages>
	<package id="smartmontools" name="smartmontools 5.38-1" revision="5381" priority="0" reboot="false">
		<check type="logical" condition="and">
		<check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\bin\smartctl.exe" value="266752" /> 
		<check type="file" condition="exists" path="%PROGRAMFILES%\smartmontools\bin\smartd.conf" /> 
		<check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\bin\smartd.exe" value="326144" /> 
		<check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\bin\syslogevt.exe" value="20480" /> 
		<check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\bin\blat.exe" value="36864" /> 
		</check>
		
		<install cmd='cmd.exe /c del /q "%PROGRAMFILES%\smartmontools\bin\smartd.conf"'>
			<exit code="any" />
		</install>
		<install cmd='cmd.exe /c start /wait xcopy /y "%SOFTWARE%\smartmontools\blat.exe" "%PROGRAMFILES%\smartmontools\bin\"' />
		<install cmd='cmd.exe /c start /wait xcopy /y "%SOFTWARE%\smartmontools\blat.exe" "%SYSTEMROOT%\system32\"' />
		<install cmd='cmd.exe /c "%SOFTWARE%\smartmontools\smartmontools-5.38-1.win32-setup.exe" /S'/>
		<install cmd='cmd.exe /C start /wait ping -n 2 127.0.0.1'/>
		<install cmd='cmd.exe /C xcopy /y "%SOFTWARE%\smartmontools\smartd.conf" "%PROGRAMFILES%\smartmontools\bin\smartd.conf"'/>
		<install cmd='cmd.exe /C start /wait ping -n 2 127.0.0.1'/>
		<install cmd='cmd.exe /c "%ProgramFiles%\smartmontools\bin\smartd.exe" install'/>
		<install cmd='cmd.exe /c start /wait sc config smartd start= auto'/>
		<install cmd='regedit /s %SOFTWARE%\smartmontools\blat.reg' />
		<install cmd='cmd.exe /c reg.exe add "HKLM\SOFTWARE\Public Domain\Blat" /v Sender /d %%COMPUTERNAME%% /f' />
		<install cmd='cmd.exe /c start /wait sc start smartd '/>
	
		<remove cmd='cmd.exe /c del /q "%PROGRAMFILES%\smartmontools\bin\smartd.conf"'>
			<exit code="any" />
		</remove>
		<remove cmd='cmd.exe /C sc stop smartd'/>
		<remove cmd='cmd.exe /c del /q "%PROGRAMFILES%\smartmontools\bin\blat.exe"'/>
		<remove cmd='cmd.exe /c del /q "%SYSTEMROOT%\system32\blat.exe"'/>
		<remove cmd='cmd.exe /C "%ProgramFiles%\smartmontools\bin\smartd.exe" remove'/>
		<remove cmd='cmd.exe /C "%ProgramFiles%\smartmontools\uninst-smartmontools.exe" /S'/>
		
	</package>
</packages>

--Jgriffith 01:47, 12 August 2009 (CEST)


Smartmontools

You can use Smartmontools to monitor your hard drive SMART status and predict disk failures. I use Blat for sending error messages to my email. Edit smartd.conf and set correct size of it in packages.xml.

<packages>
<package id="smart" name="smartmontools 5.38-1" revision="1" priority="0" reboot="false">
 <check type="logical" condition="and">
 <check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\smartctl.exe" value="266752" /> 
  <check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\smartd.conf" value="149" /> 
  <check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\smartd.exe" value="326144" /> 
  <check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\syslogevt.exe" value="20480" /> 
  <check type="file" condition="sizeequals" path="%PROGRAMFILES%\smartmontools\blat.exe" value="115200" /> 
</check>
  <install cmd="cmd.exe /C xcopy /y %SOFTWARE%\utiliti\smartmontools\* "%PROGRAMFILES%\smartmontools\"" timeout="30" /> 
  <install cmd="cmd.exe /C "%PROGRAMFILES%/smartmontools/blat.exe" -install your.workstation.domain.lv sender@address.lv" timeout="10" /> 
  <install cmd="cmd.exe /C "%PROGRAMFILES%/smartmontools/smartd.exe" install -l local0" timeout="10" /> 
  <install cmd="net start smartd" timeout="10" /> 
  <prepare cmd="cmd.exe /C mkdir "%PROGRAMFILES%\smartmontools"" timeout="10" /> 
  <remove cmd="net stop smartd" timeout="10" /> 
  <remove cmd="cmd.exe /C "%PROGRAMFILES%/smartmontools/smartd.exe" remove" timeout="10" /> 
  <remove cmd="cmd.exe /C rmdir /Q /S "%PROGRAMFILES%/smartmontools"" timeout="10" /> 
  <upgrade cmd="net stop smartd" timeout="10" /> 
  <upgrade cmd="cmd.exe /C xcopy /y %SOFTWARE%\utiliti\smartmontools\* "%PROGRAMFILES%\smartmontools\"" timeout="30" /> 
  <upgrade cmd="net start smartd" timeout="10" /> 
</package>
</packages>

smartd.conf contents:

# Sample configuration file for smartd.  See man smartd.conf.

DEVICESCAN -a -o on -S on -s (S/../.././12|L/../../1/03) -m your@address.lv