Opened 6 years ago
Closed 6 years ago
#1063 closed defect (worksforme)
smartd_mailer.ps1 does not work
Reported by: | Mateus Henrique | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | smartd | Version: | 6.6 |
Keywords: | smartd.conf windows | Cc: |
Description
Hi all.
Firstly, thx for this great software contribuition.
I'm having problems with experimental email sender feature of Windows version (PowerShell). How this really works?
Well....We have bin folder structure script/conf files:
smartd.conf
smartd_mailer.conf.sample.ps1
smartd_mailer.ps1
smartd_warning.cmd
According wiki (https://www.smartmontools.org/browser/trunk/smartmontools/smartd.conf.5.in) and my understanding, first we need to create/manage directives to determine actions.
Ex: Generate Logs by bad blocks, bad life hard disk and send mail...
I'm using Windows 10 release 1803 x64 and version 6.6.207-11-05 r4594 (sf-6.6.1)
My problem, is now...
- What hierarchy of setting up files? Who file come's first, who depend who, who call who? Basically: smartd.conf => smartd_warning.cmd => defines what mail sender => smartd_mailer.ps1 => read SMTP data => smartd_mailer.conf.sample.ps1 Is that correct?
- smartd.conf call smartd_warning.cmd with -M exec? But, in the wiki says:
If the file EXEDIR/smartd_mailer.conf.ps1 is present and '-M exec' is not specified, the script smartd_mailer.ps1 is used instead.
This script uses the Send-MailMessage cmdlet to send mail. See EXEDIR/smartd_mailer.conf.sample.ps1 for info about the format of the configuration file.
- smartd_warning.cmd verify what's and call default mailer.
if smartd_mailer.ps1 exists, AND -M exec directive not specified, automatically will use PowerShell method, right?
- About script smartd_warning.cmd, When I run, he everytime say: "smartd_warning.cmd: SMARTD_ADDRESS or SMARTD_MAILER must be set"
How I can set these variables?
I just tried uncomenting echo, and increment values to specified vars.
- How I can test if a mail is working correctly? I trying but no success. Using -M test not working.
Thx.
Change History (3)
comment:1 by , 6 years ago
Component: | all → smartd |
---|---|
Keywords: | smartd.conf windows added; help mail powershell not work removed |
Summary: | Help about basic to work. → smartd_mailer.ps1 does not work |
comment:2 by , 6 years ago
Replying to Mateus Henrique:
- What hierarchy of setting up files? Who file come's first, who depend who, who call who?
If smartd.conf
specifies -m ADDRESS
, then smartd.exe
always runs smartd_warning.cmd
. Parameters are passed via environment (SMARTD_ADDRESS=ADDRESS
, see man page for others). If -M exec PATH
is not specified (SMARTD_MAILER
unset) and smartd_mailer.conf.ps1
is present, then smartd_warning.cmd
runs smartd_mailer.ps1
.
- smartd.conf call smartd_warning.cmd with -M exec? ...
Never(!) use smartd_warning.cmd
or smartd_mailer.ps1
as -M exec
parameter. If -M exec PATH
is specified, smartd.exe
sets SMARTD_MAILER=PATH
and then smartd_warning.cmd
runs the executable at PATH
.
- smartd_warning.cmd verify what's and call default mailer.
if smartd_mailer.ps1 exists, AND -M exec directive not specified, automatically will use PowerShell method, right?
No. If smartd_mailer.conf.ps1
is not present, smartd_warning.cmd
will use blat.exe
to send mail.
- About script smartd_warning.cmd, When I run, he everytime say: "smartd_warning.cmd: SMARTD_ADDRESS or SMARTD_MAILER must be set"
How I can set these variables?
C:\Program Files\smartmontools\bin>smartd_warning.cmd smartd_warning.cmd: SMARTD_ADDRESS or SMARTD_MAILER must be set C:\Program Files\smartmontools\bin>set SMARTD_ADDRESS=some.name@some.where C:\Program Files\smartmontools\bin>smartd_warning.cmd [No output -> Mail sent to some.name@some.where] C:\Program Files\smartmontools\bin>smartd_warning.cmd --dryrun ... [Long debug output, no mail sent]
- How I can test if a mail is working correctly? I trying but no success. Using -M test not working.
If -M test
does not work, please run smartd -q onecheck
in an admin console and provide its output and the smartd.conf
used. Use an attachment or wiki markup for preformatted text (do not use screenshots).
comment:3 by , 6 years ago
Milestone: | undecided |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
The script smartd_mailer.ps1 works as expected. No feedback from reporter.
This is a bug tracker, not a support forum. For future support questions, please use the smartmontools-support mailing list instead.