1832241 Members
2724 Online
110041 Solutions
New Discussion

strpty

 
SOLVED
Go to solution
Steve Sauve
Frequent Advisor

strpty

Does anyone know a way to see how many streaming pty (strpty) processes are currently running? I'm running HPUX 10.2.

Thanks a lot,
Steve
6 REPLIES 6
Berlene Herren
Honored Contributor

Re: strpty

If you cd /dev and type

#ll pt* | wc -l

that may do it...

Berlene

http://www.mindspring.com/~bkherren/dobes/index.htm
Steve Sauve
Frequent Advisor

Re: strpty

Thanks, but that is not quite it. That will show me the max number of strpty's that I can have, but not how many are currently in use. (at least I believe).

Steve
Victor BERRIDGE
Honored Contributor

Re: strpty

would
ll /dev/pts?grep ?wc -l
do want you want?
e.g.
caph:/dev/pts> ll |grep "Nov 1"|wc -l
6
Steve Sauve
Frequent Advisor

Re: strpty

Good thought, but it seems that the files have thier creation date and it doesn't change based on usage.

Steve
Alan Riggs
Honored Contributor

Re: strpty

The time stamp of the file does change when a new connection is established.
Mike Stroyan
Honored Contributor
Solution

Re: strpty

You could run "fuser /dev/pts/*" as root and count
the number of lines that list processes.
Or you could use the attached program that calls pstat_getproc and pstat_getfile to check for files in use. It then uses statfs, opendir and readdir to identify which open files are entries in /dev/pts/.