AutoSys Workload Automation

  • 1.  Start sap agent using Unix job in D-Series

    Posted Mar 31, 2016 11:55 AM

    Hello

     

    I am trying to setup a unix job to start a sap agent.

     

    We have our dev sap agents located on unix server  grrapi25

     

    I have an agent setup on grrapi25

     

    I am trying to run a script or command to be able to start the agent.

     

    sudo /scs_apps/cyb_agent/DM1R11/r11.3/esp_start is not working.    Cannot find script.

     

    Tried this.

     

    /sbin/init.d/esp stop DM1R11

     

    I am thinking I also need to run the command    cd /scs_apps/cyb_agent/DM1R11/r11.3

    Then run the sudo /scs_apps/cyb_agent/DM1R11/r11.3/esp_start

     

    Trying that.  So far I just keep getting file not found.

     

    Anyone have any good ideas on how to use a unix job to start the agent.?

    Hermien

     

    This is what I am getting when trying to do a cd   

    more OSAGDWN.A9337D3A8D4A043A900F0A7D30455B91350D9793.joblog

    Thu Mar 31 12:15:22 2016 CAWA_I_20005 AFM: 20160331 12152202+0400 GRRAPI25 JavaAgent#tcpip@ESP_ESADEV_7500 OSAGDWN/OPSAGENT.5/MAIN RUN . Data(Command=cd /scs_apps/cyb_a

    gent/DM1R11/r11.3) User(hmanos) Password(718EF1CCC74DCBBF2DB60FF2B0597E0D) TargetSubsystem(UNX) MFUser(SCHEDMASTER)  Ulimit() WOBRequestID(589E45138CB724A23B438B7255083

    88ED83FC6A314594409219970)

    Thu Mar 31 12:15:22 2016 CAWA_E_20015 Command/Script not found.Error code: 4001

    Thu Mar 31 12:15:22 2016 CAWA_I_20006 --- Environment ---

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: _=/scs_apps/cyb_agent/grrapi25/r11.3/cybspawn.bin

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: SUDO_GID=202

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: SUDO_UID=2144

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: __ARIES_PA_AOUT_MAXSSIZ=8388608

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: PATH=/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/ipf/bin:/opt/gvsd/bin:/op

    t/nettladm/bin:/opt/fcms/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/graphics/common/bin:/opt/atok/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/sec_mgmt/bastille/b

    in:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/resmon/bin:/opt/perf/bin:/opt/propplus/bin:/usr/contrib/kwdb/bin:/opt/prm/bin:/opt/sfm/bin:/opt/swm/bin:/opt/sec_mgmt/

    spc/bin:/opt/ssh/bin:/opt/swa/bin:/opt/hpsmh/bin:/opt/langtools/bin:/opt/wlm/bin:/usr/local/bin:/opt/ignite/bin:/opt/wli/bin:/opt/caliper/bin:/opt/perl_32/bin:/opt/perl

    _64/bin:/etc/cmcluster/scripts/tkit/vtn:/opt/sentinel/bin:/opt/gwlm/bin:/scs:/scs/system/scripts:/scs/system/scripts:/scs/system/bin:/scs_apps/Adobe/Acrobat5/bin:/usr/s

    bin:.

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: COLUMNS=168

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: USERNAME=root

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: PTHREAD_COMPAT_MODE=0

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: LOGNAME=root

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: MAIL=/var/mail/root

    Thu Mar 31 12:15:22 2016 CAWA_I_20007 Environment variable: PS1=

    hmanos@grrapi25 $PWD



  • 2.  Re: Start sap agent using Unix job in D-Series

    Posted Mar 31, 2016 02:39 PM

    Hi Hermien,

     

     

    Without the agent logs and your job definition, it will be difficult to provide a definite answer, but I suspect that you specified 'sudo /scs_apps/cyb_agent/DM1R11/r11.3/esp_start' as the command.  In this case, the agent will try to lookup the command 'sudo' based on the rules for lookup (PATH, home directory, ...), and I suspect the agent is not able to locate this command.

     

    Is there any particular reason that you are suing the 'sudo' to execute the script?  What user is the agent running as?  Why not define the 'User ID' at the job definition?

     

    If this information does not help, please open a support case with the System Agent logs, and a copy of your application definition and agentparm.txt.

     

    Regards,

    Pradeepan Gunabalasingam



  • 3.  Re: Start sap agent using Unix job in D-Series

    Posted Apr 18, 2016 05:45 PM

    Hello

     

     

    Yes  He is trying to get me to run this command.

     

    sudo /sbin/init.d/esp stop DM1R11

     

    A more direct command.

     

     

    Working on it.



  • 4.  Re: Start sap agent using Unix job in D-Series

    Posted Mar 31, 2016 02:57 PM

    What do you get when you do the following:

     

    ls -l /scs_apps/cyb_agent/DM1R11/r11.3/esp_start

     

    Looking at the message the change directory command would only be for that job:

     

    Thu Mar 31 12:15:22 2016 CAWA_I_20005 AFM: 20160331 12152202+0400 GRRAPI25 JavaAgent#tcpip@ESP_ESADEV_7500 OSAGDWN/OPSAGENT.5/MAIN RUN . Data(Command=cd /scs_apps/cyb_a

    gent/DM1R11/r11.3)

     

    You should not need to change directory, but if you do want to try it put both commands in the ARGS and separate with a semi-colon (;)

     

    UNIX_JOB  JOB1                                  

       AGENT %USER1                                     

       CMDNAME /bin/bash           /* valid shell */                            

       USER <user id>              /* valid user  */                     

       ARGS -c 'cd /scs_apps/cyb_agent/DM1R11/r11.3; ./esp_start'

       RUN ANYDAY                                       

    ENDJOB                                             

     

     

    Please post job definition.



  • 5.  Re: Start sap agent using Unix job in D-Series

    Posted Mar 31, 2016 03:35 PM

    Hello

     

    I am just running the script

     

    OPSAGENT
    Generation Number7
    Job NameOSAGDWN
    StateFAILED
    Job ID769
    Job TypeUNIX
    Start TimeThu 31 Mar 2016 13:38:20 EDT
    End TimeThu 31 Mar 2016 13:38:21 EDT
    Agent NameGRRAPI25
    Completion Code1
    Submission Count4
    Run a script/scs_apps/cyb_agent/DM1R11/r11.3/esp_stop
    Shell/bin/sh

     

    It almost worked.    It as least got past  file not found. 

    This is what I got in the log.

    Thu Mar 31 13:38:20 2016 CAWA_I_20010 The local security is bypassed

    Thu Mar 31 13:38:20 2016 CAWA_I_20041 Executing /sbin/sh -sh -c /bin/sh /scs_apps/cyb_agent/DM1R11/r11.3/esp_stop. pid: 770

    Thu Mar 31 13:38:21 2016 CAWA_I_20018 Job failed. Exit code 1, Status:

     

    It ran through the agent without a submit error.

    Transmitter log

    03/31/2016 13:38:21.134 EDT-0400 2 TCP/IP Controller Plugin.Transmitter pool thread <Regular:1>.CybTargetHandlerChannel.call[:721] - Message has been sent: 20160331 13

    382111+0400 ESP_ESADEV_7500 grrapi25 OSAGDWN/OPSAGENT.7/MAIN State FAILED Cmpc(1) SetEnd JobLogId(ABB5400AAE77A0A7102B02DA131162F0FCB2B1A0)  User(grrapi25) Host(grrapi

    25.na.steelcase.net)

     

    Receiver log

    03/31/2016 13:38:20.621 EDT-0400 2 TCP/IP Controller Plugin.Receiver pool thread <Regular:2>.CybReceiverSession.accept[:276] - Message received: 20160331 13382070+0400

    GRRAPI25 ESP_ESADEV_7500 OSAGDWN/OPSAGENT.7/MAIN RUN . Data(Script=/scs_apps/cyb_agent/DM1R11/r11.3/esp_stop,Shell=/bin/sh) TargetSubsystem(UNX) MFUser(HMANOS)  Ulimi

    t()

     

    Usually we have to put sudo infront of this command to get it to work.



  • 6.  Re: Start sap agent using Unix job in D-Series

    Posted Mar 31, 2016 04:35 PM

    Hi Hermien,

     

    It appears that your script /scs_apps/cyb_agent/DM1R11/r11.3/esp_stop is returning an exit code of 1, therefore the job is failing.  Can you try to retrieve the spool file and see if there are any errors reported?  Are you able to run this script from the command line as agent user (owner of cybAgent process)?

     

    Regards,

    Pradeepan Gunabalasingam



  • 7.  Re: Start sap agent using Unix job in D-Series

    Posted Apr 01, 2016 08:44 AM

    Hi Hermien,

     

    I didn't get any response for my previous questions and wanted to follow up to see if you got your job to work?  Did you get a chance to retrieve the spool file (and job log if enabled) to see if there were any errors reported from the esp_stop script?  Are you able run the script as the agent user with success from the unix console?  If you are still having problems, I would encourage you to open a support case and have our dSeries support team contact you.

     

    Regards,

    Pradeepan Gunabalasingam



  • 8.  Re: Start sap agent using Unix job in D-Series

    Posted Mar 31, 2016 05:39 PM

    I get this.

     

    hmanos@grrapi25 /scs_apps/cyb_agent/DM1R11/r11.3

    => ls -l /scs_apps/cyb_agent/DM1R11/r11.3/esp_start

    -rwsr-x---   1 root       sys           1854 Jul 22  2014 /scs_apps/cyb_agent/DM1R11/r11.3/esp_start



  • 9.  Re: Start sap agent using Unix job in D-Series

    Community Manager
    Posted Apr 21, 2016 01:28 PM

    Just want to make sure that gunpr01 saw your response. Thanks for the further information Hermien