Operating System - HP-UX
1833887 Members
2031 Online
110063 Solutions
New Discussion

Setting up PRM Application records

 
SOLVED
Go to solution
Tor-Bjorn Jofred
Occasional Advisor

Setting up PRM Application records

I have three PRM groups defined.
The users are split between the groups.
This works fine.

But for a few users I would like to place the processes in different PRM groups. I try to use Application records to make it work automaticly.

My problem is that I have to known the absolute path of the binary to be able to specify the Application records. When I use the ps -ef command I can't see the complete path of the specific binary.

The "args" field presented by ps can look like
"./RunThisScript".

How can I get the absolute binary path of a process?

Thanks.
13 REPLIES 13
RAC_1
Honored Contributor

Re: Setting up PRM Application records

ps -efx|grep "RunThisScript"

Anil
There is no substitute to HARDWORK
Tor-Bjorn Jofred
Occasional Advisor

Re: Setting up PRM Application records

I still don't get the absolute path I need.

> ps -efx | grep MyServer
myadmin 21641 21638 0 09:34:50 ? 0:27 ./MyServer
G. Vrijhoeven
Honored Contributor

Re: Setting up PRM Application records

Hi,

I am afraid if a process is not started with the full path, you are not able to see it using ps. If you have glance installed you should be able to view the process memory regions. The TEXT is mapped on a file name. This is the full path of the executable.
If you do not have glance ( free 60 days , on application cdrom) you can always ask the application manager, the person who started the process.

Regards,

Gideon
Bernhard Mueller
Honored Contributor

Re: Setting up PRM Application records

Hi,

guess you are limited to:

su - myadmin (or other process owner)
which MYCOMMAND
whereis MYCOMMAND

Regards,
Bernhard
Hazem Mahmoud_3
Respected Contributor

Re: Setting up PRM Application records

If the binary is specified in the PATH, you can just use the command:

# which

and that will give you the full path. So, grep for it like you are doing and if it exists, then execute the which command.

-Hazem
Tor-Bjorn Jofred
Occasional Advisor

Re: Setting up PRM Application records

I have glance. The TEXT in Mem regions give me the following:

TEXT /Shared 2 436kb 528kb 0kb

To ask the person who started the process can be hard. Most processes are started by several levels of scripts. I hope to find a better way.
RAC_1
Honored Contributor

Re: Setting up PRM Application records

You should e able to put application record as follows.

application = xxx
file = *RunThisScript*

Anil
There is no substitute to HARDWORK
Tor-Bjorn Jofred
Occasional Advisor

Re: Setting up PRM Application records

The idea to use the "which" command may work, but you can be sure. The same binary name could exist in many directories.

Another problem is when the ps command gives even less information. For the oracle processes I only get something like this:

> ps -efx | grep ora_reco
oracle 21905 1 0 09:35:49 ? 0:00 ora_reco_PPK

What is the path of the binary?
G. Vrijhoeven
Honored Contributor

Re: Setting up PRM Application records

Hi again,

Did you try gpm. If i look at a process i get Type, File Name P/S and RSS/KB , In the file name section i get a full path. or the lvol followed by an inode number:

The inode numbers can be found with
ls -Ri in the start point of the lvol.

HTH,

Gideon



Tor-Bjorn Jofred
Occasional Advisor

Re: Setting up PRM Application records

I actually tried to use an Application record with a dummy path, like

/usr/bin/dummy::::MYGROUP,*procName*

to check if the binary path was used.
But it didn't work.
G. Vrijhoeven
Honored Contributor
Solution

Re: Setting up PRM Application records

Hi again,

The alias only works if it is started from the executable provided started it. Aliases can be verry usefull for oracle processes. The processes are all started by the oracle executable, but the many process names contain ora*. Did you try a inode search?

Gideon
Tor-Bjorn Jofred
Occasional Advisor

Re: Setting up PRM Application records

Yes I did and it was successful. I found the correct path to the binary. Now the processes are placed in the groups I wanted.
Thank you vary much.

If you don't know where the binary could be found and have to search the complete filesystem, this method could take some time.
G. Vrijhoeven
Honored Contributor

Re: Setting up PRM Application records

Hi,

May be a
#find /dir -inum
is quicker. just make sure /dir is the root dir of a filesystem. You can use the -xdev option if the filesystem has mount of an other filesystem in it.

Regards,

Gideon