Thursday, December 21, 2006

Graphical View of Solaris Service Management Facility (SMF)

Solaris 10 has this new feature called Service Management Facility (SMF) which describes the dependencies of services. In my system, there are 165 services (svcs -a) and the below script will output that in the 'dot' format so that we can visualise the dependency graphically using Graphviz.

dot.sh

#! /bin/sh


( 
echo "digraph smf {";
echo "node [fontname=Courier,fontsize=10];"

for i in `svcs -a | awk 'NR>2 {print $3}'`
do
 j=`echo $i | sed -e 's/:default//' -e 's/svc://'`
 for d in `svcs -d $i | awk 'NR>2 {print $NF}' | sed -e 's/:default//' -e 's/svc://'`
 do
  echo "\"$d\" -> \"$j\";"
 done
 for D in `svcs -D $i | awk 'NR>2 {print $NF}' | sed -e 's/:default//' -e 's/svc://'`
 do
  echo "\"$j\" -> \"$D\";"
 done
done;
echo "}";
) > smf.dot


dot -Tpng -o smf.png smf.dot

smf.dot

digraph smf {
node [fontname=Courier,fontsize=10];
"/system/identity:node" -> "/system/metainit";
"/system/metainit" -> "/system/filesystem/root";
"/system/metainit" -> "/milestone/single-user";
"/network/rpc/nisplus" -> "/network/service";
"/network/rpc/bind" -> "/network/rpc/keyserv";
"/network/rpc/keyserv" -> "/network/rpc/gss";
"/network/rpc/keyserv" -> "/network/nfs/client";
"/network/rpc/keyserv" -> "/network/nfs/server";
"/system/identity:domain" -> "/network/nis/server";
"/network/rpc/bind" -> "/network/nis/server";
"/network/nis/server" -> "/network/service";
"/system/filesystem/minimal" -> "/network/nis/client";
"/system/identity:domain" -> "/network/nis/client";
"/network/rpc/bind" -> "/network/nis/client";
"/network/nis/client" -> "/network/service";
"/system/filesystem/minimal" -> "/network/dns/client";
"/milestone/network" -> "/network/dns/client";
"/network/service" -> "/network/dns/client";
"/network/dns/client" -> "/network/security/krb5kdc";
"/network/dns/client" -> "/milestone/name-services";
"/network/initial" -> "/network/ldap/client";
"/system/filesystem/minimal" -> "/network/nfs/cbd";
"/milestone/network" -> "/network/nfs/cbd";
"/network/rpc/bind" -> "/network/nfs/cbd";
"/system/identity:domain" -> "/application/print/server";
"/system/filesystem/local" -> "/application/print/server";
"/system/system-log" -> "/application/print/server";
"/application/print/server" -> "/application/print/ipp-listener";
"/application/print/server" -> "/application/print/rfc1179";
"/network/rpc/meta" -> "/system/mdmonitor";
"/system/filesystem/minimal" -> "/system/mdmonitor";
"/milestone/network" -> "/network/rpc/bootparams";
"/network/rpc/bind" -> "/network/rpc/bootparams";
"/milestone/network" -> "/network/rarp";
"/system/system-log" -> "/network/rarp";
"/network/initial" -> "/application/management/webmin";
"/system/utmp" -> "/application/gdm2-login";
"/system/filesystem/minimal" -> "/network/dns/server";
"/milestone/network" -> "/network/dns/server";
"/network/physical" -> "/network/http:apache2";
"/network/rpc/bind" -> "/network/nis/passwd";
"/network/rpc/bind" -> "/network/nis/update";
"/network/rpc/bind" -> "/network/nis/xfr";
"/milestone/network" -> "/network/slp";
"/milestone/sysconfig" -> "/network/slp";
"/network/physical" -> "/network/apocd/udp";
"/milestone/network" -> "/network/shell:kshell";
"/system/identity:domain" -> "/network/smtp:sendmail";
"/system/filesystem/local" -> "/network/smtp:sendmail";
"/network/service" -> "/network/smtp:sendmail";
"/system/filesystem/autofs" -> "/network/smtp:sendmail";
"/system/system-log" -> "/network/smtp:sendmail";
"/network/physical" -> "/network/ipfilter";
"/system/identity:node" -> "/network/ipfilter";
"/network/pfil" -> "/network/ipfilter";
"/network/loopback" -> "/network/rarp";
"/network/loopback" -> "/network/dns/server";
"/network/loopback" -> "/network/http:apache2";
"/network/loopback" -> "/network/slp";
"/network/loopback" -> "/network/apocd/udp";
"/network/loopback" -> "/network/shell:kshell";
"/network/loopback" -> "/application/print/cleanup";
"/network/loopback" -> "/milestone/network";
"/network/loopback" -> "/system/identity:domain";
"/network/loopback" -> "/system/identity:node";
"/network/loopback" -> "/milestone/single-user";
"/network/loopback" -> "/network/inetd";
"/network/loopback" -> "/network/shell";
"/network/loopback" -> "/network/ssh";
"/network/nis/client" -> "/milestone/name-services";
"/network/dns/client" -> "/milestone/name-services";
"/network/ldap/client" -> "/milestone/name-services";
"/milestone/name-services" -> "/network/rpc/bootparams";
"/milestone/name-services" -> "/network/smtp:sendmail";
"/milestone/name-services" -> "/system/cron";
"/milestone/name-services" -> "/network/inetd";
"/milestone/name-services" -> "/network/nfs/client";
"/milestone/name-services" -> "/system/filesystem/autofs";
"/milestone/name-services" -> "/system/system-log";
"/milestone/name-services" -> "/milestone/multi-user";
"/milestone/name-services" -> "/network/nfs/mapid";
"/system/filesystem/usr" -> "/network/ipfilter";
"/system/filesystem/usr" -> "/platform/i86pc/eeprom";
"/system/filesystem/usr" -> "/system/keymap";
"/system/filesystem/usr" -> "/system/device/local";
"/system/filesystem/usr" -> "/system/filesystem/minimal";
"/system/filesystem/usr" -> "/network/initial";
"/system/device/local" -> "/milestone/devices";
"/system/device/local" -> "/system/filesystem/minimal";
"/system/filesystem/minimal" -> "/network/nis/client";
"/system/filesystem/minimal" -> "/network/dns/client";
"/system/filesystem/minimal" -> "/network/ldap/client";
"/system/filesystem/minimal" -> "/network/nfs/cbd";
"/system/filesystem/minimal" -> "/system/mdmonitor";
"/system/filesystem/minimal" -> "/system/rcap";
"/system/filesystem/minimal" -> "/network/dns/server";
"/system/filesystem/minimal" -> "/network/nis/passwd";
"/system/filesystem/minimal" -> "/network/nis/update";
"/system/filesystem/minimal" -> "/network/nis/xfr";
"/system/filesystem/minimal" -> "/system/consadm";
"/system/filesystem/minimal" -> "/system/name-service-cache";
"/system/filesystem/minimal" -> "/application/print/cleanup";
"/system/filesystem/minimal" -> "/system/rmtmpfiles";
"/system/filesystem/minimal" -> "/system/picl";
"/system/filesystem/minimal" -> "/system/sysevent";
"/system/filesystem/minimal" -> "/system/coreadm";
"/system/filesystem/minimal" -> "/system/power";
"/system/filesystem/minimal" -> "/system/cryptosvc";
"/system/filesystem/minimal" -> "/system/manifest-import";
"/system/filesystem/minimal" -> "/system/identity:domain";
"/system/filesystem/minimal" -> "/milestone/single-user";
"/system/filesystem/minimal" -> "/system/filesystem/local";
"/system/filesystem/minimal" -> "/system/sysidtool:net";
"/system/filesystem/minimal" -> "/network/rpc/bind";
"/system/filesystem/minimal" -> "/system/sysidtool:system";
"/system/filesystem/minimal" -> "/system/fmd";
"/system/filesystem/minimal" -> "/system/console-login";
"/system/filesystem/minimal" -> "/network/nfs/mapid";
"/system/filesystem/minimal" -> "/system/sar";
"/system/filesystem/minimal" -> "/network/nfs/nlockmgr";
"/system/filesystem/minimal" -> "/application/print/cleanup";
"/network/physical" -> "/application/print/cleanup";
"/system/sysevent" -> "/milestone/single-user";
"/system/sysevent" -> "/system/fmd";
"/system/device/fc-fabric" -> "/milestone/devices";
"/milestone/devices" -> "/network/initial";
"/system/cryptosvc" -> "/network/initial";
"/system/cryptosvc" -> "/network/ssh";
"/network/physical" -> "/network/http:apache2";
"/network/physical" -> "/network/apocd/udp";
"/network/physical" -> "/network/ipfilter";
"/network/physical" -> "/application/print/cleanup";
"/network/physical" -> "/milestone/network";
"/network/physical" -> "/system/identity:domain";
"/network/physical" -> "/system/identity:node";
"/network/physical" -> "/network/ssh";
"/network/loopback" -> "/milestone/network";
"/network/physical" -> "/milestone/network";
"/milestone/network" -> "/network/nfs/cbd";
"/milestone/network" -> "/network/rpc/bootparams";
"/milestone/network" -> "/network/rarp";
"/milestone/network" -> "/network/dns/server";
"/milestone/network" -> "/network/slp";
"/milestone/network" -> "/network/shell:kshell";
"/milestone/network" -> "/milestone/single-user";
"/milestone/network" -> "/network/initial";
"/milestone/network" -> "/network/inetd";
"/milestone/network" -> "/network/nfs/client";
"/milestone/network" -> "/network/shell";
"/milestone/network" -> "/network/nfs/server";
"/milestone/network" -> "/network/nfs/mapid";
"/milestone/network" -> "/network/nfs/status";
"/milestone/network" -> "/network/nfs/nlockmgr";
"/system/filesystem/minimal" -> "/system/identity:domain";
"/network/physical" -> "/system/identity:domain";
"/system/identity:domain" -> "/network/nis/server";
"/system/identity:domain" -> "/network/nis/client";
"/system/identity:domain" -> "/application/print/server";
"/system/identity:domain" -> "/network/smtp:sendmail";
"/system/identity:domain" -> "/system/sysidtool:net";
"/system/identity:domain" -> "/system/sysidtool:system";
"/network/physical" -> "/system/identity:node";
"/system/identity:node" -> "/network/ipfilter";
"/system/identity:node" -> "/milestone/single-user";
"/system/identity:node" -> "/system/sysidtool:net";
"/system/identity:node" -> "/network/rpc/bind";
"/system/identity:node" -> "/system/sysidtool:system";
"/system/identity:node" -> "/system/console-login";
"/network/loopback" -> "/milestone/single-user";
"/system/filesystem/minimal" -> "/milestone/single-user";
"/system/sysevent" -> "/milestone/single-user";
"/milestone/devices" -> "/milestone/single-user";
"/system/cryptosvc" -> "/milestone/single-user";
"/system/manifest-import" -> "/milestone/single-user";
"/milestone/network" -> "/milestone/single-user";
"/system/identity:node" -> "/milestone/single-user";
"/milestone/single-user" -> "/system/sysidtool:net";
"/milestone/single-user" -> "/system/sysidtool:system";
"/milestone/single-user" -> "/milestone/sysconfig";
"/milestone/single-user" -> "/milestone/multi-user";
"/milestone/single-user" -> "/system/filesystem/local";
"/system/filesystem/local" -> "/application/print/server";
"/system/filesystem/local" -> "/application/management/webmin";
"/system/filesystem/local" -> "/application/gdm2-login";
"/system/filesystem/local" -> "/network/smtp:sendmail";
"/system/filesystem/local" -> "/system/cron";
"/system/filesystem/local" -> "/system/sysidtool:net";
"/system/filesystem/local" -> "/system/sysidtool:system";
"/system/filesystem/local" -> "/platform/i86pc/kdmconfig";
"/system/filesystem/local" -> "/system/sac";
"/system/filesystem/local" -> "/network/inetd";
"/system/filesystem/local" -> "/application/font/fc-cache";
"/system/filesystem/local" -> "/system/filesystem/autofs";
"/system/filesystem/local" -> "/system/dumpadm";
"/system/filesystem/local" -> "/system/system-log";
"/system/filesystem/local" -> "/milestone/multi-user";
"/system/filesystem/local" -> "/network/ssh";
"/system/filesystem/local" -> "/network/nfs/server";
"/system/filesystem/local" -> "/network/nfs/status";
"/system/filesystem/local" -> "/system/cron";
"/system/identity:domain" -> "/system/sysidtool:net";
"/system/identity:node" -> "/system/sysidtool:net";
"/milestone/single-user" -> "/system/sysidtool:net";
"/system/filesystem/local" -> "/system/sysidtool:net";
"/network/pfil" -> "/system/sysidtool:net";
"/system/sysidtool:net" -> "/system/sysidtool:system";
"/system/sysidtool:net" -> "/platform/i86pc/kdmconfig";
"/system/sysidtool:net" -> "/milestone/sysconfig";
"/milestone/devices" -> "/network/initial";
"/system/cryptosvc" -> "/network/initial";
"/milestone/network" -> "/network/initial";
"/network/initial" -> "/application/management/webmin";
"/network/initial" -> "/network/service";
"/network/initial" -> "/network/rpc/bind";
"/network/nis/server" -> "/network/service";
"/network/nis/client" -> "/network/service";
"/network/initial" -> "/network/service";
"/network/service" -> "/network/ntp";
"/network/service" -> "/network/smtp:sendmail";
"/system/identity:node" -> "/network/rpc/bind";
"/system/sysidtool:net" -> "/network/rpc/bind";
"/network/initial" -> "/network/rpc/bind";
"/network/rpc/bind" -> "/network/nis/server";
"/network/rpc/bind" -> "/network/nis/client";
"/network/rpc/bind" -> "/network/nfs/cbd";
"/network/rpc/bind" -> "/network/rpc/bootparams";
"/network/rpc/bind" -> "/network/nis/passwd";
"/network/rpc/bind" -> "/network/nis/update";
"/network/rpc/bind" -> "/network/nis/xfr";
"/network/rpc/bind" -> "/network/rpc/meta";
"/network/rpc/bind" -> "/network/rpc/mdcomm";
"/network/rpc/bind" -> "/network/rpc/metamed";
"/network/rpc/bind" -> "/network/rpc/metamh";
"/network/rpc/bind" -> "/network/rpc/ocfserv";
"/network/rpc/bind" -> "/network/rpc/rex";
"/network/rpc/bind" -> "/network/rpc/spray";
"/network/rpc/bind" -> "/network/rpc/wall";
"/network/rpc/bind" -> "/system/sysidtool:system";
"/network/rpc/bind" -> "/network/inetd";
"/network/rpc/bind" -> "/network/rpc/gss";
"/network/rpc/bind" -> "/network/rpc/smserver";
"/network/rpc/bind" -> "/network/rpc/rstat";
"/network/rpc/bind" -> "/network/rpc/rusers";
"/network/rpc/bind" -> "/network/nfs/client";
"/network/rpc/bind" -> "/system/fmd";
"/network/rpc/bind" -> "/milestone/multi-user";
"/network/rpc/bind" -> "/network/nfs/server";
"/network/rpc/bind" -> "/network/nfs/mapid";
"/network/rpc/bind" -> "/network/nfs/rquota";
"/network/rpc/bind" -> "/network/nfs/status";
"/network/rpc/bind" -> "/network/nfs/nlockmgr";
"/system/identity:domain" -> "/system/sysidtool:system";
"/system/identity:node" -> "/system/sysidtool:system";
"/milestone/single-user" -> "/system/sysidtool:system";
"/system/filesystem/local" -> "/system/sysidtool:system";
"/system/sysidtool:net" -> "/system/sysidtool:system";
"/network/rpc/bind" -> "/system/sysidtool:system";
"/system/sysidtool:system" -> "/milestone/sysconfig";
"/system/sysidtool:net" -> "/platform/i86pc/kdmconfig";
"/system/sysidtool:system" -> "/platform/i86pc/kdmconfig";
"/platform/i86pc/kdmconfig" -> "/milestone/multi-user";
"/system/sysidtool:net" -> "/milestone/sysconfig";
"/system/sysidtool:system" -> "/milestone/sysconfig";
"/platform/i86pc/kdmconfig" -> "/milestone/sysconfig";
"/milestone/sysconfig" -> "/system/sac";
"/milestone/sysconfig" -> "/system/utmp";
"/milestone/sysconfig" -> "/network/inetd";
"/milestone/sysconfig" -> "/system/system-log";
"/milestone/sysconfig" -> "/milestone/multi-user";
"/milestone/sysconfig" -> "/system/console-login";
"/milestone/sysconfig" -> "/system/sac";
"/system/utmp" -> "/milestone/multi-user";
"/system/utmp" -> "/network/ssh";
"/system/utmp" -> "/system/console-login";
"/network/loopback" -> "/network/inetd";
"/milestone/name-services" -> "/network/inetd";
"/milestone/network" -> "/network/inetd";
"/system/filesystem/local" -> "/network/inetd";
"/network/rpc/bind" -> "/network/inetd";
"/milestone/sysconfig" -> "/network/inetd";
"/network/rpc/bind" -> "/network/rpc/gss";
"/network/rpc/gss" -> "/network/nfs/server";
"/network/nfs/cbd" -> "/network/nfs/client";
"/milestone/name-services" -> "/network/nfs/client";
"/milestone/network" -> "/network/nfs/client";
"/network/rpc/bind" -> "/network/nfs/client";
"/network/rpc/gss" -> "/network/nfs/client";
"/network/nfs/mapid" -> "/network/nfs/client";
"/network/nfs/nlockmgr" -> "/network/nfs/client";
"/network/nfs/client" -> "/system/dumpadm";
"/network/nfs/client" -> "/milestone/multi-user";
"/milestone/network" -> "/network/shell";
"/system/filesystem/local" -> "/system/filesystem/autofs";
"/network/nfs/client" -> "/system/filesystem/autofs";
"/system/filesystem/autofs" -> "/system/dumpadm";
"/system/filesystem/autofs" -> "/system/system-log";
"/system/filesystem/autofs" -> "/milestone/multi-user";
"/system/filesystem/autofs" -> "/network/ssh";
"/network/nfs/client" -> "/system/dumpadm";
"/system/filesystem/autofs" -> "/system/dumpadm";
"/system/sysevent" -> "/system/fmd";
"/network/rpc/bind" -> "/system/fmd";
"/system/dumpadm" -> "/system/fmd";
"/system/filesystem/local" -> "/system/system-log";
"/milestone/sysconfig" -> "/system/system-log";
"/system/filesystem/autofs" -> "/system/system-log";
"/system/system-log" -> "/network/rarp";
"/system/system-log" -> "/network/smtp:sendmail";
"/system/system-log" -> "/milestone/multi-user";
"/network/ntp" -> "/milestone/multi-user";
"/system/mdmonitor" -> "/milestone/multi-user";
"/system/rcap" -> "/milestone/multi-user";
"/network/smtp:sendmail" -> "/milestone/multi-user";
"/milestone/name-services" -> "/milestone/multi-user";
"/system/name-service-cache" -> "/milestone/multi-user";
"/system/rmtmpfiles" -> "/milestone/multi-user";
"/system/power" -> "/milestone/multi-user";
"/milestone/single-user" -> "/milestone/multi-user";
"/system/filesystem/local" -> "/milestone/multi-user";
"/system/cron" -> "/milestone/multi-user";
"/network/rpc/bind" -> "/milestone/multi-user";
"/platform/i86pc/kdmconfig" -> "/milestone/multi-user";
"/milestone/sysconfig" -> "/milestone/multi-user";
"/system/utmp" -> "/milestone/multi-user";
"/network/inetd" -> "/milestone/multi-user";
"/network/nfs/client" -> "/milestone/multi-user";
"/system/filesystem/autofs" -> "/milestone/multi-user";
"/system/system-log" -> "/milestone/multi-user";
"/system/system-log" -> "/milestone/multi-user";
"/milestone/multi-user" -> "/milestone/multi-user-server";
"/network/rarp" -> "/milestone/multi-user-server";
"/network/dhcp-server" -> "/milestone/multi-user-server";
"/milestone/multi-user" -> "/milestone/multi-user-server";
"/network/ssh" -> "/milestone/multi-user-server";
"/network/nfs/server" -> "/milestone/multi-user-server";
"/system/cryptosvc" -> "/network/ssh";
"/network/physical" -> "/network/ssh";
"/system/filesystem/local" -> "/network/ssh";
"/system/utmp" -> "/network/ssh";
"/system/filesystem/autofs" -> "/network/ssh";
"/system/identity:node" -> "/system/console-login";
"/milestone/sysconfig" -> "/system/console-login";
"/system/utmp" -> "/system/console-login";
"/network/pfil" -> "/network/physical";
"/network/pfil" -> "/system/sysidtool:net";
"/milestone/network" -> "/network/nfs/server";
"/system/filesystem/local" -> "/network/nfs/server";
"/network/rpc/bind" -> "/network/nfs/server";
"/network/rpc/gss" -> "/network/nfs/server";
"/network/nfs/mapid" -> "/network/nfs/server";
"/network/nfs/nlockmgr" -> "/network/nfs/server";
"/system/filesystem/minimal" -> "/network/nfs/mapid";
"/milestone/network" -> "/network/nfs/mapid";
"/network/rpc/bind" -> "/network/nfs/mapid";
"/network/nfs/mapid" -> "/network/nfs/server";
"/system/filesystem/local" -> "/network/nfs/status";
"/network/rpc/bind" -> "/network/nfs/status";
"/milestone/network" -> "/network/nfs/nlockmgr";
"/network/rpc/bind" -> "/network/nfs/nlockmgr";
"/network/nfs/status" -> "/network/nfs/nlockmgr";
"/network/nfs/nlockmgr" -> "/network/nfs/server";
}

Labels: , , ,