Giter Site home page Giter Site logo

deajan / smartmontools-win Goto Github PK

View Code? Open in Web Editor NEW
51.0 6.0 15.0 184 KB

smartmontools for windows package providing automated / mass installation and email alert support out of the box for hard drive SMART functionality. Scriptable for unattended or GUI end user install.

License: GNU General Public License v2.0

Inno Setup 40.47% Batchfile 15.56% Python 43.97%
smartmontools smartd harddrive harddisks alert smartmontools-win all-in-one unattended-installation

smartmontools-win's Introduction

Smartmontools for Windows Package

(C) 2012-2020 Orsiris de Jong - http://www.netpower.fr

Smartmontools For Windows is an alternate package for smartmontools by Bruce Allen and Christian Franke, that has been created to smoothly install smartmontools as service, support out of the box mail or local alerts, and configure smart daemon options with a graphical user interface. Installation can be run silently with command line parameters for massive deployments, or with a graphical user interface.

Configuration files are automatically generated (but you can still enjoy manual editing of course). A service called "smartd" is created and launched at system startups. This service will enumerate hard disks smartmontools can monitor and send an email and/or show a local message in case of errors. Everytime smartd detects an issue, the current states of the drives are written to smart.log and an alert is triggered. When mail / local alerts are triggered, all actions regarding alerts are logged to erroraction.log.

On install, the current states of all drives smartd can detect are written to smartmontools-install-(version).log for warranty issues.

The software has been tested on multiple platforms, nevertheless no responsibility will be taken for any problems or malfunctions that may occur while using this software. Anyway, feel free to send a mail to ozy [at] netpower.fr for support on my free time.

Upgrade path

The configuration from previous installations is now kept (unless a smartd.conf and/or and erroraction_config.cmd file is provided along with the installer script). The commandline options of the installer have heavily changed. Be sure to update your mass installer scripts according to new commandline syntax (see below).

Copyrights

The package itself, the python interfaces and it's source code is licensed under GPLv2. Additionnaly, it uses the following free software:

Binaries

You'll find the latest binaries at http://www.netpower.fr/smartmontools-win

Useful command line parameters

smartmontools-win-6.6-x.exe [OPTIONS]

[OPTIONS]

/COMPONENTS="comma separated list of component names"

This setting overrides the default selection.

Valid components are: core Basic install, cannot be unselected core\service Install smartd service core\service\gui Graphical user interface for smartd and alerts core\service\mailalert On alerts send an email core\service\localalert On alerts show messages on screen core\scheduledtestalerts Trigger a test alert every month fixbadsecttools Fix bad sector script regext Register SMART right click actions on drives updatedb Update drive database right after installation authorlinks Include links to the authors websites statistics Send anonymous install statistics

/SILENT Installs smartmontools-win silently, without showing the configuration GUI.

/SUPPRESSMSGBOXES Removes the configuration files overwrite confirmation and keep the original configuration (unless new config files are supplied along with the installer).

/HELP Shows all possible commandline switches

See examples below

Unattended examples

You may want to preconfigure smartd settings or alert setting when making an unattended installation. In that case you can install the package on a test computer, use the GUI to configure the service and alerts, and use the generated configuration files for a mass installation. Putting a preconfigured smartd.conf file along with the setup exe will load it automatically. Putting a preconfigured erroraction_config.cmd file along with the setup exe will automatically configure alert options. Example files can be found at https://github.com/deajan/smartmontools-win/tree/master/unattended

Put the following files in the same directory

  • smartmontools-win-7.1-1.exe
  • smartd.conf
  • erroraction_config.cmd

Then run: smartmontools-win-7.1-1.exe /COMPONENTS="core\service,core\service\gui,core\service\mailsupport,updatedb,regext,authorlinks,statistics" /SUPPRESSMSGBOXES /SILENT

Compilation

Compilation works with Inno Setup & Inno Preprocessor 5.5+. You'll need to download all the software mentionned above and extract them to the corresponding directories listed in main iss file.

Build python executables

In order to build python executables from source, you'll need:

pip install pygubu pywin32 cx_freeze

You may then run cxsetup.py in order to create executable versions of smartd-pyngui and erroraction_config

smartmontools-win's People

Contributors

c72578 avatar deajan avatar gmzwinge avatar mineo avatar osterik avatar pspacek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

