Bruce Allen | 1 Feb 2003 09:55
Picon
Favicon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Phil, Tim,

I think that this is finally converging.  I've implemented and documented
the following:

-m address : just sends mail using 'mail' command in environment's path

-m address -M exec /a/path : sends mail using /a/path

-m <nomailer> -M exec /a/path: just runs /a/path with no STDIN or command
                               line arguments at all.

In all three cases a number of environment variables are set before
anything is run.

I have made the manual pages consistent with the code, and I've tested
the example scripts from the manual.

Phil, the one request I have is that I'd like you to back out the 'double
quote' interpretation from smartd.c.  In other words if the user says
  -M exec /not/a path
this is (currently, and correctly) an error

If the user says
-M exec "/not/a path"
this is NOT currently an error, but I'd like it to be one! The error
message should just say something along the standard lines of:
.... path" is not a Directive.

In other words, I want to go back to white-space delimited tokens only.
(Continue reading)

Phil Williams | 1 Feb 2003 14:31
Picon
Picon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Bruce,

> I've revised the man page for smartd/smartd.conf some more so that it
> explains how I'd like the -m option to work.  The code is more or less in
> agreement with this, although it doesn't complain if the user sets -M exec
> /a/path WITHOUT -m appearing.  As the manual page currently reads, this
> should be an error -- it's supposed to require -m but without an address.

Weren't we going to make the '-m' optional if '-M exec' is used but require an
email address if '-m' is used?  Did that turn out not to be a good idea when
you came to implement it?

> In looking through the parser (which I wrote and you revised) it appears
> that it may be hard to handle this case -- it might be better to always
> have fixed numbers of arguments to -m.   Otherwise the code when
> fed 
> 
> /dev/hda -m -s on -M daily
> 
> might use "-s" as the argument to -m.
> 
> Could you tell me if you think it's reasonable to make the code conform to
> the documenation I have written?  Or would we be better having a
> "bogus" argument to -m that doesn't correspond to a valid email address,
> as a signal to use a script.  For example we could have
>   -m <none>
> or
>   -m <script>
> or
>   -m <exec>
(Continue reading)

Phil Williams | 1 Feb 2003 14:39
Picon
Picon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Bruce,

> Phil, the one request I have is that I'd like you to back out the 'double
> quote' interpretation from smartd.c.  In other words if the user says
>   -M exec /not/a path
> this is (currently, and correctly) an error
> 
> If the user says
> -M exec "/not/a path"
> this is NOT currently an error, but I'd like it to be one! The error
> message should just say something along the standard lines of:
> .... path" is not a Directive.
> 
> In other words, I want to go back to white-space delimited tokens only.

No problem (but it won't happen until tomorrow at least, I'm afrad).  Is there
an easy way using CVS to back my changes out without breaking all of your later
changes, or should I do it 'by hand'?

Phil

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Bruce Allen | 3 Feb 2003 01:32
Picon
Favicon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

> >   -m <use_exec_path>
> > 
> > since angle brackets are not allowed in email addresses.
> > 
> > At this point I think that this might make the documentation and code
> > simpler.  What do you think??
> 
> I can't see any easy way of making the argument optional either.  I like
> '-m <none>' of the examples you gave.

I ended up choosing
   -m <nomailer>
but it's trivial to change this in the code and documentation if you feel
strongly about it.

Bruce

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Bruce Allen | 3 Feb 2003 01:35
Picon
Favicon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

> > Phil, the one request I have is that I'd like you to back out the 'double
> > quote' interpretation from smartd.c.  In other words if the user says
> >   -M exec /not/a path
> > this is (currently, and correctly) an error
> > 
> > If the user says
> > -M exec "/not/a path"
> > this is NOT currently an error, but I'd like it to be one! The error
> > message should just say something along the standard lines of:
> > .... path" is not a Directive.
> > 
> > In other words, I want to go back to white-space delimited tokens only.
> 
> No problem (but it won't happen until tomorrow at least, I'm afrad).  
> Is there an easy way using CVS to back my changes out without breaking
> all of your later changes, or should I do it 'by hand'?

I don't know how to make CVS do this, but I think it may be possible.
Without investigating CVS, here's what I might try:

do:
  cvs diff -r 1.X -r 1.X+1
where revisions X and X+1 are the versions just before and just after you
committed your changes.

Then, take the diff output and apply it using "patch" to the latest
version of the code.  It *might* complain because the line numbering no
longer agrees, but might be able to find the right location from context
information.

