[hobbit] Solaris ps

Galen Johnson gjohnson at trantor.org
Mon Feb 12 04:42:48 CET 2007


Galen Johnson wrote:
> Henrik Stoerner wrote:
>> On Sat, Feb 10, 2007 at 06:22:52PM -0500, Galen Johnson wrote:
>>  
>>>>> Is there any reason NOT to use '/usr/ucb/ps auxwww' in place of 
>>>>> the ps that hobbit-sunos.sh is using?...in other words, will it 
>>>>> break anything if I use it (yes, I know I need to run it as root 
>>>>> to get everything)?   I prefer the output of what Henrik provides 
>>>>> but the solaris ps is braindead (truncates at 80 characters).
>>>>>         
>>> Yeah, but all of our systems are SPARC...which does...even with 
>>> Solaris 10.   Question stands...is there a reason not to? (other 
>>> than upgrading, will it affect any of hobbit's builtin functionality?)
>>>     
>>
>> If you look at the hobbitclient-sunos.sh script that runs on the
>> clients, you'll see that it currently runs
>>   ps -A -o pid,ppid,user,stime,s,pri,pcpu,time,pmem,rss,vsz,args
>>
>> If you can come up with a /usr/ucb/ps command that provides the same 
>> information - hopefully using almost the same column headers - then
>> I have no problem in switching.
>>
>> Right now, Hobbit only looks at the command line from the "ps" listing,
>> but I do have a plan to make it track the memory- and cpu-utilisation of
>> processes; and for that Hobbit must be able to identify the
>> corresponding columns in the "ps" output. But that's in the future.
>>   
> Thanks...I looked into trying just that.  I can get using options 
> 'auxwww' gets me a lot of the fields and I can get others with 
> 'alxwww'...unfortunately, the 'l' and 'u' options appear to be 
> mutually exclusive...which is annoying.  'auxwww' does give you some 
> memory and cpu info (I _think_ it's the same as the pcpu and pmem).  I 
> wouldn't necessarily suggest this as a permanent change but I need it 
> to get more information from the command line.
>
> I can work up the changes to provide both as an option (it does 
> require that the -o args be rearranged since the output of /usr/ucb/ps 
> isn't configurable).
>
> =G=
>
These two commands are equivalent...

/usr/ucb/ps auxwww

USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND

/usr/bin/ps -A -o user,pid,pcpu,pmem,vsz,rss,tty,s,stime,time,args

    USER   PID %CPU %MEM  VSZ  RSS TT      S    STIME        TIME COMMAND

I've verified that SZ and VSZ are the same by comparing 
output...however, there is a bit of a shortcoming with the berkeley 
ps...it runs %MEM, SZ and RSS together.  It looks like the percent 
memory is consistently 3 chars wide (%1.1f)...I wish I could say the 
same about SZ and RSS...

=G=






More information about the Xymon mailing list