smartmontools-win's Issues

workaround to false alarm on external disk removing

Yet another problem , probably in vanilla smartmontools core: Windows version alerts every external disk remove as problem (FailedOpenDevice error). May be missing hook on unmount? (different way as in Linux?) Most of my users uses external disks and do not disting (by device name - it uses unix dev instead Win X:) if problems is on local HD (serious) or external HD (removing is in fact false alarm).

May be SMT core/windows team will fix this soon. but in other case it will be nice make on alert routine some kind of filter to filter out this false alarm...
Zdenek Hladik

Support for e-mail password with space

Using an e-mail password that contains a space fails, at least when sending a test e-mail during the installation procedure of the smartmontools-win package.

A space is a valid character for passwords with most e-mail providers.

When clicking to send the test e-mail, the resulting error suggests the password field is not enclosed with quotes ("... pass ..."), when executing sendemail.exe to send the e-mail.

GUI?

Love this tool guys.

Got the service install, working great.

Am I missing something or how do I actually get to the GUI? I'm not sure what file it is?

THX!

Setup screen unusable in 1366x768

My laptop has a 1366x768 screen, and I cannot see the last part of the setup screen, ie the 2nd Email option and the Save & Exit buttons.

There is a scrollbar but it does not help...

PS : Logiciel trouvé grâce à l'article dans le magasin allemand C't.

smartd service do not start after installion

smartmontools for windows setup file version; 6.6.1.3

Installation command line: smartmontools-win.exe --localmessages=yes --warningmessage="warning..." --compresslogs=no /silent

service start error message: windows clould not start the SmartD service on local computer. For more information, review the System Events log.

The Event Log: The SmartD Service service terminated with service-specific error The system cannot find the file specified..

smartd.conf

DEVICESCAN -H -C 197+ -l error -U 198+ -l selftest -t -f -W 20,55,60 -n sleep,7,q -s (L/../../[5]/13|S/../../[1234567]/10) -m -M exec 'C:\Program Files\smartmontools for Windows\bin\erroraction.cmd'

OS win 10

Smartd service won't start - release 6.6.1

Thank you for this project. I wanted to let you know that there is an issue with smartd.exe in the 6.6.1 release.

I just tried installing this fresh on a windows 7 x64 pc and could not get the smartd service to run.
Here is the message from eventlog:

smartd[2436]:CRIT
File C:\Program Files\smartmontools for Windows\bin\smartd.conf line 3 (drive DEVICESCAN): unknown Directive: Files\smartmontools
Run smartd -D to print a list of valid Directives.
Configuration file C:\Program Files\smartmontools for Windows\bin\smartd.conf has fatal syntax errors.

Once I saw this I also tried editing the conf file and replacing DEVICESCAN with /dev/sda but this still did not work.

The contents of the config was default except for changing the scheduled time for tests

False positive email after system boot when using Seagate disk

