Automic Workload Automation

 View Only
  • 1.  Configuring service manager details for AE server processes

    Posted Jul 26, 2020 09:05 AM
    Is there a way to configure the service manager details for AE server processes, so that, like agents, they too can be stopped and started from the Administration perspective in the AWI?



  • 2.  RE: Configuring service manager details for AE server processes

    Posted Jul 27, 2020 12:54 AM
    Hi Michael,

    Yes it works so long as your Service Manager is linked (v12.2.6 shown).  If the AE can get to the port of the smgr then it will grab all of the code automatically and if you made some updates to smgr then you can refresh it by right clicking and selecting Update Service Manager Link and it will pull in the updated info. 

    Control takes place in the Admin perspective under Automation Engine Management.   You can stop mulitple WP/CP at a time but when it comes to starting it seems to only work one at a time. 
    Stop / Start WP or CP
    Another handy way of stopping processes for example if you need to stop a server for patching the following can be scripted

    : PRINT "Terminate server processes for APP1"
    : TERMINATE SERVER, UC4NONPD#CP001
    : TERMINATE SERVER, UC4NONPD#CP006
    : TERMINATE SERVER, UC4NONPD#WP042
    : TERMINATE SERVER, UC4NONPD#WP041
    : TERMINATE SERVER, UC4NONPD#WP009
    : TERMINATE SERVER, UC4NONPD#WP008
    : TERMINATE SERVER, UC4NONPD#WP007
    : TERMINATE SERVER, UC4NONPD#WP006
    : TERMINATE SERVER, UC4NONPD#WP005
    : TERMINATE SERVER, UC4NONPD#WP004
    : TERMINATE SERVER, UC4NONPD#WP003
    : TERMINATE SERVER, UC4NONPD#WP002
    : TERMINATE SERVER, UC4NONPD#WP001

    Then put all of your required startup timings in the smgr SMC file and it will autostart after server reboot. 

    Regards,
    Matt



  • 3.  RE: Configuring service manager details for AE server processes

    Posted Jul 27, 2020 07:28 AM
    Edited by Michael A. Lowry Jul 27, 2020 07:28 AM
    Yesterday I did figure out how to make it work. In my tests, I found that the value in the Name field must be the name of the process as defined in the Service Manager SMD file. (This is also the name that appears in the hidden fix Servicename column in the SMgr GUI.) Is this correct?

    If so, I see a potential problem. The names in the SMD file are arbitrary and likely to change depending on startup order.

    Does the :TERMINATE AE scripting command operate on actual AE server process names, or does it too rely on the inscrutable and unstable SMD names?

    Also, where in the DB are the service manager definitions for agents/servers stored?



  • 4.  RE: Configuring service manager details for AE server processes

    Posted Jul 28, 2020 04:06 AM
    Hi @Michael A. Lowry,

    As far as I understand, there should be no need to enter the name manually. At least in my V12.3 systems the name has been automatically set (see ScreenShot)





    I checked :TERMINATE, SERVER, WP4 
    and it returned:

    U00020645 Runtime error in object 'SCRI.TERMINATE', line '00001': There is no object 'WP4'.

    ...would be to easy...

    So my summary is: to terminate a certain process we need to use the object name (C0000). But the object name can - and will - change. The "fix Servicename" stays, while the SMGR Name (column "Service" ) and the object name in C0000 can change. In an environment with more than one server machine, it is actually impossible to use TERMINATE and terminate a certain server process as we never know on which machine the process runs. The dynamic server names are not really an improvement...

    Cheers
    Christoph 


    ------------------------------
    ----------------------------------------------------------------
    Automic AE Consultant and Trainer since 2000
    ----------------------------------------------------------------
    ------------------------------



  • 5.  RE: Configuring service manager details for AE server processes

    Posted Jul 28, 2020 07:55 PM
    The process to terminate needs to be that in the Name column in the AE.  
    Name to Terminate

    If the processes are started out of order after SMC has started them, it won't matter because the names are derived from the ucsrv.ini file
    e.g. if you have the following in ucsrv.ini
    system=TEST
    wp1=10001
    wp5=10002
    wp10=10003

    Then you start the first WP it will start as TEST#WP001    regardless of what you named it in the fix Service Name in smgr and also regardless of which WP you selected to start in smgr.  This is because it finds the first wp in ucsrv.ini and establishes a connection with the port.  Only if the port is in use will it then try then next wp listed. 
    Then you start the second WP (any one from your smgr), it will start as TEST#WP005 
    Then you start the third WP (any one from your smgr) , it will start as TEST#WP010 

    Therefore you can define the TERMINATE just based on the wp you have specified in ucsrv.ini
    I terminate in reverse order to prevent the Primary from switching mode.  So in this example I would script 
    : TERMINATE SERVER, TEST#WP010
    : TERMINATE SERVER, TEST#WP005
    : TERMINATE SERVER, TEST#WP001

    This might also be useful, before terminating I gather a list of all the processes and output to variable.  Then I can use script to manage the Primary as I have 4 AE. 

    :SET &DATE# = SYS_DATE(YYYY-MM-DD)
    :SET &TIME# = SYS_TIME("HH:MM:SS")
    ! WP Listing
    :SET &WPNUM# = "01"
    :WHILE &WPNUM# <= "99"
    :SET &PROCESS# = "UC4NONPD#WP0&WPNUM#"
    : SET &RET1# = GET_UC_SETTING(SERVER_MODE, "&PROCESS#")
    : print "&PROCESS# is &RET1#"
    : IF &RET1# = "P"
    : PUT_VAR DADMPATCH_V001, "&RET1#" , "&PROCESS#"
    : ENDIF
    : PUT_VAR DADMPATCH_V002, "&PROCESS#", &RET1#, &DATE#, &TIME#
    :SET &WPNUM# = ADD(&WPNUM#, 1)
    :SET &WPNUM# = FORMAT(&WPNUM#, '00')
    :ENDWHILE

    (repeat similar for CPs) 

    Change Primary
    :SET &WP# = "UC4NONPD#WP040"
    :SET &MODE# = "P"
    :SET &RET# = MODIFY_SYSTEM(CHANGE_MODE, &WP#, &MODE#)
    :SET &RC# = FORMAT(&RET#)
    :PRINT "Return code is &RC#"


  • 6.  RE: Configuring service manager details for AE server processes

    Posted Jul 29, 2020 03:41 AM
    Hi @MATTHEW Selke,

    You're right if it's a V12.2 system​. In my case it's a V12.3 system and here the ucsrv.ini looks different (left: V12.3, right: V12.2)


    Since V12.3 there is no port assignment for the WP anymore. And the system creates WP and CP "on the fly". This results in WP/CP "bodies/corpses", which will make your script unusable/useless:


    As you can see, the naming and assignment is totally mixed up: 




    Cheers
    Christoph 






    ------------------------------
    ----------------------------------------------------------------
    Automic AE Consultant and Trainer since 2000
    ----------------------------------------------------------------
    ------------------------------



  • 7.  RE: Configuring service manager details for AE server processes

    Posted Jul 29, 2020 09:12 AM
    Edited by Michael A. Lowry Jul 29, 2020 09:11 AM
    The service manager details are in the HOST table. Here's a handy query that will print out a bunch of information about the AE server processes.

    select
    OH_Name, HOST_HostAttrType, case MQSRV_Type
    when 1 then 'Communications process'
    when 2 then 'Work process'
    when 4 then 'Primary work process'
    when 8 then 'Agent'
    when 16 then 'Java work process'
    when 32 then 'Java communications process'
    else TO_CHAR(MQSRV_Type)
    end as Process_type,
    HOST_TCPIPAddr, HOST_HostName, HOST_TCPIPPort, HOST_NetArea,
    HOST_Version, HOST_SMPhrase, HOST_SMTCPIPPort, HOST_SMDisplayName,
    MQSRV_StartTime, MQSRV_LastUpdate, MQSRV_ConnCnt, MQSRV_RestEndpoint
    from OH
    join HOST on OH_Idnr = HOST_OH_Idnr
    left outer join MQSRV on OH_Name = MQSRV_Name
    where OH_OType = 'SERV'

    This query returns most the information displayed in AdministrationAutomation EngineProcesses and Utilization. The only details not included here are the WP role (O/R) and the utilization stats. If anyone knows where these pieces of information can be found, please reply below.

    This query also includes AE server processes that are defined but down or unresponsive.



  • 8.  RE: Configuring service manager details for AE server processes

    Posted Aug 14, 2020 05:38 AM
    Edited by Spooky Porpoise Aug 17, 2020 03:16 AM
    Yes it works so long as your Service Manager is linked (v12.2.6 shown).  If the AE can get to the port of the smgr then it will grab all of the code automatically and if you made some updates to smgr then you can refresh it by right clicking and selecting Update Service Manager Link and it will pull in the updated info.