Operating System - HP-UX
1837523 Members
3961 Online
110117 Solutions
New Discussion

Re: ps does not show all cmd line args

 
SOLVED
Go to solution
Reiner_Buehl
Occasional Advisor

ps does not show all cmd line args

Hi all,

I need to find the process ID of a specific java instance on HP-UX 11. Unfortunatly the system runs multiple java instances with a simmilar set of command line arguments. The difference between the arguments is at a position that ps does not show anymore since it truncates after approx. 60 characters. Is there a command line (freeware or HP-UX standard) tool that shows me everything? I know that glance should be able to do this but I need a fast and lightweight way to do it often (from a monitor script).

Thanks in advance and best regards,
Reiner.
11 REPLIES 11
Robin Wakefield
Honored Contributor
Solution

Re: ps does not show all cmd line args

Tore_1
Regular Advisor

Re: ps does not show all cmd line args

Hi, try

ps -eflx

Another a couple of good outputs are:

UNIX95=1; ps -efH

or

UNIX95=1;ps -elH

Also note that with the -o option you can closesly control your output.

Reiner_Buehl
Occasional Advisor

Re: ps does not show all cmd line args

Hi Tore,

I tried the ps -eflx and UNIX95=1; ps -efH but both the -x and the -H switch are not known by the ps command from HP-UX 11.0. Which ps did you use?
harry d brown jr
Honored Contributor

Re: ps does not show all cmd line args

Reiner,

gointo ksh, then try it.

ksh
UNIX95=1; ps -efH

But it is STILL going to TRUNCATE the line, and there's nothing that can be done about that.

If the SPECIAL OPTION used a different set of FILES, then maybe "lsof" can help you here?

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/

live free or die
harry
Live Free or Die
Reiner_Buehl
Occasional Advisor

Re: ps does not show all cmd line args

After calling ps as

UNIX95=1 ps -efH

(note the missing ";") it worked, but you are right, it still truncates at 60 characters. I checked out the thread that Robin mentioned and found some code sample there but the resulting executable only works on some processes, not on my java runtime executables. There seems to be a uid/access right problem. Any other ideas anybody?

Best regards,
Reiner.
Martin Johnson
Honored Contributor

Re: ps does not show all cmd line args

1) You could rename the directories in the path to something shorter, to get the overall command under 60 characters.

2) Create a symbolic link that bypasses the intermediate directories and invoke the app using the link.

3)Try the freeware program pstree. I'll try to attach a copy to this reply.
cart
Advisor

Re: ps does not show all cmd line args

Hi,

Maybe you can try with the snmp agent. On HPUX 10.20, the standard snmp agent report the list of the process and also the list of the args (in a different table).
The easiest way is to have the 'snmpwalk' tool (you also need the HPUX MIB file), but if you have HPOpenview it will also work (it has the snmpwalk tool).
You can download UCD-SNMP for HPUX which has all the related tool.
(I know, it's not the easy way)

S
cart
Advisor

Re: ps does not show all cmd line args

Oppps, sorry, the SNMP proccessCmd string is also limited to 60 chars.

...
S
Jeff Schussele
Honored Contributor

Re: ps does not show all cmd line args

Hi Reiner,

Alas it would be nice if HP had a Berkely style ps command such as can be had on Sun - /usr/ucb/ps -auxww
But life is not always fair.......

Good Luck,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Tom Danzig
Honored Contributor

Re: ps does not show all cmd line args

Check out patch PHKL_26008. It's supposed to allow longer command lines to be stored in the process table. I have not tried it though.

Jeff Schussele
Honored Contributor

Re: ps does not show all cmd line args

Hi Reiner/Tom,

Well this certainly could be promising - this patch states it will now support allocating kernel memory to support up to 1020 chars of the command line.

But be advised it has dependencies - incl:
PHKL_25999/21778/21684/21518/22588
PHCO_22592

25999 along with 26008 for the storage to be enabled
21684 & 21518 to increase the msg queue capacity
21778 is required for SAM support for the tunables
22588 & PHCO_22592 together provide an enhancement so the customer is able to use commands to display the information about POSIX message queues and named semaphores as well as remove them.

I think I'll try to look this one over on a test system

Rgds,
Jeff


PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!