- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- fuser counting
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2002 05:04 PM
05-24-2002 05:04 PM
fuser counting
and some times appear message " too many users use this devices"(?) maybea
Anyway I want to know how many users use this devices
like this
oracle users=203
oracle8 users=108
root users=5
Do you have any good idea
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2002 05:45 PM
05-24-2002 05:45 PM
Re: fuser counting
One way is to create a script like this (replace RAW value with your raw LV):
======================================
#!/sbin/sh
RAW=/dev/vx/dsk/rootdg/homevol
fuser -u $RAW 2>&1 | tr [")"] ["\n"] | grep \( |cut -d\( -f2 > /tmp/fuser.list
NAMES=`cat /tmp/fuser.list | sort | uniq`
for name in $NAMES
do
echo $name users=`grep $name /tmp/fuser.list |wc -l`
done
rm -f /tmp/fuser.list
======================================
Note is that fuser outputs the userids into STDERR and the process IDs into STDOUT. As such, 2>&1 is necessary to capture fuser's output in entirety.
Tested the script to work. Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2002 06:12 PM
05-24-2002 06:12 PM
Re: fuser counting
/dev/vx/dsk/rootdg/test_vol1: 21732c(root) 21892c(root) 21654c(admin1) 21811c(root)
RAW=/dev/vx/dsk/rootdg/test_vol1;fuser -u $RAW 2>&1 | tr [")"] ["\n"]
/dev/vx/dsk/rootdg/test_vol1: 21732c(root
21893c(root
21894c(root
21654c(admin1
21811c(root
]RAW=/dev/vx/dsk/rootdg/test_vol1;fuser -u $RAW 2>&1 | tr [")"] ["\n"] | grep \( |cut -d\( -f2
root
root
root
admin1
root
root
root
Um Very interestrang
Why this happen very interestrang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2002 06:32 PM
05-24-2002 06:32 PM
Re: fuser counting
interestrang = interesting but strange?
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).
Please feel free to let me know of any clarifications you need regarding the script.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2002 06:37 PM
05-24-2002 06:37 PM
Re: fuser counting
tr [")"] ["\n"]
- this replaces all ) characters with the newline, thus breaking the usernames into separate lines.
grep \(
- because there are blank lines right at the end, this is one method to clear the blank lines.
cut -d\( -f2
- this extracts just the username without the prefixed process id and ( character.
Hope this helps. Regards.
Steven Sim Kok Leong