[smartmontools-support] smartd and blat issue

Christian Franke Christian.Franke at t-online.de
Sat Sep 1 15:27:00 CEST 2018


Sergiu wrote:
> I am trying to set smartd with blat to send email if an error is 
> caught but I can't seem to make a proper setting.

Please provide smartmontools and Windows version, for example provide 
the first line of smartctl output.


> At first I set smartd to access blat.exe but blat always returned an 
> exit status 1:
>
>     smartd[8580]:CRIT: Test of blat.exe to ...: failed, exit status 1
>

Blat is the default, so there is no need to specify '-M exec blat.exe'. 
If blat.exe it is not in the same directory as smartd.exe, it's location 
should be in the system(!) PATH.

 From smartd.conf man page:
"[Windows only] On Windows, the syntax of the 'Blat' mailer is used 
(except for '.ps1' scripts):
   − −q −subject "%SMARTD_SUBJECT%" −to %SMARTD_ADDRCSV%"

Blat has to be configured with 'blat -install ...' such that this 
command works:

   echo Test | blat − −q −subject "Test" −to YOUR_MAIL_ADDRESS


> Now , I have created a batch file to set the server name and account:
>
>     blat.exe -server server.mail.com -f ... -to ...
>
> and set smartd to execute it. Now the test email is sent but I still 
> receive an error each time from blat:
>
>     smartd[11488]:CRIT
>     Test of blat.bat to ...produced unexpected output (202 bytes) to
>     STDOUT/STDERR:
>     Blat v3.2.19 (build : Nov 18 2017 03:14:35)
>     32-bit Windows, Full, Unicode
>     Sending stdin.txt to ...
>     ...<mailto:sender at mail.com>
>

This is not an error from blat. See smartd.conf man page:
"If the executable produces any STDERR/STDOUT output, then smartd 
assumes that something is going wrong, and a snippet of that output will 
be copied to SYSLOG."

Add -q as above to silence blat's default output.

You might also want to try new PowerShell mailing script which works 
without any external mailer: Remove '-M exec' from smartd.conf. Create 
'smartd_mailer.conf.ps1' file in smartd.exe directory (see 
'smartd_mailer.conf.sample.ps1').

Thanks,
Christian




More information about the Smartmontools-support mailing list