[Nagiosplug-devel] [ nagiosplug-Bugs-948667 ] check_procs under HP-UX does not see command arguments

SourceForge.net noreply at sourceforge.net
Thu Aug 12 12:45:01 CEST 2004


Bugs item #948667, was opened at 2004-05-05 10:16
Message generated for change (Comment added) made by jhmartin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=948667&group_id=29880

Category: Argument proccessing
Group: CVS
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Plaksin (happyzi)
Assigned to: Ton Voon (tonvoon)
Summary: check_procs under HP-UX does not see command arguments

Initial Comment:
The ps command used by check_procs on HP-UX does not
show command arguments.  So it can't be used to search
for things like "man ascii".

I think this is true for all versions of check_procs. 
I've specifically tried 1.3.1 and CVS HEAD under HP-UX
11.00.  I suspect it's the same on all versions of HP-UX.

configure picks '/usr/bin/ps -el' as the ps command. 
If this is changed to:
/usr/bin/env UNIX95=1 /usr/bin/ps  -eo
'state,uid,ppid,args'

and PS_FORMAT is "%s %s %s %n%s" and PS_VARLIST is
procstat,&procuid,&procppid,&pos,procprog

then it works.

----------------------------------------------------------------------

Comment By: Jason Martin (jhmartin)
Date: 2004-08-12 11:44

Message:
Logged In: YES 
user_id=589094

The following configure.in block, placed above all others
that invoke ps -el is working for me (against 1.3.1)

elif /usr/bin/env UNIX95=1 /usr/bin/ps -eo 'state uid ppid
args' 2>/dev/null | egrep -i ["^S +UID +PPID +[RGSCOMDNA]+"]
>/dev/null
then
   AC_DEFINE(USE_PS_VARS,1,[Define if we use custom variable
list for sscanf])
  
AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog],[])
   AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_ENV UNIX95=1
$PATH_TO_PS -eo 'state uid ppid args'",[])
   AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %n%s",[Format
string for scanning ps output in check_procs])
   AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -el",[])
   AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%*s %*s %*s %*s %*s %*s
%*s %*s %*s %d %*s %*s %*s %s",[])
   AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -el",[])
   AC_DEFINE_UNQUOTED(RSS_FORMAT,"%*s %*s %*s %*s %*s %*s
%*s %*s %*s %d",[])
   echo "      ps syntax... $PATH_TO_ENV UNIX95=1
$PATH_TO_PS -eo 'state uid ppid args'"

I also added 
AC_PATH_PROG(PATH_TO_ENV,env)
after
AC_PATH_PROG(PATH_TO_PS,ps)


----------------------------------------------------------------------

Comment By: Jason Martin (jhmartin)
Date: 2004-08-10 11:36

Message:
Logged In: YES 
user_id=589094

ps -ex gives me a syntax error on both 10.20 and 11i.
ps ex returns just processes owned by the current user. 

----------------------------------------------------------------------

Comment By: Jason Martin (jhmartin)
Date: 2004-08-10 11:33

Message:
Logged In: YES 
user_id=589094

ps -ex gives me a syntax error on both 10.20 and 11i.

ps ex returns just processes owned by the current user. 

----------------------------------------------------------------------

Comment By: Tracy Orf (tracyorf)
Date: 2004-08-10 10:00

Message:
Logged In: YES 
user_id=557175

ps -ex in HP-UX will show the command line in extended format.

----------------------------------------------------------------------

Comment By: Jason Martin (jhmartin)
Date: 2004-08-10 08:21

Message:
Logged In: YES 
user_id=589094

The CVS HEAD configure.in uses ps -el as the ps command for 
HP-UX, and that command only returns up to 15 characters of 
the  command name and excludes all arguments. 

ps -ef returns up to 64 characters of
the combination of command name and arguments.

Head -2 of ps -ef returns
     UID   PID  PPID  C    STIME TTY       TIME COMMAND
    root   625   624  0  Jun 17  ?         6:11 /usr/sbin/netfmt -
C -F -f /var/adm/nettl.LOG000 -c /var/adm/con

Head -3 of the UNIX95 syntax above returns
$ /usr/bin/env UNIX95=1 /usr/bin/ps -eo 'state,uid,ppid,args'
S        UID  PPID COMMAND
R        198  3023 /usr/bin/ps -eo state,uid,ppid,args
S         96     1 vmstat -S 300 2

This is true on the following versions of HPUX:
HP-UX hostname B.11.11 U 9000/800 1651319313 unlimited-
user license
HP-UX localhost B.10.20 E 9000/800 882327441 8-user license


----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2004-05-05 13:00

Message:
Logged In: YES 
user_id=664364

What do you suggest? It should be something like:

ps -eo 's uid ppid vsz rss pcpu comm args'

to get all the required information. Will need a head -2 output.


----------------------------------------------------------------------

Comment By: Mark Plaksin (happyzi)
Date: 2004-05-05 11:54

Message:
Logged In: YES 
user_id=115461

Thanks for the quick response :)

The recent change doesn't do the trick.  I tested with
today's CVS.

We run multiple PeopleSoft instances on a single machine. 
We want per-instance process checking and the only way to
tell which instance a process is for is by looking at the
arguments to the command.  For example, there is one
PSQRYSRV process for earch instance.  They show up in the
process table like "PSQRYSRV -C dom=INSTANCE_NAME".


----------------------------------------------------------------------

Comment By: Ton Voon (tonvoon)
Date: 2004-05-05 11:42

Message:
Logged In: YES 
user_id=664364

Mark,

CVS HEAD was recently changed for HP-UX (configure output should 
show HP-UX as the ps syntax). Does this work?

Ton

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=948667&group_id=29880




More information about the Devel mailing list