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?
:SET &RET# = GET_UC_SETTING(SERVER_MODE, "WS10#WP001") :print "WS10#WP001 is &RET#"
2016-11-15 07:57:05 - U0020408 WS10#WP001 is P
"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.
:SET &sernam# = GET_UC_SERVER_NAME():PRINT &sernam#
2016-11-15 07:57:05 - U0020408 WS10#WP005
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'.
20161114/153250.159 - U0003475 Server 'WS10#WP004' is the primary server of the system 'WS10'.
20161114/153920.081 - U0003389 Server 'WS10#WP003' has changed its mode from 'WP' to 'DWP'.
select * from mqsrv where mqsrv_type = 4;