Wednesday, January 29, 2014

SMF svcs examples

This post is in complement to the SMF interface post.
Here are a few examples for the svcs command.

Online services ordered by FMRI (Fault Management Resource Identifier):

# svcs | sort -t / -k 2 | tail
online    Jan_24   svc:/system/svc/restarter:default
online    Jan_24   svc:/system/sysevent:default
online    Jan_24   svc:/system/system-log:default
online    Jan_24   svc:/system/timezone:default
...
online    Jan_24   svc:/system/zones-install:default
online    Jan_24   svc:/system/zones-monitoring:default
online    Jan_24   svc:/system/zones:default

  
The state of the ssh service and PIDs for all currently associated processes:

$ svcs -p ssh
STATE     STIME    FMRI
online    Jan_23   svc:/network/ssh:default
          Jan_23        937 sshd


Other services upon which the ssh service depends:
(note that ipfilter is disabled; it's an optional dependency)

$ svcs -d ssh
STATE     STIME    FMRI
disabled  Jan_23   svc:/network/ipfilter:default
online    Jan_23   svc:/network/loopback:default
online    Jan_23   svc:/system/cryptosvc:default
online    Jan_23   svc:/system/utmp:default
online    Jan_23   svc:/network/physical:default
online    Jan_23   svc:/system/filesystem/local:default
online    Jan_23   svc:/system/filesystem/autofs:default


Other services that depend on ssh service:

$ svcs -D ssh
STATE     STIME    FMRI
online    Jan_23   svc:/milestone/self-assembly-complete:default
online    Jan_23   svc:/milestone/multi-user-server:default

 
The ssh service's profile, manifest and log:

$ svcs -l ssh | egrep '(log|manifest)'
logfile      /var/svc/log/network-ssh:default.log
manifest     /etc/svc/profile/generic.xml
manifest     /lib/svc/manifest/network/ssh.xml


$ svcs -n ssh
Notification parameters for FMA Events

 
    Event: problem-diagnosed
        Notification Type: smtp
            Active: true
            reply-to: root@localhost
            to: root@localhost

        Notification Type: snmp
            Active: true

        Notification Type: syslog
            Active: true

    Event: problem-repaired
        Notification Type: snmp
            Active: true

    Event: problem-resolved
        Notification Type: snmp
            Active: true