Opened 14 years ago

Closed 9 years ago

#25613 closed defect (fixed)

smartmontools 5.39.1 Logging does not function

Reported by: scott@… Owned by: takanori@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: log syslog smartd Cc: ddissett (daniel dissett)
Port: smartmontools

Description

smartmontools is a package that contains smartctl and smartd, this report is in regards to smartd only.

All documentation states that logging messages will be sent to 'SYSLOG'. The smartd man page specifically states:

-l FACILITY, --logfacility=FACILITY Uses syslog facility FACILITY to log the messages from smartd. Here FACILITY is one of local0, local1, ..., local7, or daemon [default]. If this command-line option is not used, then by default messages from smartd are logged to the facility daemon.

Further, emails generated for alert or testing state:

For details see host's SYSLOG (default: /var/log/messages).

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.

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 ?

I spent a bit of time trying to figure out if this software was even working, to learn that my mta was off. This would have been logged to syslog, which I was tail -fing just as I -HUP'd smartd, but nothing showed up. I browsed the source a little to see if I thought it was solvable there, or with a configure arg, but I don't believe that to be the case.

This is not my area of expertise, but if someone can tell the correct approach to fixing it, I would like to give it a try. I would also like to try to add in a +growl variant for instant alerts on screen which has it's own mail feature as well.

Change History (6)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Keywords: smartmontools removed
Owner: changed from macports-tickets@… to toby@…

Please remember to cc the maintainer.

comment:2 in reply to:  1 Changed 14 years ago by scott@…

Replying to jmr@…:

Please remember to cc the maintainer.

Sorry, I though that I had in the past, to have the ticket edited and the CC removed, giving me the impression I was not supposed to, I will do so from now on.

comment:3 Changed 13 years ago by tobypeterson

Owner: changed from toby@… to takanori@…

comment:4 in reply to:  description Changed 13 years ago by ddissett (daniel dissett)

Replying to 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.

comment:5 Changed 13 years ago by ddissett (daniel dissett)

Cc: dan@… added

Cc Me!

comment:6 Changed 9 years ago by pixilla (Bradley Giesbrecht)

Resolution: fixed
Status: newclosed

Smartmontools has been updated to version 6.3 and has been working for me during several days of testing. Please reopen this ticket if your issues persist.

Note: See TracTickets for help on using tickets.