Operating System - HP-UX
1823113 Members
3303 Online
109646 Solutions
New Discussion юеВ

Report users application wise.

 
SOLVED
Go to solution
brian_31
Super Advisor

Report users application wise.

We are using 11.0 on N-class and have users connected from PC accessing 7 Xmotif applications(thru xemulation). I have a requirement to find and report Unique users for each hour for each Xmotif application.Can someone direct me here.

Regards
Brian.
6 REPLIES 6
harry d brown jr
Honored Contributor

Re: Report users application wise.

Brian,

I suggest using glance/measureware and perfview. The product is a couple grand, but well worth the investment. If you already have it then create an application group and monitor and collect their activity.

live free or die
harry
Live Free or Die
brian_31
Super Advisor

Re: Report users application wise.

Hi:

Can we do it with a script?

Thanks
Brian.
Krishna Prasad
Trusted Contributor

Re: Report users application wise.

I would think you could write a script that does a ps -ef | grep "term" ( were term is either hpterm,xterm,ddterm what ever terminal the users are using. )

You can use awk to strip out the userid's and maybe the display it is comming from to an output file. You can run the ps command every 30 min to a hour. Then after it has been ran for a couple days you can do some kind of sort -u or grep user | unique on the data you collected.

Positive Results requires Positive Thinking
harry d brown jr
Honored Contributor
Solution

Re: Report users application wise.

Brian,

From what I gather, all you want to report on, is who is running a certain application, correct? If that's the case, then yes you can script it. You will have to have this script running ALL of the time, otherwise you will lose data (users that start up and finish an application before the process gathering starts). You could "front" end every application with a application script wrapper that collects the data:

#!/usr/bin/ksh
#
BEGSTR=`date`:
BEGSTR=$BEGSTR:`who am i`:"Start APPLICATIONNAMEHERE"
echo $BEGSTR >>/LOGFILEPATH
/application path
echo $BEGPATH:"exited at":`date` >>/LOGFILEPATH
exit



The reason I put the first string "BEGSTR" into the logfile, is so you can find out if a user has started an application but has not ended it or for some reason the process did not return to the lines after the application startup. I used "semi-colon's" to "delimit" the fields, to make sorting easier.





live free or die
harry
Live Free or Die
brian_31
Super Advisor

Re: Report users application wise.

Hi Harry:

Do you mean this should be a wrapper to each application?

Thanks
Brian.
harry d brown jr
Honored Contributor

Re: Report users application wise.

Brian,

With only 7 applications that you want monitored, that solution might just be easier than trying to do "ps -ef's" and sorting it, parsing it, putting it into some usable format,blah,blah,blah...

Just remember, that if the users "pass" options to the application, then your application wrapper must pass those options on to the actual application.

live free or die
harry
Live Free or Die