<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nilesh Ghogre</title>
	<atom:link href="http://nileshghogre.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nileshghogre.wordpress.com</link>
	<description>Sun Certified System Administrator</description>
	<lastBuildDate>Fri, 11 Nov 2011 09:37:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nileshghogre.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nilesh Ghogre</title>
		<link>http://nileshghogre.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nileshghogre.wordpress.com/osd.xml" title="Nilesh Ghogre" />
	<atom:link rel='hub' href='http://nileshghogre.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Net-SNMP</title>
		<link>http://nileshghogre.wordpress.com/2009/11/26/net-snmp/</link>
		<comments>http://nileshghogre.wordpress.com/2009/11/26/net-snmp/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 12:42:11 +0000</pubDate>
		<dc:creator>Nilesh Ghogre</dc:creator>
				<category><![CDATA[Net-SNMP]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://nileshghogre.wordpress.com/?p=27</guid>
		<description><![CDATA[Net-SNMP is provided in Solaris 10 release now, and how to use it is descripted in this article. To disable Sun&#8217;s SNMP #svcadm disable svc:/application/management/snmpdx:default the Net-SNMP daemon program locates at /usr/sfw/sbin/snmpd, and configure file of snmpd saved with the name snmpd.conf at /etc/sma/snmp. Use svcadm to start of stop snmpd: #svcadm enable svc:/application/management/sma:default #svcadm [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=27&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Net-SNMP is provided in Solaris 10 release now, and how to use it is descripted in this article.</p>
<p>To disable Sun&#8217;s SNMP<br />
#svcadm disable svc:/application/management/snmpdx:default</p>
<p>the Net-SNMP daemon program locates at /usr/sfw/sbin/snmpd, and configure file of snmpd saved with the name snmpd.conf at /etc/sma/snmp. Use svcadm to start of stop snmpd:<br />
#svcadm enable svc:/application/management/sma:default<br />
#svcadm disable svc:/application/management/sma:default</p>
<p>Log File<br />
if there&#8217;s any error or warning messages, see the file /var/svc/log/application-management-sma\:default.log. The default log file of snmpd is <kbd>/var/log/snmpd.log.</kbd></p>
<p>Configuration file<br />
We may use /etc/sma/snmp/snmpd.conf.save as the working configure file to test wheather our snmpd daemon is ok.<br />
#cp /etc/sma/snmp/snmpd.conf.save /etc/sma/snmp/snmpd.conf<br />
#svcadm restart sma</p>
<p>P.S. There&#8217;s another file also named as snmpd.conf stored in /var/sma_snmp directory, and which is called persistent storage file. The persistent storage file, /var/sma_snmp/snmpd.conf, contains USM security information and any MIB components that are set for persistent storage. This file also contains the engineID and the engineID boots. This persistent storage file is automatically updated when the System Management Agent starts. When the System Management Agent stops, the snmpusm and snmpvacm utilities write user security information to this storage file.</p>
<p>Using the AgentX Protocol<br />
The AgentX protocol is supported in the System Management Agent. By default, the System Management Agent ships with a secure profile, that is, read–only access. AgentX allows interaction with third party subagents, provided that these subagents support AgentX over Unix Domain Sockets. For security reasons, AgentX is not supported over TCP/UDP. For more information on the AgentX protocol, see http://www.ietf.org/rfc/rfc2741.txt  Edit the main <kbd>/etc/sma/snmp/snmpd.conf</kbd> configuration file to configure the System Management Agent to use the AgentX protocol. By default, the AgentX protocol is disabled. The following procedure describes how to enable the AgentX protocol. To enable the AgentX protocol add the following to /etc/sma/snmp/snmpd.conf file:</p>
<p>master agentx</p>
<p>restart the sma (system management agent).<br />
# svcadm restart svc:/application/management/sma:default</p>
<p>Using the SMA<br />
To view the status of the agent<br />
# svcs svc:/application/management/sma:default</p>
<p>To See Which MIBs Are Initialized<br />
# /usr/sfw/sbin/snmpd  -Dregister_mib -Dmib_init -L</p>
<p>To Check the Disk Space and Network on a Local or Remote Machine<br />
# /usr/sfw/bin/snmpwalk -v1 -c public localhost HOST-RESOURCES-MIB::hrStorageIndex</p>
<p># /usr/sfw/bin/snmpget -v1 -c public localhost HOST-RESOURCES-MIB::hrStorageSize.1</p>
<p># /usr/sfw/bin/snmpwalk -v1 -c public localhost HOST-RESOURCES-MIB::hrStorageUsed</p>
<p># /usr/sfw/bin/snmpnetstat -v 2c -c public -a localhost</p>
<p>if all these works, congratulations, the sma is configured and brought on properly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nileshghogre.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nileshghogre.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nileshghogre.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nileshghogre.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nileshghogre.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nileshghogre.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nileshghogre.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nileshghogre.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=27&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nileshghogre.wordpress.com/2009/11/26/net-snmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d365d103be3d34ff8a85b51f5c73a33c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gnilesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Logrotate</title>
		<link>http://nileshghogre.wordpress.com/2009/11/24/logrotate/</link>
		<comments>http://nileshghogre.wordpress.com/2009/11/24/logrotate/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 12:56:12 +0000</pubDate>
		<dc:creator>Nilesh Ghogre</dc:creator>
				<category><![CDATA[Commands]]></category>
		<category><![CDATA[IP network multipathing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Log Rotate]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://nileshghogre.wordpress.com/?p=23</guid>
		<description><![CDATA[Logrotate is a Linux utility that renames and reuses system error log files on a periodic basis so that they don&#8217;t occupy excessive disk space. The /etc/logrotate.conf File This is logrotate’s general configuration file in which you can specify the frequency with which the files are reused. o        You can specify either “weekly” or “daily” [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=23&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Logrotate is a Linux utility that renames and reuses system error log files on a periodic basis so that they don&#8217;t occupy excessive disk space.</p>
<h4>The /etc/logrotate.conf File</h4>
<p>This is logrotate’s general configuration file in which you can specify the frequency with which the files are reused.</p>
<p>o        You can specify either “weekly” or “daily” rotation parameter. In the case below the weekly option is &#8220;commented out&#8221; with a &#8220;#&#8221;, allowing for daily updates.</p>
<p>o        The &#8220;rotate&#8221; parameter specifies the number of copies of log files logrotate will maintain. In the case below the 4 copy option is &#8220;commented out&#8221; with a &#8220;#&#8221;, while allowing 7 copies.</p>
<p>o        The &#8220;create&#8221; parameter creates a new log file after each rotation</p>
<p>Therefore our sample configuration file will create daily archives of <strong>ALL </strong>the logfiles and store them for seven days. The files will have the following names with &#8220;logfile&#8221; being current active version:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>logfile</p>
<p>logfile.0</p>
<p>logfile.1</p>
<p>logfile.2</p>
<p>logfile.3</p>
<p>logfile.4</p>
<p>logfile.5</p>
<p>logfile.6</p>
<p>&nbsp;</p>
<h4>Sample contents of /etc/logrotate.conf</h4>
<p># rotate log files weekly<br />
#weekly</p>
<p># rotate log files daily<br />
daily</p>
<p># keep 4 weeks worth of backlogs<br />
#rotate 4</p>
<p># keep 7 days worth of backlogs<br />
rotate 7</p>
<p># create new (empty) log files after rotating old ones<br />
create</p>
<p>&nbsp;</p>
<h4>The /etc/logrotate.d Directory</h4>
<p>Most Linux applications that use syslog will put an additional configuration file in this directory to specify the names of the log files to be rotated. It is a good practice to verify that all new applications that you want to use the syslog log have configuration files in this directory. Here are some sample files which define the specific files to be rotated for each application.</p>
<h5>The /etc/logrotate.d/syslog File (For General System Logging)</h5>
<p>/var/log/cisco/* /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {</p>
<p>sharedscripts<br />
postrotate<br />
/bin/kill -HUP `cat /var/run/syslogd.pid 2&gt; /dev/null` 2&gt; /dev/null || true<br />
endscript</p>
<p>}</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h5>The /etc/logrotate.d/apache File (For Apache)</h5>
<p>/var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log {</p>
<p>missingok<br />
sharedscripts<br />
postrotate<br />
/bin/kill -HUP `cat /var/run/httpd.pid 2&gt;/dev/null` 2&gt; /dev/null || true<br />
endscript</p>
<p>}</p>
<h5>The /etc/logrotate.d/samba File (for SAMBA)</h5>
<p>&nbsp;</p>
<p>/var/log/samba/*.log {</p>
<p>notifempty<br />
missingok<br />
sharedscripts<br />
copytruncate<br />
postrotate<br />
/bin/kill -HUP `cat /var/lock/samba/*.pid 2&gt; /dev/null` 2&gt; /dev/null || true<br />
endscript</p>
<p>}</p>
<p>&nbsp;</p>
<h4>Activating logrotate</h4>
<p>The above logrotate settings will not take effect until you issue the following command to do so:</p>
<p>&nbsp;</p>
<p>[root@bigboy tmp]# logrotate –f</p>
<p>&nbsp;</p>
<p>If you want logrotate to reload only a specifc configuration file, and not all of them, then issue the logrotate command with just that filename as the argument like this:</p>
<p>&nbsp;</p>
<p>[root@bigboy tmp]# logrotate -f /etc/logrotate.d/syslog</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nileshghogre.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nileshghogre.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nileshghogre.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nileshghogre.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nileshghogre.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nileshghogre.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nileshghogre.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nileshghogre.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=23&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nileshghogre.wordpress.com/2009/11/24/logrotate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d365d103be3d34ff8a85b51f5c73a33c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gnilesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Solaris Commands</title>
		<link>http://nileshghogre.wordpress.com/2009/11/23/solaris-commands/</link>
		<comments>http://nileshghogre.wordpress.com/2009/11/23/solaris-commands/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 12:26:28 +0000</pubDate>
		<dc:creator>Nilesh Ghogre</dc:creator>
				<category><![CDATA[Commands]]></category>

		<guid isPermaLink="false">http://nileshghogre.wordpress.com/?p=13</guid>
		<description><![CDATA[apptrace – for tracing library calls dtrace – debugger, new in version 10 pargs – get list of arguments and environment variables with which process was started pfiles – list of file descriptors, associated with process pgrep – get the PID&#8217;s of processes by name i.e. Something like ps -efl&#124;grep -v grep&#124;grep process_name pkill – [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=13&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>apptrace – for tracing library calls<br />
dtrace – debugger, new in version 10<br />
pargs – get list of arguments and environment variables with which process was started<br />
pfiles – list of file descriptors, associated with process<br />
pgrep – get the PID&#8217;s of processes by name i.e. Something like ps -efl|grep -v grep|grep process_name<br />
pkill – send signal to process. For example pkill -9 init :-P<br />
pldd – list dynamic libraries, associated with process, similar to ldd for executable<br />
plockstat – see list of locked by process files. Lock can be mutex i.e. exclusive and reader/writer for shared access<br />
pmap – get memory map (segments) of process<br />
preap – try to kick-off zombie process<br />
prstat – fullscreen view of processes sorted by different criteria, similar to Linux top command<br />
prun – continue hold with pstop process<br />
ps &#8211; print process information and status. In Solaris exist SYSV and BSD variants, respectively /usr/bin/ps and /usr/ucb/ps<br />
psig – list signals that can be handled by process<br />
pstack – get backtrace stack of process for debugging purposes<br />
pstop – temporary hold process<br />
ptree &#8211; print the tree of processes<br />
pwait – wait till process finish<br />
pwdx – list working directory for process, like pwd command<br />
truss – for tracing user/library/system calls and signals</p>
<h2>Examples</h2>
<p><strong>apptrace</strong></p>
<pre># apptrace man
-&gt; man      -&gt; libc.so.1:int atexit(int (*)() = 0xd27d6bfc)
&lt;- man      -&gt; libc.so.1:atexit()
-&gt; man      -&gt; libc.so.1:int atexit(int (*)() = 0x8054e8c)
&lt;- man      -&gt; libc.so.1:atexit()
-&gt; man      -&gt; libc.so.1:void __fpstart(void)
&lt;- man      -&gt; libc.so.1:__fpstart() = 0xd251fc94
-&gt; man      -&gt; libc.so.1:access(0x8055984, 0x1, 0x8047e30) ** NR
-&gt; man      -&gt; libc.so.1:char * setlocale(int = 0x6, const char * = 0x8055980 "")
&lt;- man      -&gt; libc.so.1:setlocale() = 0xd25002ed
-&gt; man      -&gt; libc.so.1:char * setlocale(int = 0x5, const char * = 0x0 &lt;NULL&gt;)
&lt;- man      -&gt; libc.so.1:setlocale() = 0xd25002ed
-&gt; man      -&gt; libc.so.1:strcpy(0x80669e8, 0xd25002ed, 0x8047e30) ** NR
-&gt; man      -&gt; libc.so.1:int strcmp(const char * = 0x805597c "C", const char * = 0x80669e8 "C")
&lt;- man      -&gt; libc.so.1:strcmp()
-&gt; man      -&gt; libc.so.1:char * textdomain(const char * = 0x8055968 "SUNW_OST_OSCMD")
&lt;- man      -&gt; libc.so.1:textdomain() = 0x80683e0
-&gt; man      -&gt; libc.so.1:strcpy(0x80665e8, 0x8055960, 0x8047e30) ** NR
-&gt; man      -&gt; libc.so.1:char * getenv(const char * = 0x8054fc0 "MANPATH")
&lt;- man      -&gt; libc.so.1:getenv()
-&gt; man      -&gt; libc.so.1:strrchr(0x8047e98, 0x2f, 0x8047e30) ** NR
-&gt; man      -&gt; libc.so.1:int strcmp(const char * = 0x8047e98 "man", const char * = 0x8054fb8 "apropos")
&lt;- man      -&gt; libc.so.1:strcmp() = 0xc
-&gt; man      -&gt; libc.so.1:int strcmp(const char * = 0x8047e98 "man", const char * = 0x8055958 "whatis")
&lt;- man      -&gt; libc.so.1:strcmp() = 0xfffffff6
-&gt; man      -&gt; libc.so.1:int strcmp(const char * = 0x8047e98 "man", const char * = 0x8055944 "catman")
&lt;- man      -&gt; libc.so.1:strcmp() = 0xa
-&gt; man      -&gt; libc.so.1:int getopt(int = 0x1, char *const * = 0x8047de4, const char * = 0x8066420 "FfkrP:M:T:ts:lad")
&lt;- man      -&gt; libc.so.1:getopt() = 0xffffffff
-&gt; man      -&gt; libc.so.1:char * gettext(const char * = 0x8055838 "usage:        man [-] [-adFlrt] [-M path] [-T macro-package ] [ -s  section ] name ...
        man [-M path] -k keyword ...
        man [-M path] -f file ...")
&lt;- man      -&gt; libc.so.1:gettext() = 0x8055838
-&gt; man      -&gt; libc.so.1:int fprintf(FILE * = 0x8067610, const char * = 0x8054f7c "%s
", void * = 0x8055838, ...)
usage:  man [-] [-adFlrt] [-M path] [-T macro-package ] [ -s section ] name ...
        man [-M path] -k keyword ...
        man [-M path] -f file ...
&lt;- man      -&gt; libc.so.1:fprintf() = 0x88
-&gt; man      -&gt; libc.so.1:exit(0x2, 0x8047e30, 0x8047da0) ** NR</pre>
<p><em>in the above example you can clearly see library calls as fprintf(), strcmp(), getenv(), etc.</em></p>
<hr /><strong>pargs</strong></p>
<pre># pargs 558
558:    /usr/lib/sendmail -Ac -q15m
argv[0]: sendmail: Queue runner@00:15:00 for /var/spool/clientmqueue

argv[1]: &lt;NULL&gt;
argv[2]: @00:15:00 for /var/spool/clientmqueue</pre>
<p><em>in above example you see the arguments for starting sendmail as a daemon</em></p>
<hr /><strong>pfiles</strong></p>
<pre># pfiles 558
558:    /usr/lib/sendmail -Ac -q15m
  Current rlimit: 1024 file descriptors
   0: S_IFCHR mode:0666 dev:270,0 ino:6815752 uid:0 gid:3 rdev:13,2
      O_RDONLY
      /devices/pseudo/mm@0:null
   1: S_IFCHR mode:0666 dev:270,0 ino:6815752 uid:0 gid:3 rdev:13,2
      O_WRONLY
      /devices/pseudo/mm@0:null
   2: S_IFCHR mode:0666 dev:270,0 ino:6815752 uid:0 gid:3 rdev:13,2
      O_WRONLY
      /devices/pseudo/mm@0:null
   3: S_IFDOOR mode:0444 dev:279,0 ino:53 uid:0 gid:0 size:0
      O_RDONLY|O_LARGEFILE FD_CLOEXEC  door to nscd[366]
      /var/run/name_service_door
   4: S_IFCHR mode:0666 dev:270,0 ino:11010052 uid:0 gid:3 rdev:21,0
      O_WRONLY FD_CLOEXEC
      /devices/pseudo/log@0:conslog
   5: S_IFREG mode:0600 dev:102,0 ino:189384 uid:25 gid:25 size:32
      O_WRONLY|O_CREAT|O_EXCL
      /var/spool/clientmqueue/sm-client.pid</pre>
<p><em>Here you see a list of files as NULL, console log, some PID files. On the top you can see the maximum number of file handlers for this process, with info that can be helpful for troubleshooting of applications</em></p>
<hr /><strong>pgrep</strong></p>
<pre># pgrep named
586</pre>
<p><em>Something like ps -efl|grep -v grep|grep process_name|awk &#8216;{print $1}&#8217;</em></p>
<pre># ps -e|grep -v grep|grep named|awk '{print $1}'
586</pre>
<hr /><strong>pkill</strong></p>
<pre># pgrep named
628
# pkill named
# pgrep named
636
#</pre>
<p><em>As you see, the named daemon was killed and respawned (with new PID)</em></p>
<hr /><strong>pldd</strong></p>
<pre># pldd 636
636:    /usr/sbin/named
/usr/lib/dns/liblwres.so.1.1.2
/usr/lib/dns/libdns.so.16.0.0
/usr/lib/dns/libisccfg.so.0.0.11
/usr/sfw/lib/libcrypto.so.0.9.7
/usr/lib/dns/libisccc.so.0.1.0
/usr/lib/dns/libisc.so.7.1.5
/lib/libnsl.so.1
/lib/libsocket.so.1
/lib/libscf.so.1
/lib/libpthread.so.1
/lib/libthread.so.1
/lib/libc.so.1
/lib/libdoor.so.1
/lib/libuutil.so.1
# ldd /usr/sbin/named
        liblwres.so.1 =&gt;         /usr/lib/dns/liblwres.so.1
        libdns.so.16 =&gt;  /usr/lib/dns/libdns.so.16
        libisccfg.so.0 =&gt;        /usr/lib/dns/libisccfg.so.0
        libcrypto.so.0.9.7 =&gt;    /usr/sfw/lib/libcrypto.so.0.9.7
        libisccc.so.0 =&gt;         /usr/lib/dns/libisccc.so.0
        libisc.so.7 =&gt;   /usr/lib/dns/libisc.so.7
        libnsl.so.1 =&gt;   /lib/libnsl.so.1
        libsocket.so.1 =&gt;        /lib/libsocket.so.1
        libscf.so.1 =&gt;   /lib/libscf.so.1
        libpthread.so.1 =&gt;       /lib/libpthread.so.1
        libthread.so.1 =&gt;        /lib/libthread.so.1
        libc.so.1 =&gt;     /lib/libc.so.1
        libmp.so.2 =&gt;    /lib/libmp.so.2
        libmd5.so.1 =&gt;   /lib/libmd5.so.1
        libdoor.so.1 =&gt;  /lib/libdoor.so.1
        libuutil.so.1 =&gt;         /lib/libuutil.so.1
        libm.so.2 =&gt;     /lib/libm.so.2</pre>
<p><em>Results from both commands are almost the same :-) Why? Ask SUN</em></p>
<hr /><strong>pmap</strong></p>
<pre># pmap 636
636:    /usr/sbin/named
08046000       8K rw----    [ stack ]
08050000     232K r-x--  /usr/sbin/named
08099000      16K rwx--  /usr/sbin/named
0809D000     544K rwx--    [ heap ]
D21ED000       4K rw--R    [ stack tid=4 ]
D21F0000      64K rwx--    [ anon ]
D2218000       4K rw--R    [ stack tid=3 ]
D221B000       4K rwxs-    [ anon ]
D2236000      16K rw--R    [ stack tid=2 ]
D223C000      64K rw----    [ anon ]
D224E000      64K rw----    [ anon ]
D2260000      24K rwx--    [ anon ]
D2270000       4K rwx--    [ anon ]
D2280000      24K r-x--  /lib/libuutil.so.1
D2296000       4K rw----  /lib/libuutil.so.1
D22A0000       4K r-x--  /lib/libdoor.so.1
D22B1000       4K rw----  /lib/libdoor.so.1
D22C0000       4K rwx--    [ anon ]
D22D0000     740K r-x--  /lib/libc.so.1
D2399000      24K rw----  /lib/libc.so.1
D239F000       8K rw----  /lib/libc.so.1
D23B0000      16K r-x--  /lib/libthread.so.1
D23C0000      12K r-x--  /lib/libpthread.so.1
D23D0000      88K r-x--  /lib/libscf.so.1
D23F6000       4K rw----  /lib/libscf.so.1
D2400000       4K rwx--    [ anon ]
D2410000      44K r-x--  /lib/libsocket.so.1
D242B000       4K rw----  /lib/libsocket.so.1
D2430000     512K r-x--  /lib/libnsl.so.1
D24B0000      20K rw----  /lib/libnsl.so.1
D24B5000      32K rw----  /lib/libnsl.so.1
D24C0000     228K r-x--  /usr/lib/dns/libisc.so.7.1.5
D2508000       8K rwx--  /usr/lib/dns/libisc.so.7.1.5
D2510000      24K r-x--  /usr/lib/dns/libisccc.so.0.1.0
D2525000       4K rwx--  /usr/lib/dns/libisccc.so.0.1.0
D2530000       4K rwx--    [ anon ]
D2540000     924K r-x--  /usr/sfw/lib/libcrypto.so.0.9.7
D2637000      84K rw----  /usr/sfw/lib/libcrypto.so.0.9.7
D264C000       8K rw----  /usr/sfw/lib/libcrypto.so.0.9.7
D2650000      48K r-x--  /usr/lib/dns/libisccfg.so.0.0.11
D266B000      12K rwx--  /usr/lib/dns/libisccfg.so.0.0.11
D2670000    1024K r-x--  /usr/lib/dns/libdns.so.16.0.0
D277F000      20K rwx--  /usr/lib/dns/libdns.so.16.0.0
D2790000       4K rwx--    [ anon ]
D27A0000      56K r-x--  /usr/lib/dns/liblwres.so.1.1.2
D27BD000       4K rwx--  /usr/lib/dns/liblwres.so.1.1.2
D27CA000     132K r-x--  /lib/ld.so.1
D27FB000       4K rwx--  /lib/ld.so.1
D27FC000       8K rwx--  /lib/ld.so.1
 total      5192K</pre>
<p><em>This command helps in the process of fine-tuning large applications, especially for resolving emory leak issues</em></p>
<hr /><strong>preap</strong></p>
<pre># ps -efl|grep 551
 0 Z     root   551   550   0   0  -        -      0        -        - ?           0:00 &lt;defunct&gt;
# preap 551
551: exited with status 0
# ps -efl|grep 551</pre>
<p><em>In above example, this tool successfully removes zombie process. Otherwise the only way to kill them is to reboot</em></p>
<hr /><strong>prstat</strong></p>
<pre># prstat
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
   744 root     4376K 4080K cpu0    39    0   0:00:00 0.4% prstat/1
   560 root     6988K 1944K sleep   59    0   0:00:01 0.1% sshd/1
   468 root       31M   13M sleep   59    0   0:00:04 0.1% Xorg/1
   550 root     9576K 6856K sleep   59    0   0:00:01 0.0% dtgreet/1
   577 root     1160K  892K sleep   59    0   0:00:00 0.0% ksh/1
   366 root     3476K 2472K sleep   59    0   0:00:00 0.0% nscd/27
   699 root     6984K 1948K sleep   59    0   0:00:00 0.0% sshd/1
   506 root     6672K 4776K sleep   59    0   0:00:00 0.0% snmpd/1
   476 root     2724K 1552K sleep   59    0   0:00:00 0.0% dmispd/1
   481 root     3268K 1964K sleep   59    0   0:00:00 0.0% snmpXdmid/2
   532 root     2492K 1928K sleep   59    0   0:00:00 0.0% vold/5
   538 root     2352K 1564K sleep   59    0   0:00:00 0.0% devfsadm/6
   457 root     4448K 1668K sleep   59    0   0:00:00 0.0% dtlogin/1
   458 root     2040K 1240K sleep   59    0   0:00:00 0.0% snmpdx/1
   466 root     1468K  724K sleep   59    0   0:00:00 0.0% fbconsole/1
   413 root     1700K  700K sleep   59    0   0:00:00 0.0% smcboot/1
   562 root     1076K  824K sleep   59    0   0:00:00 0.0% sh/1
   412 root     1700K  700K sleep   59    0   0:00:00 0.0% smcboot/1
   356 root     3336K 1176K sleep   59    0   0:00:00 0.0% sshd/1
   533 root     7480K 2860K sleep   59    0   0:00:00 0.0% dtlogin/1
   411 root     1704K 1032K sleep   59    0   0:00:00 0.0% smcboot/1
   263 root     1064K  620K sleep   59    0   0:00:00 0.0% utmpd/1
   359 root     4400K 2212K sleep   59    0   0:00:00 0.0% syslogd/16
   261 root     3936K 3004K sleep   59    0   0:00:02 0.0% inetd/4
   264 root     1888K 1084K sleep   59    0   0:00:00 0.0% ttymon/1
   241 daemon   2340K 1520K sleep   59    0   0:00:00 0.0% statd/1
   122 root     1328K  904K sleep   59    0   0:00:00 0.0% powerd/3
   202 root     2228K  884K sleep   59    0   0:00:00 0.0% cron/1
    96 root     2128K 1288K sleep   59    0   0:00:00 0.0% syseventd/14
   554 root     7200K 3664K sleep   59    0   0:00:00 0.0% sshd/1
   361 root     9272K 5640K sleep   59    0   0:00:00 0.0% fmd/14
   244 daemon   2072K 1312K sleep   60  -20   0:00:00 0.0% lockd/2
    55 root     1952K  924K sleep   59    0   0:00:00 0.0% dhcpagent/1
   253 root     1700K  892K sleep   59    0   0:00:00 0.0% sac/1
   232 daemon   2288K 1012K sleep   59    0   0:00:00 0.0% rpcbind/1
   123 daemon   3908K 2016K sleep   59    0   0:00:00 0.0% kcfd/3
   117 root     2468K 1544K sleep   59    0   0:00:00 0.0% picld/4
   339 root     4252K 1592K sleep   59    0   0:00:00 0.0% automountd/3
   175 root     1852K  952K sleep   59    0   0:00:00 0.0% in.routed/1
     9 root     9000K 8068K sleep   59    0   0:00:11 0.0% svc.configd/18
     7 root     8888K 7940K sleep   59    0   0:00:05 0.0% svc.startd/13
   260 root     1948K 1168K sleep   59    0   0:00:00 0.0% ttymon/1</pre>
<p><em>The program in default view is less informative that top, but can give you info for zones, projects and even for processes bind to specific processor. Use the -u option to limit display to specific users. Use the -p option to limit display to specific processes</em></p>
<hr /><strong>prun</strong> &#8211; see example of pstop</p>
<hr /><strong>ps</strong></p>
<pre># /usr/bin/ps
   PID TTY         TIME CMD
   562 pts/2       0:00 sh
   577 pts/2       0:00 ksh
   757 pts/2       0:00 ps
# /usr/ucb/ps
   PID TT       S  TIME COMMAND
   260 console  S  0:00 /usr/lib/saf/ttymon -g -d /dev/console -l console -T sun-color -m ldterm,ttcompat -h -p unknown console lo
   562 pts/2    S  0:00 -sh
   577 pts/2    S  0:00 ksh -o ksh
   759 pts/2    O  0:00 /usr/ucb/ps
   701 pts/3    S  0:00 -sh</pre>
<hr /><strong>psig</strong></p>
<pre># psig 636
636:    /usr/sbin/named
HUP     default
INT     default
QUIT    default
ILL     default
TRAP    default
ABRT    default
EMT     default
FPE     default
KILL    default
BUS     default
SEGV    default
SYS     default
PIPE    ignored
ALRM    default
TERM    default
USR1    default
USR2    default
CLD     default                 NOCLDSTOP
PWR     default
WINCH   default
URG     default
POLL    default
STOP    default
TSTP    ignored
CONT    default
TTIN    ignored
TTOU    ignored
VTALRM  default
PROF    default
XCPU    default
XFSZ    ignored
WAITING default
LWP     default
FREEZE  default
THAW    default
CANCEL  default
LOST    default
XRES    default
JVM1    default
JVM2    default
RTMIN   default
RTMIN+1 default
RTMIN+2 default
RTMIN+3 default
RTMAX-3 default
RTMAX-2 default
RTMAX-1 default
RTMAX   default</pre>
<hr /><strong>pstack</strong></p>
<pre># pstack 636
636:    /usr/sbin/named
----------------------  lwp# 1 / thread# 1  --------------------------
 d23700a5 sigtimedwait (8047ce0, 8047cf0, 0)
 d23655a6 sigwait  (8047dc0) + 1c
 d235e206 __posix_sigwait (8047dc0, 8047e60) + 2e
 d24db3dd isc_app_run (8047ec8, 8047e60, d27fb840, 0, 8047e98, 805c33e) + 158
 08066da7 main     (1, 8047ea4, 8047eac) + fe
 0805c33e ???????? (1, 8047f30, 0, 8047f40, 8047f47, 8047f5f)
----------------------  lwp# 2 / thread# 2  --------------------------
 d236fc99 lwp_park (0, 0, 0)
 d236a501 cond_wait_queue (80a2a7c, 80a2a48, 0, 0) + 3b
 d236a9fa _cond_wait (80a2a7c, 80a2a48) + 66
 d236aa3c cond_wait (80a2a7c, 80a2a48) + 21
 d236aa75 pthread_cond_wait (80a2a7c, 80a2a48) + 1b
 d24d871b dispatch (80a2a40, d2239fec, d236f93e, 80a2a40, 0, 0) + a0
 d24d8ba2 run      (80a2a40) + c
 d236f93e _thr_setup (d2262400) + 4e
 d236fc20 _lwp_start (d2262400, 0, 0, d2239ff8, d236fc20, d2262400)
----------------------  lwp# 3 / thread# 3  --------------------------
 d236fc99 lwp_park (0, d2218ec8, 0)
 d236a501 cond_wait_queue (80a2ae8, 80a2ab8, d2218ec8, 0) + 3b
 d236a8a1 cond_wait_common (80a2ae8, 80a2ab8, d2218ec8) + 1df
 d236aad5 _cond_timedwait (80a2ae8, 80a2ab8, d2218f28) + 51
 d236ab40 cond_timedwait (80a2ae8, 80a2ab8, d2218f28) + 24
 d236ab7c pthread_cond_timedwait (80a2ae8, 80a2ab8, d2218f28) + 1e
 d24e7601 isc_condition_waituntil (80a2ae8, 80a2ab8, 80a2ae0) + 81
 d24da800 run      (80a2ab0) + a2
 d236f93e _thr_setup (d21f0000) + 4e
 d236fc20 _lwp_start (d21f0000, 0, 0, d2218ff8, d236fc20, d21f0000)
----------------------  lwp# 4 / thread# 4  --------------------------
 d2370cd5 pollsys  (d21edce0, 6, 0, 0)
 d231ecca pselect  (1c, d21ede40, d21edec0, d239a868, 0, 0) + 18e
 d231efad select   (1c, d21ede40, d21edec0, 0, 0) + 6f
 d24e355c watcher  (80a5bd0) + bd
 d236f93e _thr_setup (d21f0400) + 4e
 d236fc20 _lwp_start (d21f0400, 0, 0, d21edff8, d236fc20, d21f0400)</pre>
<p><em>This command can sometimes be very helpful for debugging daemons. You can see the function call stack by thread, in real-time</em></p>
<hr /><strong>pstop</strong></p>
<pre># ps -efl|grep ssh
 0 S     root   554   356   0  40 20 d419b870   1800 d4c87e72 21:03:52 ?           0:00 /usr/lib/ssh/sshd
 0 S     root   356     1   0  40 20 d4195320    834 d49f3432 21:02:46 ?           0:00 /usr/lib/ssh/sshd
 0 S     root   560   554   0  40 20 d41931a0   1747 d4c87ab2 21:05:03 ?           0:02 /usr/lib/ssh/sshd
 0 S     root   812   809   0  40 20 d418a270   1746 d50402f2 22:09:00 ?           0:00 /usr/lib/ssh/sshd
 0 S     root   809   356   0  40 20 d4189a10   1801 d4c874f2 22:08:47 ?           0:00 /usr/lib/ssh/sshd
# pstop 356
# ssh localhost
<em>(here I stop with ctrl-C ssh client after 5 minutes of waiting)</em>
# prun 356
# ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is da:14:db:bc:2f:e0:0f:ef:f6:3f:12:0e:f4:77:0c:00.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Password:
Last login: Wed Jun 13 22:09:00 2007 from gateway
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
#</pre>
<p><em>Command is interesting, but I don&#8217;t see much benefit for daily tasks</em></p>
<hr /><strong>ptree</strong></p>
<pre># ptree
7     /lib/svc/bin/svc.startd
  253   /usr/lib/saf/sac -t 300
    264   /usr/lib/saf/ttymon
  260   /usr/lib/saf/ttymon -g -d /dev/console -l console -T sun-color -m ldterm,ttcomp
9     /lib/svc/bin/svc.configd
55    /sbin/dhcpagent
96    /usr/lib/sysevent/syseventd
117   /usr/lib/picl/picld
122   /usr/lib/power/powerd
123   /usr/lib/crypto/kcfd
175   /usr/sbin/in.routed
202   /usr/sbin/cron
232   /usr/sbin/rpcbind
241   /usr/lib/nfs/statd
244   /usr/lib/nfs/lockd
261   /usr/lib/inet/inetd start
263   /usr/lib/utmpd
339   /usr/lib/autofs/automountd
356   /usr/lib/ssh/sshd
  554   /usr/lib/ssh/sshd
    560   /usr/lib/ssh/sshd
      562   -sh
        577   ksh -o vi
          771   ptree
  696   /usr/lib/ssh/sshd
    699   /usr/lib/ssh/sshd
      701   -sh
359   /usr/sbin/syslogd
361   /usr/lib/fm/fmd/fmd
366   /usr/sbin/nscd
411   /usr/sadm/lib/smc/bin/smcboot
  412   /usr/sadm/lib/smc/bin/smcboot
  413   /usr/sadm/lib/smc/bin/smcboot
457   /usr/dt/bin/dtlogin -daemon
  466   /usr/openwin/bin/fbconsole -n -d :0
  468   /usr/X11/bin/Xorg :0 -depth 24 -nobanner -auth /var/dt/A:0-Zgai5a
  533   /usr/dt/bin/dtlogin -daemon
    550   dtgreet -display :0
458   /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
476   /usr/lib/dmi/dmispd
481   /usr/lib/dmi/snmpXdmid -s unknown
506   /usr/sfw/sbin/snmpd
532   /usr/sbin/vold -f /etc/vold.conf
538   devfsadmd
636   /usr/sbin/named</pre>
<p><em>No need for comments :-)</em></p>
<hr /><strong>pwait</strong></p>
<pre># ps -efl|grep name
 0 S     root   875     1   0  45 20 d4188950   1298 d553ab16 22:17:58 ?           0:00 /usr/sbin/named
# pwait 875
(in this moment from another terminal I execute svcadm disable dns/server)
#</pre>
<p><em>Maybe this command will be great in some specific scripts</em></p>
<hr /><strong>pwdx</strong></p>
<pre># pwdx 636
636:    /var/named</pre>
<p><em>Can be helpful in case of strange errors when unmount some filesystem</em></p>
<hr /><strong>truss</strong></p>
<pre># truss ls
execve("/usr/bin/ls", 0x08047E40, 0x08047E48)  argc = 1
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
resolvepath("/usr/bin/ls", "/usr/bin/ls", 1023) = 11
sysconfig(_CONFIG_PAGESIZE)                     = 4096
xstat(2, "/usr/bin/ls", 0x08047C38)             = 0
open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
xstat(2, "/lib/libsec.so.1", 0x080474D0)        = 0
resolvepath("/lib/libsec.so.1", "/lib/libsec.so.1", 1023) = 16
open("/lib/libsec.so.1", O_RDONLY)              = 3
mmap(0x00010000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xD27C0000
mmap(0x00010000, 139264, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xD2790000
mmap(0xD2790000, 49071, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xD2790000
mmap(0xD27AC000, 12169, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 49152) = 0xD27AC000
mmap(0xD27AF000, 8536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xD27AF000
munmap(0xD279C000, 65536)                       = 0
memcntl(0xD2790000, 8776, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3)                                        = 0

mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xD2780000
xstat(2, "/lib/libc.so.1", 0x080474D0)          = 0
resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
open("/lib/libc.so.1", O_RDONLY)                = 3
mmap(0xD27C0000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xD27C0000
mmap(0x00010000, 856064, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xD26A0000
mmap(0xD26A0000, 754581, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xD26A0000
mmap(0xD2769000, 24239, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 757760) = 0xD2769000
mmap(0xD276F000, 5656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xD276F000
munmap(0xD2759000, 65536)                       = 0
memcntl(0xD26A0000, 120300, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3)                                        = 0
xstat(2, "/lib/libavl.so.1", 0x080474D0)        = 0
resolvepath("/lib/libavl.so.1", "/lib/libavl.so.1", 1023) = 16
open("/lib/libavl.so.1", O_RDONLY)              = 3
mmap(0xD27C0000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xD27C0000
mmap(0x00010000, 73728, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xD2680000
mmap(0xD2680000, 2788, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xD2680000
mmap(0xD2691000, 204, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 4096) = 0xD2691000
munmap(0xD2681000, 65536)                       = 0
memcntl(0xD2680000, 1056, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
close(3)                                        = 0
munmap(0xD27C0000, 4096)                        = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xD27C0000
getcontext(0x080479D0)
getrlimit(RLIMIT_STACK, 0x080479C8)             = 0
getpid()                                        = 786 [785]
lwp_private(0, 1, 0xD27C2000)                   = 0x000001C3
setustack(0xD27C2060)
sysi86(SI86FPSTART, 0xD276FCD8, 0x0000133F, 0x00001F80) = 0x00000001
brk(0x080651E8)                                 = 0
brk(0x080671E8)                                 = 0
time()                                          = 1181761288
ioctl(1, TCGETA, 0x08047B9C)                    = 0
ioctl(1, TIOCGWINSZ, 0x08064460)                = 0
brk(0x080671E8)                                 = 0
brk(0x080711E8)                                 = 0
lstat64(".", 0x08046A70)                        = 0
openat(-3041965, ".", O_RDONLY|O_NDELAY|O_LARGEFILE) = 3
fcntl(3, F_SETFD, 0x00000001)                   = 0
fstat64(3, 0x08047AC0)                          = 0
getdents64(3, 0xD27C4000, 8192)                 = 992
getdents64(3, 0xD27C4000, 8192)                 = 0
close(3)                                        = 0
ioctl(1, TCGETA, 0x08045E44)                    = 0
fstat64(1, 0x08045DB0)                          = 0
TT_DB       cdrom       etc         kernel      mnt         platform    system      var
write(1, " T T _ D B              ".., 88)      = 88
bin         dev         export      lib         net         proc        tmp         vol
write(1, " b i n                  ".., 88)      = 88
boot        devices     home        lost+found  opt         sbin        usr
write(1, " b o o t                ".., 76)      = 76
_exit(0)</pre>
<p><em>Shows you system calls made by a process along with parameters of the function &#8211; very good for program execution traces. Use -u a.out to see user-level function calls. Note &#8220;a.out&#8221; is typed literally as &#8220;a.out&#8221; &#8211; not replaced with the name of the program</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nileshghogre.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nileshghogre.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nileshghogre.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nileshghogre.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nileshghogre.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nileshghogre.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nileshghogre.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nileshghogre.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=13&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nileshghogre.wordpress.com/2009/11/23/solaris-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d365d103be3d34ff8a85b51f5c73a33c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gnilesh</media:title>
		</media:content>
	</item>
		<item>
		<title>IP network multipathing</title>
		<link>http://nileshghogre.wordpress.com/2009/09/22/ip-network/</link>
		<comments>http://nileshghogre.wordpress.com/2009/09/22/ip-network/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 10:17:59 +0000</pubDate>
		<dc:creator>Nilesh Ghogre</dc:creator>
				<category><![CDATA[IP network multipathing]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[IP network multipathing provides your system with the following capabilities: Recovery from single-point failures with network adapters Increased traffic throughput To use IP network multipathing, you must have an alternate adapter connected to the same IP link. Consequently, if a failure occurs in the network adapter, the system switches all the network accesses automatically from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=1&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>IP network multipathing provides your system with the following capabilities:</p>
<ul>
<li>Recovery from single-point failures with network adapters</li>
<li>Increased traffic throughput</li>
</ul>
<p>To use IP network multipathing, you must have an alternate adapter connected to the same IP link. Consequently, if a failure occurs in the network adapter, the system switches all the network accesses automatically from the failed adapter to the alternate adapter. This process ensures uninterrupted access to the network. Also, when you have multiple network adapters that are connected to the same IP link, you achieve increased traffic throughput. The traffic is spread across multiple network adapters</p>
<p>The Solaris implementation of IP network multipathing provides the following features:</p>
<p><a></a></p>
<ul>
<li><a name="indexterm-2"></a><a name="indexterm-3"></a><strong>Failure Detection</strong> – Ability to detect when a network adapter has failed and automatic switching<a name="indexterm-4"></a> (<strong>failover</strong>) of the network access to an alternate network adapter. Failure detection can only occur when you have configured an alternate network adapter. See <a href="http://docs.sun.com/app/docs/doc/816-5249/6mbdgpoiv?l=en&amp;a=view#mpoverview-23">Detecting Physical Interface Failures</a> for more information.</li>
<li><a name="indexterm-5"></a><a name="indexterm-6"></a><strong>Repair Detection</strong> – Ability to detect when a network adapter that failed previously has been repaired. The network access is switched back automatically <a name="indexterm-7"></a>(<strong>failback</strong>) to an alternate network adapter. Repair detection assumes that you have enabled failbacks. See <a href="http://docs.sun.com/app/docs/doc/816-5249/6mbdgpoiv?l=en&amp;a=view#mpoverview-24">Detecting Physical Interface Repairs</a> for more information.</li>
<li><a name="indexterm-8"></a><a name="indexterm-9"></a><a name="indexterm-10"></a><strong>Outbound Load Spreading</strong> – Outbound network packets are spread across multiple network adapters without affecting the ordering of packets in order to achieve higher throughput. Load spreading occurs only when the network traffic is flowing to multiple destinations that use multiple connections.</li>
</ul>
<p>IP Network Multipathing Components</p>
<table border="2" cellspacing="0" cellpadding="10" width="100%">
<caption><strong> </strong></caption>
<thead>
<tr>
<th align="left" valign="top" scope="col">Component</th>
<th align="left" valign="top" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top">IP Link</td>
<td align="left" valign="top">A communication facility or medium over which nodes can communicate at the link layer. The link layer is the layer immediately following IPv4 or IPv6. Examples include Ethernets, simple or bridged, or ATM networks. One or more IPv4 subnet numbers or prefixes are assigned to an IP link. A subnet number or prefix cannot be assigned to more than one IP link. In ATM LANE, an IP link is a single emulated LAN. When using ARP, the scope of the ARP protocol is a single IP link. <a name="indexterm-15"></a><a name="indexterm-16"></a></td>
</tr>
<tr>
<td align="left" valign="top">Network Interface Card (NIC)</td>
<td align="left" valign="top">Network adapter that is either internal or a separate card that serves as an interface to a link. <a name="indexterm-17"></a><a name="indexterm-18"></a></td>
</tr>
<tr>
<td align="left" valign="top">Physical interface</td>
<td align="left" valign="top">A node&#8217;s attachment to a link. This attachment is often implemented as a device driver plus a network adapter. Some network adapters can have multiple points of attachment, for example, qfe. The usage of <strong>Network adapter</strong> in this document refers to a &#8220;Single Point of Attachment.&#8221;<a name="indexterm-19"></a><a name="indexterm-20"></a></td>
</tr>
<tr>
<td align="left" valign="top">Physical interface group</td>
<td align="left" valign="top">The set of physical interfaces on a system that is connected to the same link. The set is identified by assigning the same (non-null) character string name to all the physical interfaces in the group. <a name="indexterm-21"></a><a name="indexterm-22"></a></td>
</tr>
<tr>
<td align="left" valign="top">Physical interface group name</td>
<td align="left" valign="top">A name that is assigned to a physical interface that identifies the group. The name is local to a system. Multiple physical interfaces, sharing the same group name, form a physical interface group. <a name="indexterm-23"></a><a name="indexterm-24"></a></td>
</tr>
<tr>
<td align="left" valign="top">Failure detection</td>
<td align="left" valign="top">The process of detecting when a NIC or the path from the NIC to a layer 3 device no longer works. <a name="indexterm-25"></a><a name="indexterm-26"></a></td>
</tr>
<tr>
<td align="left" valign="top">Repair detection</td>
<td align="left" valign="top">The process of detecting when a NIC or the path from the NIC to some layer 3 device starts operating correctly after a failure. <a name="indexterm-27"></a><a name="indexterm-28"></a></td>
</tr>
<tr>
<td align="left" valign="top">Failover</td>
<td align="left" valign="top">The process of switching network access from a failed interface to a good physical interface. Network access includes IPv4 unicast, multicast, and broadcast traffic, as well as IPv6 unicast and multicast traffic. <a name="indexterm-29"></a></td>
</tr>
<tr>
<td align="left" valign="top">Failback</td>
<td align="left" valign="top">The process of switching back network access to an interface that is detected to have been repaired. <a name="indexterm-30"></a></td>
</tr>
<tr>
<td align="left" valign="top">Standby Interface</td>
<td align="left" valign="top">A physical interface that is not used to carry data traffic unless some other physical interface in the group has failed.</td>
</tr>
</tbody>
</table>
<ul>
<li>The <kbd>in.mpathd</kbd> daemon can detect interface failure and repair</li>
</ul>
<h2>Grouping Physical Interfaces</h2>
<p>You use the <kbd>ifconfig</kbd> command to configure groups. This command uses a new <tt>group</tt> parameter that requires a group name. The <kbd>ifconfig</kbd> command places both the IPv4 and IPv6 instances of the interface in that group. The <tt>group</tt> parameter has the following syntax:</p>
<ul>
<li>ifconfig <var>interface-name</var> group <var>group-name</var></li>
</ul>
<p>You can have any number of network adapters that you can configure in the same</p>
<p>multipathing group. You cannot use the group parameter with logical interfaces.</p>
<p>For example, you can use the parameter with <tt>hme0</tt>, but not with <tt>hme0:1</tt>.</p>
<h2>Configuring Test Addresses</h2>
<p>You must configure all physical interfaces of a multipathing group with a test address. You need test addresses to detect failures and repairs. If a test address is not configured, the test address is not chosen for failover. Only <kbd>in.mpathd</kbd> uses test addresses. Normal applications should not use this address. This address is not chosen for failover when the interface fails. In IPv4, you should configure the test address in such a way that normal applications do not use the test address. The <kbd>in.mpathd</kbd> multipathing daemon requires a test IP address for detecting failures and repairs. You must use a routeable address for this IP address. The subnet prefix of the address must be known to any routers present on the link. You use the <kbd>ifconfig</kbd> command&#8217;s new <strong>-failover</strong> option to configure a test address. Use the following syntax to configure a test address:</p>
<pre># ifconfig <var>interface-name</var> addif <var>ip-address</var> &lt;other-parameters&gt; -failover up
EX:
# ifconfig hme0 addif 19.16.85.21 netmask + broadcast + -failover up</pre>
<h3>Preventing Applications From Using Test Addresses</h3>
<p>After you have configured a test address, you need to ensure that this address is not used by normal applications. If you let applications use the test address, applications fail, because test addresses do not fail over during the failover operation. To ensure that IP does not pick the test address for normal applications, you mark the test address <tt>deprecated</tt> by using the <kbd>ifconfig</kbd> command. This parameter has the following syntax:</p>
<p>#ifconfig <var>interface-name</var> deprecated</p>
<h2>Using the <kbd>hostname</kbd> File to Configure Groups and Test Addresses</h2>
<p>You can use the <kbd>/etc/hostname.</kbd><var>interface</var> files to configure multipathing groups and test addresses. To configure a multipathing group by using the <kbd>/etc/hostname.</kbd><var>interface</var> file, you can add a line to the file by using the following syntax:</p>
<pre><var>interface-address</var> &lt;parameters&gt;  group <var>group-name</var> up \
addif <var>logical-interface-address</var> &lt;parameters&gt; up

EX:#
19.16.85.19 netmask + broadcast + group test up \
addif 19.16.85.21 deprecated -failover netmask + broadcast + up
<h2>How to Configure a Multipathing Interface Group With Two Interfaces</h2>

Place each physical interface into a multipathing group by typing the following command.
<table border="1" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig <var>interface-name</var> group <var>group-name</var></pre>
</td>
</tr>
</tbody>
</table>
<p>For example, to place <tt>hme0</tt> and <tt>hme1</tt> under group <tt>test</tt>, you type the following commands:</p>
<table border="1" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig hme0 group test
# ifconfig hme1 group test</pre>
</td>
</tr>
</tbody>
</table>
<p>Configure a test address for all the physical interfaces.</p>
<table border="1" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig <var>interface-name</var> addif <var>ip-address</var> &lt;parameters&gt; -failover deprecated up</pre>
</td>
</tr>
</tbody>
</table>
<p>For example, if you wanted to configure a test address on <tt>hme0</tt> with the following configuration:</p>
<p>§                  Address set to <tt>19.16.85.21</tt></p>
<p>§                  Netmask and broadcast address set to the default value</p>
<p>§                  <kbd><strong>-failover</strong></kbd> and <tt>deprecated</tt> options set</p>
<p>You type the following command:</p>
<table border="1" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig hme0 addif 19.16.85.21 netmask + broadcast + -failover deprecated up</pre>
</td>
</tr>
</tbody>
</table>
<p>You can check the configuration by typing the following:</p>
<table border="1" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig hme0:1
         hme0:1: flags=9000843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER&gt;
    mtu 1500 index 2 inet 19.16.85.21 netmask ffffff00 broadcast 19.16.85.255</pre>
</td>
</tr>
</tbody>
</table>
<p>For example, if you want to configure a test address on <tt>hme1</tt> with the following configuration:</p>
<p>§Address set to <tt>19.16.85.22</tt></p>
<p>§Netmask and broadcast address set to the default value</p>
<p>§<kbd><strong>-failover</strong></kbd> and <tt>deprecated</tt> options set</p>
<p>Type the following command:</p>
<table border="1" cellpadding="0" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig hme1 addif 19.16.85.22 netmask + broadcast + -failover deprecated up</pre>
</td>
</tr>
</tbody>
</table>
<h2>Configuring Standby Interfaces</h2>
<p><a name="indexterm-84"></a><a name="indexterm-85"></a>You can configure multipathing groups with standby interfaces. As the name implies, the interface is considered a standby interface. The standby interface is not used unless some other interface in the group fails. A standby interface has an IFF_INACTIVE flag when the interface is not hosting any failover IP address. Consequently, when an active interface fails, the standby interface is always chosen for failover. After the standby interface is chosen, the IFF_INACTIVE flag is cleared on the standby interface. From that instant, the active standby interface is treated the same as other active interfaces. Some failures might not choose a standby interface. Instead, some failures might choose an active interface that hosts fewer IP addresses than the standby interface.</p>
<p>The standby interface is not used to send normal data packets. Consequently, limited traffic flows on a standby interface. You must configure standby interfaces with a test address to ensure that probes are sent to determine if the interface is functional. If you do not configure standby interfaces with a test address, the interface is not chosen for failovers when another interface in the group fails. A standby interface might carry traffic under the following conditions:</p>
<p><a></a></p>
<ul>
<li>If another host on the network communicates with a host by using the standby interface address, the standby interface is subsequently used for incoming packets.</li>
<li>Applications can bind to an address by using <tt>bind</tt> or <tt>IP_ADD_MEMBERSHIP</tt>. Applications that bind to the address that is hosted on the standby interface might continue to generate traffic by using the standby interface.</li>
</ul>
<p>Thus, the system does not normally select a standby interface, except for probes, unless the standby interface is explicitly chosen by an application. If some interface in the group fails, all network access is switched to the standby interface. To configure a standby interface, you use the <kbd>ifconfig</kbd> command's new <tt>standby</tt> parameter by using the following syntax:</p>
<p><a name="indexterm-86"></a><a name="indexterm-87"></a></p>
<table border="1" cellpadding="1" width="100%">
<tbody>
<tr>
<td>
<pre># ifconfig <var>interface-name</var> standby group <var>group-name</var></pre>
</td>
</tr>
</tbody>
</table>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nileshghogre.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nileshghogre.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nileshghogre.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nileshghogre.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nileshghogre.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nileshghogre.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nileshghogre.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nileshghogre.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nileshghogre.wordpress.com&amp;blog=9598101&amp;post=1&amp;subd=nileshghogre&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nileshghogre.wordpress.com/2009/09/22/ip-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d365d103be3d34ff8a85b51f5c73a33c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gnilesh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
