Automic Workload Automation

  • 1.  Where is the PWP

    Posted Dec 19, 2016 09:48 AM
    A customer asked:
    Due to network problems, the primary changed between the servers. We would like to create a routine that can find and notify this event. How can we check, which WP is the PWP?

    There are different ways to find out what WP is the PWP.

    E.g., the following script command shows the role of a WP:
    :SET &RET# = GET_UC_SETTING(SERVER_MODE, "WS10#WP001") :print "WS10#WP001 is &RET#"


    Result:
    2016-11-15 07:57:05 - U0020408 WS10#WP001 is P

    Where:
    "C" - Communication process(CP)
    "P" - Primary work process (PWP)
    "W" - Work process (WP)
    "D" - Dialog process (DWP)
    "N" - NonStop process (NWP)
    " " - The server process is inactive.

    I.e., if you execute this for all WPs, you get a list oft he WPs and their roles.

    Following command returns the primary:
    :SET &sernam# = GET_UC_SERVER_NAME()
    :PRINT &sernam#

    Results:
    2016-11-15 07:57:05 - U0020408 WS10#WP005

    In the log oft the WP that becomes PWP during a failover, you can find:
    20161114/153248.878 - U0003475 Server 'WS10#WP004' is the primary server of the system 'WS10'.
    20161114/153248.909 - U0011818 Server 'WS10#WP004': Mode changes from 'NORMAL' to 'PRIMARY'.

    In the other WP's logs:
    20161114/153250.159 - U0003475 Server 'WS10#WP004' is the primary server of the system 'WS10'.

    Changing to DWP gives this log line:
    20161114/153920.081 - U0003389 Server 'WS10#WP003' has changed its mode from 'WP' to 'DWP'.

    Ando f course, you can use the select below to find the PWP:
    select * from mqsrv where mqsrv_type = 4;