Go to main content

man pages section 1M: System Administration Commands

Exit Print View

Updated: July 2017
 
 

smtp-notify(1M)

Name

smtp-notify - email notification daemon for software events

Synopsis

/usr/lib/fm/notify/smtp-notify

Description

smtp-notify is a daemon that subscribes to software events and Fault Management lifecycle events and produces email notifications based on a set of notification preferences that are stored in the SMF service configuration repository.

Email notification preferences are set using svccfg(1M).

smtp-notify is managed by the service management facility, smf(5), under the service FMRI:

svc:/system/fm/smtp-notify:default

Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The service's status can be queried using the svcs(1) command.

Properties

The following service properties can be set:

config/rootdir

This is an astring property that defaults to /. When set, the specified root directory will be used for all pathnames evaluated by smtp-notify.

By default, the body of the email event notification will be based on a set of localized message templates that are delivered with the Oracle Solaris operating system. smtp-notify will lookup the appropriate template (based on the event class) and fill in the template using elements from the event payload.

A user-supplied message body template can be substituted by specifying the msg_template notification preference. Refer to svccfg(1M) for more information about setting notification preferences on a per-service or per-event-class basis.

The message body template can contain the expansion macros listed below. These macros will be expanded by smtp-notify before sending the message.

Macro          Description
-----          -----------
%%              expands to a literal % character
%<HOSTNAME>     expands to the hostname on which the event
                occurred
%<URL>          expands to the URL of the knowledge article
                associated with this event
%<CLASS>        expands to the event class
%<UUID>         expands to the UUID of the event
%<CODE>         expands to the knowledge article message ID
%<SEVERITY>     expands to the severity of the event

For SMF service state transition events, the following additional macros can be specified in a message template:

%<FMRI>          expands to FMRI of the affected service
%<FROM-STATE>    expands to the previous state of the service
%<TO-STATE>      expands to the new state of the service

To facilitate email filtering, smtp-notify will create X-headers for the following components of the event payload for all event classes:

Header name             Value
-----------             -----
X-FMEV-HOSTNAME         the name of the host on which the
                        event occurred
X-FMEV-CLASS            the event class
X-FMEV-CODE             the Knowledge article message ID
X-FMEV-SEVERITY         the severity of the event
X-FMEV-UUID             the UUID of the event

SMF service state transition events will also include the following additional X-headers:

Header name             Value
-----------             -----
X-FMEV-FMRI             the FMRI of the affected SMF service
X-FMEV-FROM-STATE       the previous state of the service
X-FMEV-TO-STATE         the new state of the service

Examples

Example 1 Configuring Notification Preferences

The following command configures notification preferences for SMF service state transition events.

# svccfg -s svc:/system/svc/global:default setnotify -g \
from-online,to-maintenance mailto:admin@somehost.com
Example 2 Enabling Email Notifications

The following command enables email notifications for Fault Management problem diagnosis events.

# svccfg setnotify problem-diagnosed mailto:admin@somehost.com

Example 3 Listing Notification Settings

The following command lists all notification settings for Fault Management problem diagnosis events.

# svccfg listnotify problem-diagnosed

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/fault-management/smtp-notify
Interface Stability
Unstable

See Also

svcs(1), svcadm(1M), svccfg(1M), syslogd(1M), attributes(5), smf(5)