<?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: fuser counting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731616#M836352</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;One way is to create a script like this (replace RAW value with your raw LV):&lt;BR /&gt;&lt;BR /&gt;======================================&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt; &lt;BR /&gt;RAW=/dev/vx/dsk/rootdg/homevol&lt;BR /&gt; &lt;BR /&gt;fuser -u $RAW 2&amp;gt;&amp;amp;1 | tr [")"] ["\n"] | grep \( |cut -d\( -f2 &amp;gt; /tmp/fuser.list&lt;BR /&gt;NAMES=`cat /tmp/fuser.list | sort | uniq`&lt;BR /&gt;for name in $NAMES&lt;BR /&gt;do&lt;BR /&gt;  echo $name users=`grep $name /tmp/fuser.list |wc -l`&lt;BR /&gt;done&lt;BR /&gt;rm -f /tmp/fuser.list&lt;BR /&gt;======================================&lt;BR /&gt;&lt;BR /&gt;Note is that fuser outputs the userids into STDERR and the process IDs into STDOUT. As such, 2&amp;gt;&amp;amp;1 is necessary to capture fuser's output in entirety.&lt;BR /&gt;&lt;BR /&gt;Tested the script to work. Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
    <pubDate>Sat, 25 May 2002 00:45:01 GMT</pubDate>
    <dc:creator>Steven Sim Kok Leong</dc:creator>
    <dc:date>2002-05-25T00:45:01Z</dc:date>
    <item>
      <title>fuser counting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731615#M836351</link>
      <description>I use oracle by raw device &lt;BR /&gt;and some times appear message " too many users use this devices"(?)  maybea&lt;BR /&gt;Anyway I want to know how many users use this devices&lt;BR /&gt;like this &lt;BR /&gt;oracle users=203&lt;BR /&gt;oracle8 users=108&lt;BR /&gt;root users=5&lt;BR /&gt;Do you have any good idea</description>
      <pubDate>Sat, 25 May 2002 00:04:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731615#M836351</guid>
      <dc:creator>chin hyeon jung</dc:creator>
      <dc:date>2002-05-25T00:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: fuser counting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731616#M836352</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;One way is to create a script like this (replace RAW value with your raw LV):&lt;BR /&gt;&lt;BR /&gt;======================================&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt; &lt;BR /&gt;RAW=/dev/vx/dsk/rootdg/homevol&lt;BR /&gt; &lt;BR /&gt;fuser -u $RAW 2&amp;gt;&amp;amp;1 | tr [")"] ["\n"] | grep \( |cut -d\( -f2 &amp;gt; /tmp/fuser.list&lt;BR /&gt;NAMES=`cat /tmp/fuser.list | sort | uniq`&lt;BR /&gt;for name in $NAMES&lt;BR /&gt;do&lt;BR /&gt;  echo $name users=`grep $name /tmp/fuser.list |wc -l`&lt;BR /&gt;done&lt;BR /&gt;rm -f /tmp/fuser.list&lt;BR /&gt;======================================&lt;BR /&gt;&lt;BR /&gt;Note is that fuser outputs the userids into STDERR and the process IDs into STDOUT. As such, 2&amp;gt;&amp;amp;1 is necessary to capture fuser's output in entirety.&lt;BR /&gt;&lt;BR /&gt;Tested the script to work. Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Sat, 25 May 2002 00:45:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731616#M836352</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-05-25T00:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: fuser counting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731617#M836353</link>
      <description>RAW=/dev/vx/dsk/rootdg/test_vol1;fuser -u $RAW&lt;BR /&gt;/dev/vx/dsk/rootdg/test_vol1:    21732c(root)   21892c(root)   21654c(admin1)   21811c(root)&lt;BR /&gt;RAW=/dev/vx/dsk/rootdg/test_vol1;fuser -u $RAW 2&amp;gt;&amp;amp;1 | tr [")"] ["\n"]&lt;BR /&gt;/dev/vx/dsk/rootdg/test_vol1:    21732c(root&lt;BR /&gt;   21893c(root&lt;BR /&gt;   21894c(root&lt;BR /&gt;   21654c(admin1&lt;BR /&gt;   21811c(root&lt;BR /&gt;]RAW=/dev/vx/dsk/rootdg/test_vol1;fuser -u $RAW 2&amp;gt;&amp;amp;1 | tr [")"] ["\n"] | grep \( |cut -d\( -f2&lt;BR /&gt;root&lt;BR /&gt;root&lt;BR /&gt;root&lt;BR /&gt;admin1&lt;BR /&gt;root&lt;BR /&gt;root&lt;BR /&gt;root&lt;BR /&gt;Um Very interestrang&lt;BR /&gt;Why this happen very interestrang</description>
      <pubDate>Sat, 25 May 2002 01:12:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731617#M836353</guid>
      <dc:creator>chin hyeon jung</dc:creator>
      <dc:date>2002-05-25T01:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: fuser counting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731618#M836354</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;interestrang = interesting but strange?&lt;BR /&gt;&lt;BR /&gt;The script extracts the list of process owners currently using the raw volume (you have just listed this during stepping through of the script), identifies each owner uniquely (sort | uniq)and counts the number of processes running on the raw volume for each unique user (grep ... | wc -l).&lt;BR /&gt;&lt;BR /&gt;Please feel free to let me know of any clarifications you need regarding the script.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Sat, 25 May 2002 01:32:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731618#M836354</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-05-25T01:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: fuser counting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731619#M836355</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;tr [")"] ["\n"] &lt;BR /&gt;- this replaces all ) characters with the newline, thus breaking the usernames into separate lines. &lt;BR /&gt;&lt;BR /&gt;grep \(&lt;BR /&gt;- because there are blank lines right at the end, this is one method to clear the blank lines.&lt;BR /&gt;&lt;BR /&gt;cut -d\( -f2 &lt;BR /&gt;- this extracts just the username without the prefixed process id and ( character.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Sat, 25 May 2002 01:37:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fuser-counting/m-p/2731619#M836355</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-05-25T01:37:56Z</dc:date>
    </item>
  </channel>
</rss>

