Email notification on Solaris SMF service failures

1. First check that (send)mail works on Solaris

# mailx -v   root@localhost </etc/hosts

Check that the mail is sent;

# mailx

->> if mail does NOT work, make sure the /etc/inet/hosts file contains
propper FQDN entries:               localhost           s11-server1  s11-server1.       etc

If need be, restart sendmail after you fixed the hosts file:
# svcadm restart svc:/network/smtp:sendmail

Check that the service is running;
# svcs -xv svc:/network/smtp:sendmail

-> try again to send an email to yourself.

2. Once mail works, configure SMF for email (or SNMP trap) notification

# svccfg setnotify -g offline mailto:root@s11-server1
Note: instead of maintenance you can use “maintenance” as well.

# svccfg listnotify -g

Check that the smtp-notify server is up:
# svcs -xv svc:/system/fm/smtp-notify:default
online         23:25:22 svc:/system/fm/smtp-notify:default

Now test:
# svcadm disable svc:/milestone/name-services:default
# svcadm enable svc:/milestone/name-services:default

Now check:
# mailx

Afterwards delete the notification again if needed:
# svccfg delnotify  -g offline

Note: as opposed to configuring Email notifications it is also possible to initiate SNMP traps.

This entry was posted in Solaris / linux. Bookmark the permalink.