[MacPorts] #25613: smartmontools 5.39.1 Logging does not function
MacPorts
noreply at macports.org
Thu Jul 7 20:52:04 PDT 2011
#25613: smartmontools 5.39.1 Logging does not function
-------------------------------+--------------------------------------------
Reporter: scott@… | Owner: takanori@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 1.9.1
Keywords: log syslog smartd | Port: smartmontools
-------------------------------+--------------------------------------------
Comment(by dan@…):
Replying to [ticket:25613 scott@…]:
> Nothing as far as I can tell is sent to /var/log/system.log. I believe
that would be the correct place for this. If another location was
determined to be in for example /opt/local/var/log/smartmontools.log then
an entire syslog mechanism would have to be installed and configured along
with it.
I've been looking at smartd logging and would suggest that messages should
go to the Apple System Log (ASL) default data store. This is the database
displayed by Console.app and is intended to replace the individual log
files like /var/log/system.log (per the syslogd man page).
To get smartd messages in ASL, one can make either of the following
changes to /etc/asl.conf:
* add this line if smartd is using the default --logfacility=daemon to
log messages at all levels (info, etc.) with facility equal to daemon:
{{{
#? [= Facility daemon] store
}}}
* change 'notice' to 'info' in the following existing entry in
/etc/asl.conf since smartd seems to log most everything at the info level:
{{{
# save everything from emergency to notice
? [<= Level notice] store
}}}
The second change will pick up and log all messages logged with
level=info, not just the ones from smartd. Therefore, the first change
might be more desireable. But the facility in the first change must match
smartd's --logfacility parameter.
> According to the snip above, 'daemon' is the default, which Mac OS X
does not have a logging channel for. What is the correct procedure to
solve this? Not everyone will use the mail feature of smartd to get an
alert, and I think it is important to also have this logged to syslog.
Not everyone has `mail` functioning on their local systems.
>
> Ideally, no edits would need to be made to /etc/syslog.conf. Is this
simply a matter of altering the launcd item to add --logfacility=notice ?
In addition to putting messages in the ASL data store, you could also have
them written to a logfile. syslog.conf controls this. However, your
proposed change doesn't work. 'notice' isn't a facility, its a level
(priority). Smartd seems to use the info level for most messages and
critical for some. Only the facility can be changed on the command line.
smartd reported the following valid values:
{{{
=======> VALID ARGUMENTS ARE: daemon, local0, local1, local2, local3,
local4, local5, local6, local7 <=======
}}}
Since the default syslog.conf doesn't log much at info or below, it would
need to be changed to put messages into a log file in addition to/instead
of ASL.
--
Ticket URL: <https://trac.macports.org/ticket/25613#comment:4>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list