<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FIN_WAIT_2 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577859#M920091</link>
    <description>&lt;BR /&gt;I dont have a script - but here is the procedure to it;&lt;BR /&gt;&lt;BR /&gt;Find the TCP instance data and then use tcp_discon to remove&lt;BR /&gt; the instance as follows:&lt;BR /&gt;&lt;BR /&gt; # ndd -get /dev/tcp tcp_status&lt;BR /&gt; TCP dest snxt suna swnd cwnd rnxt rack rwnd rto mss [lport,fport] state&lt;BR /&gt;&lt;BR /&gt; 0183b8b4 015.043.233.086 533cb8ce 533cb8ce 00008000 00003000 533bc583 533bc583&lt;BR /&gt; 00000000 02812 04096 [c00a,cea9] TCP_CLOSE_WAIT&lt;BR /&gt;&lt;BR /&gt; So, if you wanted to remove this connection:&lt;BR /&gt; # ndd -set /dev/tcp tcp_discon 0x0183b8b4&lt;BR /&gt;&lt;BR /&gt; If you want to use the tcp_discon_by_addr, you use a 24 byte string that  contains the hex representation of the quadruple.&lt;BR /&gt;&lt;BR /&gt; For example, if the connection that I want to delete is:&lt;BR /&gt;&lt;BR /&gt; Local IP: 192.1.2.3 (0xc0010203)&lt;BR /&gt; Local Port: 1024 (0x0400)&lt;BR /&gt; Remote IP : 192.4.5.6 (0xc0040506)&lt;BR /&gt; Remote Port: 2049 (0x0801)&lt;BR /&gt;&lt;BR /&gt; The "hex" string you pass to tcp_discon_by_addr is:&lt;BR /&gt;&lt;BR /&gt; # ndd -set /dev/tcp tcp_discon_by_addr "c00102030400c00405060801"&lt;BR /&gt;&lt;BR /&gt; NOTE: the preceding 0x that typically indicates a Hex number is NOT part of the string passed.&lt;BR /&gt;</description>
    <pubDate>Tue, 11 Sep 2001 12:17:50 GMT</pubDate>
    <dc:creator>Stefan Farrelly</dc:creator>
    <dc:date>2001-09-11T12:17:50Z</dc:date>
    <item>
      <title>FIN_WAIT_2</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577858#M920090</link>
      <description>Where can I find an script to "kill" connections in FIN_WAIT_2 state ??</description>
      <pubDate>Tue, 11 Sep 2001 12:03:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577858#M920090</guid>
      <dc:creator>Daniel Ubeda</dc:creator>
      <dc:date>2001-09-11T12:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: FIN_WAIT_2</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577859#M920091</link>
      <description>&lt;BR /&gt;I dont have a script - but here is the procedure to it;&lt;BR /&gt;&lt;BR /&gt;Find the TCP instance data and then use tcp_discon to remove&lt;BR /&gt; the instance as follows:&lt;BR /&gt;&lt;BR /&gt; # ndd -get /dev/tcp tcp_status&lt;BR /&gt; TCP dest snxt suna swnd cwnd rnxt rack rwnd rto mss [lport,fport] state&lt;BR /&gt;&lt;BR /&gt; 0183b8b4 015.043.233.086 533cb8ce 533cb8ce 00008000 00003000 533bc583 533bc583&lt;BR /&gt; 00000000 02812 04096 [c00a,cea9] TCP_CLOSE_WAIT&lt;BR /&gt;&lt;BR /&gt; So, if you wanted to remove this connection:&lt;BR /&gt; # ndd -set /dev/tcp tcp_discon 0x0183b8b4&lt;BR /&gt;&lt;BR /&gt; If you want to use the tcp_discon_by_addr, you use a 24 byte string that  contains the hex representation of the quadruple.&lt;BR /&gt;&lt;BR /&gt; For example, if the connection that I want to delete is:&lt;BR /&gt;&lt;BR /&gt; Local IP: 192.1.2.3 (0xc0010203)&lt;BR /&gt; Local Port: 1024 (0x0400)&lt;BR /&gt; Remote IP : 192.4.5.6 (0xc0040506)&lt;BR /&gt; Remote Port: 2049 (0x0801)&lt;BR /&gt;&lt;BR /&gt; The "hex" string you pass to tcp_discon_by_addr is:&lt;BR /&gt;&lt;BR /&gt; # ndd -set /dev/tcp tcp_discon_by_addr "c00102030400c00405060801"&lt;BR /&gt;&lt;BR /&gt; NOTE: the preceding 0x that typically indicates a Hex number is NOT part of the string passed.&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Sep 2001 12:17:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577859#M920091</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2001-09-11T12:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: FIN_WAIT_2</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577860#M920092</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;have a look at this doc:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://us-support2.external.hp.com/cki/bin/doc.pl/sid=0c20be0f0b98cb7088/screen=ckiDisplayDocument?docId=200000050068096" target="_blank"&gt;http://us-support2.external.hp.com/cki/bin/doc.pl/sid=0c20be0f0b98cb7088/screen=ckiDisplayDocument?docId=200000050068096&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Or if you have no access here is the script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# Hewlett-Packard Corporation&lt;BR /&gt;# This script is UNSUPPORTED.  Use at own risk.&lt;BR /&gt;# @(#)$Revision: 1.3 $   $Author: scotty $   $Date: 98/08/25 17:55:01 $&lt;BR /&gt;#&lt;BR /&gt;# This script will query the system for any TCP connections that&lt;BR /&gt;# are in the FIN_WAIT_2 state and forcibly disconnect them.  It&lt;BR /&gt;# uses netstat(1) to find the FIN_WAIT_2 connections and calls&lt;BR /&gt;# ndd with the correct hexidecimal representation of the connection&lt;BR /&gt;# to close the connection.&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;# Temporary files used to compare netstat output&lt;BR /&gt;#&lt;BR /&gt;MYSCRIPTNAME=${0##*/}&lt;BR /&gt;TMPFILE1=/var/tmp/$MYSCRIPTNAME.1&lt;BR /&gt;TMPFILE2=/var/tmp/$MYSCRIPTNAME.2&lt;BR /&gt;#&lt;BR /&gt;# Create a log file to keep track of connection that were removed&lt;BR /&gt;#&lt;BR /&gt;LOGFILE=/var/adm/$MYSCRIPTNAME.log&lt;BR /&gt;function getFinWait2 {&lt;BR /&gt;/usr/bin/printf "%.2x%.2x%.2x%.2x%.4x%.2x%.2x%.2x%.2x%.4x\n" $(/usr/bin/netstat -an -f inet | /usr/bin/grep FIN_WAIT_2 | /usr/bin/awk '{print $4,$5}' | /usr/bin/sed 's/\./ /g') &amp;gt; $TMPFILE1&lt;BR /&gt;}&lt;BR /&gt;function compareFinWait2 {&lt;BR /&gt;&lt;BR /&gt;FIRST_TIME=1&lt;BR /&gt;cp $TMPFILE1 $TMPFILE2&lt;BR /&gt;getFinWait2&lt;BR /&gt;comm -12 $TMPFILE1 $TMPFILE2 | while read CONN&lt;BR /&gt;do&lt;BR /&gt;        if [[ $CONN != "000000000000000000000000" ]]&lt;BR /&gt;        then&lt;BR /&gt;                if [ $FIRST_TIME -eq 1 ]&lt;BR /&gt;                then&lt;BR /&gt;                        print &amp;gt;&amp;gt; $LOGFILE&lt;BR /&gt;                        date &amp;gt;&amp;gt; $LOGFILE&lt;BR /&gt;                        FIRST_TIME=0&lt;BR /&gt;                fi&lt;BR /&gt;                print "/usr/bin/ndd -set /dev/tcp tcp_discon_by_addr&lt;BR /&gt;\"$CONN\""&lt;BR /&gt;&amp;gt;&amp;gt; $LOGFILE&lt;BR /&gt;                /usr/bin/ndd -set /dev/tcp tcp_discon_by_addr $CONN&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;getFinWait2&lt;BR /&gt;}&lt;BR /&gt;#&lt;BR /&gt;# Main&lt;BR /&gt;#&lt;BR /&gt;touch $TMPFILE1&lt;BR /&gt;touch $TMPFILE2&lt;BR /&gt;compareFinWait2&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Sep 2001 12:20:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577860#M920092</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-09-11T12:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: FIN_WAIT_2</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577861#M920093</link>
      <description>I woudl strongly suggest that folks NOT use that ndd kludge. &lt;BR /&gt;&lt;BR /&gt;If you are running on HP-UX 11, when an application closes a connection, the TCP stack will immediately enable keepalives on that connection. Those keepalive probes will terminate the connection in FIN_WAIT_2 sometime between tcp_keepalive_detached_interval and tcp_keepalive_detached_interval+tcp_ip_abort_interval milliseconds.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Sep 2001 17:04:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577861#M920093</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2001-09-11T17:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: FIN_WAIT_2</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577862#M920094</link>
      <description>You'll get the info in the attached doc.&lt;BR /&gt;&lt;BR /&gt;Bill</description>
      <pubDate>Wed, 12 Sep 2001 13:27:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fin-wait-2/m-p/2577862#M920094</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-09-12T13:27:13Z</dc:date>
    </item>
  </channel>
</rss>

