Soumis par Deajan le

Windows Server [Updated on 18/08/13] - New package v6.2-1 - New version hosted at http://www.netpower.fr

SMART technology helps preventing data loss by monitoring your hard drives and predicting failures.

Tightly integrated into unix systems via smartmontools, it also exists for Windows systems, often already integrated into modern RAID controller frameworks, or available with free / paid diagnostic tools.

As i needed a tool to monitor hard disks, i begun writing an alternate installer for smartmontools under Windows, focused primary on mass deployment (unattended switches), but also with a nice GUI for end users, that includes sending mail alerts or local messages.

Based on smartmontools by Bruce Allen & Christian Franke, versionning follows linux naming conventions for packages, meaning the first version number is the upstream smartmontools version, the last digit is my installer's version.

it's daily usable, altough a bit too new to use it in critical enterprise environnments (currently, this works for myself, my company, and about 100 computers in companies i'm working for, including critical servers).

Although i don't provide commercial support, feel free to send me a mail if you encounter any bugs for limited support.

When launched without any command line arguments, it will show a simple GUI to configure SMART and alert options. When launched with the right arguments, a full unattended setup is performed. A basic install script would look like this:

@echo off

smartmontools-win-6.1-4.exe -f sourcemail@example.tld -t destinationmail@example.tld -s smtp.isp.com /silent

The last argument does not use the same input format because it's used directly by the installer core (Inno Setup), all other switches are used by my installer script. A full list of command line switches can be found in the README.TXT file that comes with the installer (allowing to configure everything the GUI can).

This project is fully GPLv2, based on well known opensource projects, including the following:

- Smartmontools by Bruce Allen, Christian Franke, Gabriele Pohl, Alex Samorukov, http://smartmontools.sourceforge.net
- Inno Setup by Jordan Russel, http://www.jrsoftware.org
- Sendemail by Brandon Zehm, http://caspian.dotconf.net/menu/Software/SendEmail
- Gzip by Free Software Foundation, Inc. Copyright (C) 1992, 1993 Jean-loup Gailly, http://gnuwin32.sourceforge.net/

Special thanks to Chistian Franke for his WTSSendMessage implementation.

Source code can be found here.

This project is translated in English, French and German, if you wish to help translating, please send me an email.



Have Fun :)

Commentaires

smartd.conf with [] bug? smartd -q showtests shows none.

C:\Program Files\smartmontools for Windows\bin>smartmontools-win-6.01-3.exe

C:\Program Files\smartmontools for Windows\bin>services.msc

When end of the generated smartd.conf was: (S/./././11|L/././[5]/12) then smartd -q showtests listed 0 (zero tests) scheduled (full transcript below).

When I replaced the [5] with .. to have (S/../.././11|L/../../6/13) then tests actually are scheduled:

Totals [Wed Dec 05 21:17:34 2012 CST - Tue Mar 05 21:17:34 2013 CST]:
Device: /dev/sda, will do 13 tests of type L
Device: /dev/sda, will do 90 tests of type S
Device: /dev/csmi2,0, will do 13 tests of type L
Device: /dev/csmi2,0, will do 90 tests of type S
Device: /dev/csmi2,0, will do 0 tests of type C
Device: /dev/csmi2,0, will do 0 tests of type O
Device: /dev/csmi2,1, will do 13 tests of type L
Device: /dev/csmi2,1, will do 90 tests of type S
Device: /dev/csmi2,1, will do 0 tests of type C
Device: /dev/csmi2,1, will do 0 tests of type O

C:\Program Files\smartmontools for Windows\bin>notepad smartd.conf