(Continue reading)

Bruce Allen | 3 Feb 2003 04:59
Picon
Favicon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Phil,

> > > In other words, I want to go back to white-space delimited tokens only.
> > 
> > No problem (but it won't happen until tomorrow at least, I'm afrad).  
> > Is there an easy way using CVS to back my changes out without breaking
> > all of your later changes, or should I do it 'by hand'?

Just to be clear, I definitely don't want you to back out your changes
regarding the additional structures in conf-> for the different
options.  Just the changes that make it possible to parse a double-quote
delimited string.

So I doubt that doing this automatically is an option.  I think you'll
have to do it the old fashioned way...

Cheers,
	Bruce

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Phil Williams | 3 Feb 2003 20:27
Picon
Picon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Bruce,

> > > > In other words, I want to go back to white-space delimited tokens only.
> > > 
> > > No problem (but it won't happen until tomorrow at least, I'm afrad).  
> > > Is there an easy way using CVS to back my changes out without breaking
> > > all of your later changes, or should I do it 'by hand'?
> 
> Just to be clear, I definitely don't want you to back out your changes
> regarding the additional structures in conf-> for the different
> options.  Just the changes that make it possible to parse a double-quote
> delimited string.
> 
> So I doubt that doing this automatically is an option.  I think you'll
> have to do it the old fashioned way...

OK, that's done, and like you suggested a while back, I added an info message
for the case that -M exec appears more than once on a line.

Phil

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Phil Williams | 3 Feb 2003 20:29
Picon
Picon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Bruce,

On Sun, Feb 02, 2003 at 06:32:27PM -0600, Bruce Allen wrote:
> > >   -m <use_exec_path>
> > > 
> > > since angle brackets are not allowed in email addresses.
> > > 
> > > At this point I think that this might make the documentation and code
> > > simpler.  What do you think??
> > 
> > I can't see any easy way of making the argument optional either.  I like
> > '-m <none>' of the examples you gave.
> 
> I ended up choosing
>    -m <nomailer>
> but it's trivial to change this in the code and documentation if you feel
> strongly about it.

No, that's fine.

Phil

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Bruce Allen | 3 Feb 2003 20:54
Picon
Favicon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Phil,

> > Just to be clear, I definitely don't want you to back out your changes
> > regarding the additional structures in conf-> for the different
> > options.  Just the changes that make it possible to parse a double-quote
> > delimited string.
> > 
> > So I doubt that doing this automatically is an option.  I think you'll
> > have to do it the old fashioned way...
> 
> OK, that's done, and like you suggested a while back, I added an info message
> for the case that -M exec appears more than once on a line.

Thanks for doing this.

I'm going to work on one additional change that Tim requested.  The idea
is that if:
  DEVICESCAN
is present in smartd.conf, to allow it to take arguments that apply to all
the disks that are found, eg:
  DEVICESCAN -m root <at> home

Phil, I have an additional request -- could you please update the blurb at
the end of README to explain the multiple -M options eg -M daily -M test
rather than -M test,daily?  This README blurb is meant mostly for 5.0.x
users so we should tell them how the latest version of 5.1 works.

Cheers,
	Bruce

(Continue reading)

Bruce Allen | 6 Feb 2003 19:59
Picon
Favicon

Re: Patch to add output of "smartctl -a" to smartd's mail message if -M enabled

Hi Phil, Tim,

I'm getting close to issuing another smartmontools release.  But I wanted
to ask the two of you for a hand in testing the code and documentation
that I've checked into CVS before I generate a new release.

I've made three changes.  (Tim, if I remember the history correctly, the
first two of these are in response to suggestions that you made.)

First, I've implemented and documented the /etc/smartd.conf Directives:
   -m ADDRESS -M exec /a/path
and
   -m <nomailer> -M exec /another/path

Second, I've make the DEVICESCAN Directive capable of taking all the same
Directives as a device path can take.  So you can now say
    DEVICESCAN -m tim <at> work
or 
    DEVICESCAN -d ata -H tim <at> home

or
    DEVICESCAN -m <nomailer> -M /another/path

Third, I've added a command-line option to smartd:
    -c
    --checkonce
which is meant for use by Distribution Installer writers.  It makes smartd
run in foreground mode, and exit with zero status after a sucessful pass
through registering/checking the disks.  It can be used to automatically
verify that smartd "works" on a given system.
(Continue reading)


Gmane