get whole command arguments in ps -ef?

Hello All,

I want to build some monitoring of processes in HP-UX 11.x.

Is there any way to get the whole set of commands and arguments instead of the first 60 characters? I read that there's a limitation of the ps -ef command that we can't overcome. In this case is there any other command that I can use?

My need is so basic I can't believe there's no way to get that information :confused:

Thank you!

Hi,

I'm pretty sure that if you use ps -efx should give you all the information you need.

x means extra (as in detail)

Cheers,

Nope - on HP-UX "x" is an illegal option :frowning: Thank you for your post.....

You read correctly. The HP-UX kernel does not save the entire argument list for later inspection. No tool can be built to get back more than the kernel saved.

Most strange, I am most definatly working on HP_UX 11 and doing ps -efx does give an extended command info. Extract from man page
ps(1) ps(1)

NAME
ps - report process status

SYNOPSIS
ps [-adeflPx] [-g grplist] [-p proclist] [-R prmgrplist] [-t termlist]
[-u uidlist]

blah blah blah......

       -x             Shows the command line in extended format.

Well, I agree with that much of your post :smiley:

This is what the HP man page for ps actually has:

 NAME
      ps - report process status

 SYNOPSIS
      ps [-adeflP] [-g grplist] [-p proclist] [-R prmgrplist] [-t termlist]
      [-u uidlist]

    XPG4 Synopsis
      ps [-aAcdefHjlP] [-C cmdlist] [-g grplist] [-G gidlist] [-n namelist]
      [-o format] [-p proclist] [-R prmgrplist] [-s sidlist] [-t termlist]
      [-u uidlist] [-U uidlist]


and later...

           args           The command line given when the process was
                          created.  This column should be the last one
                          specified, if it is desired.  Only a subset of the
                          command line is saved by the kernel; as much of
                          the command line will be displayed as is
                          available.  The output in this column may contain
                          spaces.  The default heading for this column is
                          COMMAND if -o is specified and CMD otherwise.


nhatch, run the "uname -a" command and post the results.

Perderabo

uname -a

HP-UX matisse B.11.11 U 9000/800 686369372 unlimited-user license

It looks like nhatch does have a valid point here. Upgrading to HP-UX 11.11 (aka HP-UX 11i) may be an option.

We have some 11i systems and sure enough, on them the ps command does have that -x option. The language about kernel limitations is still present, but that limit has been raised quite a bit. Instead of 64 characters, it now seems to be 1015 characters.

I had not noticed this about 11i before. Thanks nhatch!

Good to know - thanks!

Before use the ps -x option in HP-UX, set the UNIX95 variable to 1.

UNIX95=1
ps -efx | more

Regards,
Cesar

Thanks a lot for the replies. Glad to see such old threads still alive!

Now I try to code some other process monitoring this time on Sun Solaris! :smiley:

And this "ps -efx" syntax sure doesn't exist. How would you do that?

Seems that the forum server got extremely slow and my post came through twice. Removing duplicate.

look into '/usr/ucb/ps' - I belive the options are '-awww' - don't have the system in front of me now.

Thanks for the quick reply. Didn't work on this system:

$ uname -a
SunOS zcsapp01 5.10 Generic_118822-25 sun4v sparc SUNW,Sun-Fire-T200
$ ps -awww
ps: illegal option -- w
ps: illegal option -- w
ps: illegal option -- w
usage: ps [ -aAdeflcjLPyZ ] [ -o format ] [ -t termlist ]
[ -u userlist ] [ -U userlist ] [ -G grouplist ]
[ -p proclist ] [ -g pgrplist ] [ -s sidlist ] [ -z zonelist ]

I believe I said '/usr/ucb/ps' .....

Thank you, yes it worked; I ended up with the following syntax:

/usr/ucb/ps -ex -awww

Thanks a lot vgersh99! :slight_smile:

I usually use this:

/usr/ucb/ps auxwww

Thank you blowtorch, that's exactly what I was looking for.