Below is full info on what I was using that generated smartd.conf with the [5] that seems to silently cause smartd to fail to run tests (I verified that the tests were not actually run, so it is correct in saying 0 (zero) tests scheduled.

C:\Program Files\smartmontools for Windows\bin>smartd -q showtests
smartd 6.0 2012-10-10 r3643 [i686-w64-mingw32-xp-sp3] (sf-6.0-1)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org

Opened configuration file C:/Program Files/smartmontools for Windows/bin/smartd.
conf
Configuration file C:/Program Files/smartmontools for Windows/bin/smartd.conf wa
s parsed, found DEVICESCAN, scanning devices
Device: /dev/sda, opened
Device: /dev/sda, [Intel Raid 1 Volume 1.0.], lu id: 0x44d063a700000000001517
ffff0aeb84, 251 GB
Device: /dev/sda, does not support SMART Self-Test Log.
Device: /dev/sda, is SMART capable. Adding to "monitor" list.
Device: /dev/csmi2,0, opened
Device: /dev/csmi2,0, WDC WD2503ABYX-01WERA1, S/N:WD-WMAYP4748856, WWN:5-0014ee-
0036b9475, FW:01.01S02, 251 GB
Device: /dev/csmi2,0, found in smartd database: Western Digital RE4 Serial ATA
Device: /dev/csmi2,0, is SMART capable. Adding to "monitor" list.
Device: /dev/csmi2,1, opened
Device: /dev/csmi2,1, WDC WD2503ABYX-01WERA1, S/N:WD-WMAYP4830290, WWN:5-0014ee-
0036b937b, FW:01.01S02, 251 GB
Device: /dev/csmi2,1, found in smartd database: Western Digital RE4 Serial ATA
Device: /dev/csmi2,1, is SMART capable. Adding to "monitor" list.
Monitoring 2 ATA and 1 SCSI devices

Next scheduled self tests (at most 5 of each type per device):

Totals [Wed Dec 05 21:09:25 2012 CST - Tue Mar 05 21:09:25 2013 CST]:
Device: /dev/sda, will do 0 tests of type L
Device: /dev/sda, will do 0 tests of type S
Device: /dev/csmi2,0, will do 0 tests of type L
Device: /dev/csmi2,0, will do 0 tests of type S
Device: /dev/csmi2,0, will do 0 tests of type C
Device: /dev/csmi2,0, will do 0 tests of type O
Device: /dev/csmi2,1, will do 0 tests of type L
Device: /dev/csmi2,1, will do 0 tests of type S
Device: /dev/csmi2,1, will do 0 tests of type C
Device: /dev/csmi2,1, will do 0 tests of type O

C:\Program Files\smartmontools for Windows\bin>type smartd.conf
# This is a generated smartd.conf file by smartmontools for Windows installer
# http://www.badministrateur.com
DEVICESCAN -H -l error -f -t -l selftest -I 194 -m console, -M exec "e
rroraction.cmd" -n sleep,7,q -s (S/./././11|L/././[5]/12)

C:\Program Files\smartmontools for Windows\bin>smartd -q onecheck
smartd 6.0 2012-10-10 r3643 [i686-w64-mingw32-xp-sp3] (sf-6.0-1)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org

Opened configuration file C:/Program Files/smartmontools for Windows/bin/smartd.
conf
Configuration file C:/Program Files/smartmontools for Windows/bin/smartd.conf wa
s parsed, found DEVICESCAN, scanning devices
Device: /dev/sda, opened
Device: /dev/sda, [Intel Raid 1 Volume 1.0.], lu id: 0x44d063a700000000001517
ffff0aeb84, 251 GB
Device: /dev/sda, does not support SMART Self-Test Log.
Device: /dev/sda, is SMART capable. Adding to "monitor" list.

smartd.conf has wrong number of dots in -s (S/./././9|L/./././10

I think, at least in some cases, the smartd.conf has wrong number of dots in schedule.

NOT OK: -s (S/./././9|L/./././10) (smartd -q showtests lists 0 tests scheduled)

OK: (S/../.././09|L/../.././10) (smartd -q showtests shows 93/91 tests scheduled)

To Manually edit: Start -> Run ->

Notepad "C:\Program Files\smartmontools for Windows\bin\smartd.conf"

To verify smartd.conf is ok:

"C:\Program Files\smartmontools for Windows\bin\smartd" -q showtests

Also suggest install default to "C:\Program Files\smartmontools-win" (or similar with NO spaces " " in path) instead of

C:\Program Files\smartmontools for Windows\

If no spaces in path, easier to script sanity check(s).

6.0-5 smartmontools for Windows seems to fix bug in smartd.conf

Good work! 6.0-5 smartmontools for Windows seems to fix bug in smartd.conf with -s (wrong number of "." dots).

SANITY TEST (output of smartd -q showtests) is OK now!

C:\Program Files\smartmontools for Windows\bin>smartd -q showtests

smartd 6.0 2012-10-10 r3643 [i686-w64-mingw32-xp-sp3] (sf-6.0-1)

...
Totals [Thu Feb 07 20:20:28 2013 EST - Wed May 08 21:20:28 2013 EDT]:
Device: /dev/sda, will do 13 tests of type L
Device: /dev/sda, will do 90 tests of type S
Device: /dev/sda, will do 0 tests of type C
Device: /dev/sda, will do 0 tests of type O

One last request... maybe inno installer could create a file in install dir with version number, like: smartmontools-win-6.01-5.txt

Prohibit Windows Bootup

When smartmontool is configured to report nonzero current pending sector (for example) and one or more of the HDD has such error, a reboot of Windows (I am using Win2008R2) will cause a pop up window to report the error. Problem is that this prohibit remote terminal access to the server until the pop-up window is dismissed directly on the console. This is causing problem for servers sitting in datacenter which administrators don't readily have physical access to the server. Work-around is to configure the smartmontool windows service as "Automatic (Delayed Start)".

use gmail as smtp

The email facility doesn't work with gmail because there is no option to to configure smtp port.
I did a few changes in erroraction.cmd in order to get it working.
in smtp server -s smtp.gmail.com:587, in username and password, -xu me@gmail.com, -xp MY-PASSWORD

Now it works like a charm.