I'm using this great software to monitor the smart value of the disks on several windows machines. It works quite well. But a few weeks ago I installed a Seagate disk to one of my machines and since that I always get a SMART warning directly after booting this machine.
I'm not sure if it's an issue related to smartmontools for windows. It seems to be a problem with the temperature value that is provided by this Seagate disk. I somewhere read, that Seagate uses some weird temperature values. Perhaps you can tell me, how to overcome these problems. The SMART status of the Seagate disk right after booting the machine is the following:

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.14 (AF)
Device Model:     ST1000DM003-1ER162
Serial Number:    XXXXXXXX
LU WWN Device Id: X XXXXXX XXXXXXXXX
Firmware Version: CC45
User Capacity:    1.000.204.886.016 bytes [1,00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Wed Jun 10 08:16:47 2015 MS
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.

(...)

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   119   099   015    Pre-fail  Always       -       206334736
  3 Spin_Up_Time            0x0003   097   097   003    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   050    Old_age   Always       -       8
  5 Reallocated_Sector_Ct   0x0033   100   100   051    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   069   060   015    Pre-fail  Always       -       8271071
  9 Power_On_Hours          0x0032   099   099   050    Old_age   Always       -       1433
 10 Spin_Retry_Count        0x0013   100   100   019    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   050    Old_age   Always       -       8
183 Runtime_Bad_Block       0x0032   100   100   050    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   050    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   050    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   050    Old_age   Always       -       0 0 0
189 High_Fly_Writes         0x003a   100   100   058    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   072   065   034    Old_age   Always       -       28 (Min/Max 24/35)
191 G-Sense_Error_Rate      0x0032   100   100   050    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   050    Old_age   Always       -       0
193 Load_Cycle_Count        0x0032   098   098   050    Old_age   Always       -       4200
194 Temperature_Celsius     0x0022   028   040   034    Old_age   Always   FAILING_NOW 28 (0 17 0 0 0)
197 Current_Pending_Sector  0x0012   100   100   018    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   016    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   062    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       1425h+26m+54.634s
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       1444958427
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       14382033185

Reconfigure SMART Alert settings: Cannot read in config file, erroraction_config.cmd

When starting "Reconfigure SMART Alert settings" I get the following error message:
"Cannot read in config file [C:\Program Files\smartmontools for Windows\bin\erroraction_config.cmd].

This happens every time.
There is no difference if "Reconfigure SMART Alert settings" is started from the program menu entry, from the command line or as admin.
It was also tried to save and use "erroraction_config.cmd" in a different location, e.g. "e:\erroraction_config.cmd" with full permissions - no effect.

This occurs with the following versions:
smartmontools-win-6.5-1.exe
smartmontools-win-6.5-2-dev.exe

OS: Windows 7 SP1, 64 bit

smartmontools-win_cannot_read_in_config_file

Bug in smartd service detection

Hi,
if I manually uninstall smartd service (I tryeing silent uninstall your tool, but one window still popup), then uninstallation program give back :

"There is a smartd service is installed which does not seem to belong to smartmontools-win. Do you want to uninstall it ?"

I think problem is with this code "smartmontools for Windows includes.iss":

ShellExec('', ExpandConstant('{cmd}'), ExpandConstant('/C {sys}\sc.exe qc ' + srv + ' | findstr "BINARY_PATH_NAME" | findstr /C:"\\smartmontools for Windows\\"'), '', SW_HIDE, ewWaitUntilTerminated, resultcode);

You trying find english name, but Windows translate most of internal strings.
So, in another language does not exist name "BINARY_PATH_NAME".

BTW, I would like to completly clear some PC, I do no want to stop using your tools. It is very nice and useful. Thanks for your work.

Max
PS: I think I have now only one option to uinstall this program in silent mode, force remove all from directories and from registry via own batch file, or do you have any other idea?

mail over SSL

Do you plan to support SSL?
ISPs do not allow to connect to my server's port 25. (only to their SMTP)

Minor typo in installer

Just a heads up - in the installer, on the "select components" screen there is a typo.

"Context menu for drvies" rather than "drives"

Thanks for this tool. 👍

Path erroraction.cmd

in order for the service to start without error message, i had to reconfigure the following path:

"C:\Program\sFiles\smartmontools\sfor\sWindows\bin\erroraction.cmd"

I had to replace the blanks with regex expression \s

...by the way: Where can i find the newest smartmontools-win-7.1-1.exe ?

Announcement: smartmontools-win 7.0 branch

As said in the main announcement, I am currently developping a new GUI that works with the incredible PySimpleGUI framework.
My plan is to release a wx version which can be packaged lighter than a Tcl/Tk version.

Also, next version won't rely on gzip.exe, mailsend.exe or erroraction.cmd.

So far, the GUI is designed and works well with smartd.conf files.
Mail sending works too and is now integrated in the GUI app.

I have done some work on the Nuitka compiler in order to achieve smaller distribution files recently.

so far, the new GUI:

image

Open to suggestions.

Error getting computer name if computer does not belong to a domain

in erroraction.cmd the GetComputerName procedure never sets COMPUTER_FQDN if USERDOMAIN and USERDNSDOMAIN are empty.

I propose

:GetComputerName
set COMPUTER_FQDN=%COMPUTERNAME%
IF NOT "%USERDOMAIN%"=="" set COMPUTER_FQDN=%COMPUTER_FQDN%.%USERDOMAIN%
IF NOT "%USERDNSDOMAIN%"=="" set COMPUTER_FQDN=%COMPUTER_FQDN%.%USERDNSDOMAIN%
GOTO:EOF

to set COMPUTER_FQDN and from then, correct the rest.

This is really important because you receive an error from an unknown computer, and the only clue on the rest of the log is the serial number.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.