SMF has learned a new trick with Solaris 11; it can now tell you when services alter state. This is done via the new svccfg
subcommand, setnotify
.
It is possible to send notifications via SNMP or e-mail. It is also possible to set up notifications for individual services or for all services at once.
Compare the following two examples for setting up e-mail alerts:
// To email when any service goes into or comes out of maintenance state: svccfg setnotify -g maintenance mailto:[email protected] // To email when just this service transitions svccfg -s mysvcname setnotify maintenance mailto:[email protected]
Note
-g
does not mean "goes to". It is a flag for "global". Do not mix it with a line intended for an individual service, or you will get many more notifications than you have planned!
There are many other transition types and state names. It is possible to alert only transitions to a state...