Notifications for SMF Instance State Transitions
By User12652883-Oracle on Apr 01, 2011
Something you may or may not have noticed in the Oracle Solaris 11 Express release is the ability to monitor SMF service instance transitions, such as to maintenance state or from online to disabled. This leverages the Solaris FMA notification daemons, which were introduced at the same time as this SMF support (previously SNMP notification for email was delivered as an fmd plugin, and there was no email notification).
First thing to know is that the notification daemons are packaged apart from the fault manager itself. There are separate packages for SMTP notification and for SNMP notification, and each deliver a corresponding SMF service:
You need only install the mechanism(s) you want. If the packages are absent you are still able to configure notification preferences with# pkg install smtp-notify # pkg install snmp-notify # svcadm enable smtp-notify # svcadm enable snmp-notify # svcs smtp-notify # svcs snmp-notify
svccfgas below - but notifications will not work until the packages are added and the services online.
Next you need to setup your notification preferences. Like many things nowadays these are stored in SMF, and we use
svccfg command line. See manpages svccfg(1m) for subcommands
delnotify as well smtp-notify(1m) and snmp-notify(1m). For the die-hards
there is more detail in smf(5).
While you can notify of any transition and configure per-service in addition to globally, most-commonly
it will be transitions to maintenance state that will be configured for global notification: (I'll
That configures email notification when any service instance transitions to maintenance. Similarly you can configure such global actions for transitions such as# svccfg listnotify -g # svccfg setnotify -g to-maintenance mailto:$EMAIL # svccfg listnotify -g Event: to-maintenance (source: svc:/system/svc/global:default) Notification Type: smtp Active: true to: john.q.citizen-AT-elsewhere-DOT-com
If you only want to monitor particular services, or appoint different actions for different services such as to email different aliases) then drop the -g (global) and list the instance you are interested in:
# svccfg -s svc:/network/http:apache22 setnotify to-offline snmp:active
Finally, you can notify of FMA problem lifecycle events using the same mechanism:
The manpages detail the other lifecycle events.# svccfg setnotify problem-diagnosed mailto:$EMAIL