cancel
Showing results for 
Search instead for 
Did you mean: 

error about ps -u in the engine.log when config monitorprocesses of the APPLICATION resource.

pgm10s
Level 5
Partner Accredited Certified
Hi
  
   I  installed the SFHA5.1 on the AIX6.1 TL4. After config the GCO option, vcs cannot monitor the /opt/VRTSvcs/bin/wac .   It alway fail,althoug that process is running.
I see in the enginelog say that      "ps : invalid listing of  -u."  that cause VCS cannot monitor the wac process. how can I resolve this problem.

Thank you. 
13 REPLIES 13

Gaurav_S
Moderator
Moderator
   VIP    Certified
Hello,

Very first thing I can think of is, what is the full path to ps command ? probably the ps command WAC monitor script is using doesn't exist onto the box.

What I would suggest is, check the monitor script for WAC resource, should be under /opt/VRTSvcs/bin/wac/

In the monitor script, check what are the arguments used by monitor script. In case u don't find a monitor script in that path, quite possible that monitor in embedded in the agent binary, in that case would be little hard to diagnose...

let me know if this helps..


Gaurav

pgm10s
Level 5
Partner Accredited Certified

VCS  don't use the monitor script but it use MonitorProcess as in the picturevcs.jpg

but the VCS engine log say that
#####
ps : invalid listing of  the -u
#####'
I have tested in the AIX5.3 with SFHA5.0MP3, therer is no problem like this.

 

Thank you very much

 

pgm10s
Level 5
Partner Accredited Certified

VCS  don't use the monitor script but it use MonitorProcess as in the picturevcs.jpg

but the VCS engine log say that
#####
ps : invalid listing of  the -u
#####'
I have tested in the AIX5.3 with SFHA5.0MP3, therer is no problem like this.

 

Thank you very much

 

Gaurav_S
Moderator
Moderator
   VIP    Certified
Hello,

Can you please let me know whether the monitorprocess /opt/VRTSvcs/bin/wac is a binary file or a script ?

If its a script, can u please paste the contents ?

Thanks

Gaurav

pgm10s
Level 5
Partner Accredited Certified

Hello

    It is a binary.

wac: executable (RISC System/6000) or object module not stripped.


   It is a GCO process.


Thank you

 

Gaurav_S
Moderator
Moderator
   VIP    Certified
I believe should be a bug then.... would suggest to raise a case with Symantec here....

Gaurav

pgm10s
Level 5
Partner Accredited Certified
The engine log.


2010/01/16 03:12:44 VCS INFO V-16-1-51058 Received connection request from wide
area connector
2010/01/16 03:12:44 VCS ERROR V-16-1-51062 VCS engine rejected connection reques
t from wide area connector because a connection with the wide area connector has
 already been established
2010/01/16 03:12:47 VCS INFO V-16-2-13716 (test1) Resource(wac): Output of the c
ompleted operation (monitor)
==============================================
ps: invalid list with -u.
==============================================







g_lee
Level 6
From VCS 5.1 (AIX) Bundled Agents Reference Guide -> Application agent attributes
http://sfdoccentral.symantec.com/sf/5.1/aix/html/vcs_bundled_agents/ch_aix_services_app_agents16.html

----------------------------------------
MonitorProcesses
A list of processes that you want monitored and cleaned. Each process name is the name of an executable. Qualify the executable name with its complete path if the path starts the executable.
The process name must be the full command line argument that the ps -u user -eo pid,comm command displays for the process.
Type and dimension: string-vector
--------------------

So with your current configuration, to monitor wac, VCS runs "ps -u user -eo pid,comm" and expects to see /opt/VRTSvcs/bin/wac as the output

Therefore the message in the engine log indicates that it's getting an error from ps.

What output is displayed if you run the ps command manually? (user should be root, so: "ps -u root -eo pid,comm" and check that /opt/VRTSvcs/bin/wac is displayed in output)

pgm10s
Level 5
Partner Accredited Certified



# ps -ef | grep wac
    root 405574 417796   0 11:34:34  pts/0  0:00 grep wac
# ps -u root -eo 405574
ps: 0509-048 Flag -o was used with invalid list.
Usage: ps [-AMNZaedfklm] [-n namelist] [-F Format] [-o specifier[=header],...]
                [-p proclist][-G|-g grouplist] [-t termlist] [-U|-u userlist] [-
c classlist] [ -T pid] [ -L pidlist ]
                [-@ [wparname] ]
Usage: ps [aceglnsuvwxX] [t tty] [processnumber]

pgm10s
Level 5
Partner Accredited Certified
Hi
  

  Maybe it is come from the bug of  " ps command option"  that the application monitor use ?



Roger_Zimmerman
Level 4
Hi,
it looks like the parameters for the -o option (demands a user list) are not passed to the ps command, therefore it tells you "ps : invalid listing of  the -u"...
There have to be a way to provide the correct user to the ps command. Because the agent is running in the background without specific user context you have to give a valid user to the commands.
Please try to give the root user to the User attribute of the ressource. I saw in the pictures above that there is no user configured. It should not make a big difference between running the wac command in an unspecified context or in the root context (ok, some security people will complain about more power to the command...)
And with a little luck this root user is passed to the ps -u...
Regards
Roger

g_lee
Level 6
The reason for asking to run this was to check the ps command that vcs is using is working as expected.

The command you ran was:
# ps -u root -eo 405574

The command should have been:
# ps -u root -eo pid,comm

run exactly as above without substituting values - ie: pid,comm are arguments to the -o option (specifying to display just the pid and command fields)

example from a solaris machine:
# ps -u root -eo pid,comm
  PID COMMAND
    0 sched
    1 /sbin/init
    2 pageout
    3 fsflush
   64 vxconfigd
    7 /lib/svc/bin/svc.startd
    9 /lib/svc/bin/svc.configd
[...]
ie: list of all processes owned by root (PID and command only)

From your ps -ef output wac isn't running at the moment anyway, but if you run the ps -u [...] you can at least confirm the command is working with the expected syntax, to help determine where the problem lies.

if the ps returns as expected when using the correct syntax, Roger's suggestion to set the User attribute may also be worth trying (doesn't seem to be required on the Solaris machines I've seen with wac configured, but perhaps AIX is slightly different?)

Roger_Zimmerman
Level 4

Hi,

did a little research today. Like pgm10s mentioned above there is no problem in AIX 5.3 and SFHA5.0 MP3. And because I cannot beleave that AIX 6.1 has a change in ps command (at least not that significant) I suspect there is a bug in the monitor entry point in ApplicationAgent of SFHA5.1. Too bad... (Btw. the Agent for Solaris Sparc and for Solaris Intel is running as expected.)

But I promised a workaround...
Just make a new Script:  /opt/VRTSvcs/bin/wacmonitor
 

eval 'exec ${VCS_HOME:=/opt/VRTSvcs}/bin/perl5 -S $0 ${1+"$@"}'
        if 0;$exit_code=100;
open FH, "ps -eo pid,comm | grep /opt/VRTSvcs/bin/wac | grep -v grep |" 
	or die "Failed to open pipeline";
while ($line=<FH>) {
        if ($line =~ /\/opt\/VRTSvcs\/bin\/wac/) {
                $exit_code=110;
        }
}
exit $exit_code;

And than use it in MonitorProgram attribute and delete the MonitorProcess attribute entry.

I am aware that after an update this setting is gone (probably). Should do the job as long as you have only one wac process running, if you have more than one wac running the monitor script is not correct because as long on process lives this script returns "online". In this case you have also test for some parameters (you can get those parameters from the ArgList atttribute in the type description.

Hope this helps
Roger