CHKACTGRP – New tool to programmatically check for active group
Interactive iCluster users can use Option 2 Work with Groups or the Status Monitors to determine if a group is active. However, if you needed to determine this programmatically, traditionally a read of the DMGROUPS metadata file for the specified group to see if the status field was *STRREPL was used. The status field however is really used to capture the group status after the last role switch. Starting and ending a group and then querying this file will show the status changing from *STRREPL to *ENDREPL but this does not always mean the group is fully active. There may be an apply process that is down, or a source scrape or send process that is inactive, or perhaps a remote journal used by the product is *INACTIVE.
A new ICTOOLS command called CHKACTGRP will check to ensure that all primary and backup processes as well as remote journals are active as well as that the status field in DMGROUPS is *STRREPL. The active status and reason code for a not active group will also be displayed. In addition, the active status will be returned in variable &ACTIVE of TYPE(*CHAR) and LEN(4) with a value of *YES or *NO, while the reason code for a not active group will be returned in variable &REASON of TYPE(*CHAR) and LEN(4).
This command requires IBM i 7.1 or later and iCluster 7.1 or later. It can be run on any node in the cluster and it will start *REXEC servers on the primary and backup nodes if the command is being run from the backup node for the group only, as the command requires submitting remote commands.
If the group active status &ACTIVE is returned as *YES, the reason code &REASON will be returned as *ALL. If the group active status &ACTIVE is returned as *NO, the reason code &REASON will be one of the following values:
- *BKP – One or more of the backup receive and apply processes is inactive
- *PRM – One or more of the primary scrape and send processes is inactive
- *RMT – One or more remote journals used by the group is inactive
- *RSW – The role switch status field in DMGROUPS is not *STRREPL
Here is a screen shot of the tool in action:
Please reply to this post or contact me at email@example.com if you would like to try out this new tool.