Solaris 11.2 announcement - a collection of links and hints (Part 3)

In this blog entry i want to write about some small features you wouldn’t read about on page 1, but which are really really helpful. Sean Wilcox wrote a nice article about SMF stencils. Stencils are a nice and build-in way to fill-in configuration information from SMF properties into legacy configuration files. Another small but very nice feature is an extension of netstat. It now shows the pid, the user and the command of the process owning a socket. Casper Dik wrote about it in User, Pid and Commands in netstat(1m)

root@sol112:~# netstat -aun | more

UDP: IPv4
   Local Address        Remote Address      User    Pid      Command       State
-------------------- -------------------- -------- ------ -------------- ----------
      \*.\*                                 root        123 in.mpathd      Unbound
      \*.\*                                 root        123 in.mpathd      Unbound
      \*.\*                                 netadm      659 nwamd          Unbound
      \*.\*                                 netadm      659 nwamd          Unbound
      \*.111                               daemon      851 rpcbind        Idle
      \*.\*                                 daemon      851 rpcbind        Unbound
      \*.48105                             daemon      851 rpcbind        Idle
      \*.111                               daemon      851 rpcbind        Idle
      \*.\*                                 daemon      851 rpcbind        Unbound
      \*.40150                             daemon      851 rpcbind        Idle
      \*.\*                                 root        870 in.ndpd        Unbound
      \*.631                               root        948 cupsd          Idle
      \*.68                                root        985 dhcpagent      Idle
      \*.546                               root        985 dhcpagent      Idle

With svcs -Lv a really helpful option found it’s way to Solaris 11.2 . It’s shows the logs for an SMF server. So you don’t have to search for the log location anymore.

root@sol112:~# svcs -Lv svc:/network/smtp:sendmail
svc:/network/smtp:sendmail (sendmail SMTP mail transfer agent)
[ Apr 30 20:48:10 Enabled. ]
[ Apr 30 20:48:10 Rereading configuration. ]
[ Apr 30 20:48:46 Executing start method ("/lib/svc/method/smtp-sendmail start"). ]
WARNING: local host name (sol112) is not qualified; see cf/README: WHO AM I?
/etc/mail/aliases: 13 aliases, longest 10 bytes, 145 bytes total
[ Apr 30 20:49:47 Method "start" exited with status 0. ]

With tcpstat and ipstat two commands from the *stat family were integrated into 11.2. Useful to find out what’s happening on your network interfaces.

root@sol112:~# tcpstat -c 1
Please wait...
ZONE         PID PROTO  SADDR             SPORT DADDR             DPORT   BYTES
global       979 TCP    sol112               22 MBP-of-c0t0d0s0.  51418   64,0
Total: bytes in:  0,0  bytes out: 64,0
ZONE         PID PROTO  SADDR             SPORT DADDR             DPORT   BYTES
global       979 TCP    sol112               22 MBP-of-c0t0d0s0.  51418  336,0
root@sol112:~# ipstat -c 1
Please wait...
SOURCE                     DEST                       PROTO    INT        BYTES
sol112                     MBP-of-c0t0d0s0.fritz.box  TCP      net0       96,0
MBP-of-c0t0d0s0.fritz.box  sol112                     TCP      net0       32,0
Total: bytes in: 32,0  bytes out: 96,0
SOURCE                     DEST                       PROTO    INT        BYTES
sol112                     MBP-of-c0t0d0s0.fritz.box  TCP      net0      448,0
MBP-of-c0t0d0s0.fritz.box  sol112                     TCP      net0       64,0
Total: bytes in: 64,0  bytes out: 448,0