Question:
How does nis_server populate the groups seen in USM?
Answer:
The following is a description of the various tables involved with displaying the groups in USM (Unified Service Manager) and how nis_server interacts with these tables to build those groups.
cm_group_automatic is a table that defines automatic groups. In NMS 5.61 this contains a single row, with a single column called "field" containing the value "os_type". This table should never be altered manually unless directed by Nimsoft support.
So, nis_server looks at this table to see what it contains, and sees that it contains "os_type." This causes nis_server to look at cm_computer_system.os_type, and create a group for every unique value it finds. (i.e. SELECT DISTINCT OS_TYPE FROM CM_COMPUTER_SYSTEM).
In NMS 5.61, these autogroups were created at the root of the grouping tree. In NMS 6.0 a new column (parent) was introduced to this table, indicating the name of the container that the autogroups should be placed under. ‘Servers’ is the default value for the parent.
cm_group is the table that stores *all* groups, be they containers, dynamic groups, or automatic groups. The Windows, Unix, Solaris, etc. groups that cm_group_automatic generates are stored here. The grp_type column indicates the type of the group. 0=container, 1=dynamic, 2=automatic.
At the database level, there is no uniqueness constraint on name. This means that, as far as the database is concerned, there can be multiple groups with the same name. Another important column is pgrp_id, which stands for parent group id. If a group exists but is not located in the correct place, i.e. underneath the right parent group, then updating p_grp_id in cm_group is the answer.
cm_group_automatic_results links cm_group and cm_group_automatic. The auto_id and grp_id columns in cm_group_automatic_result reference cm_group_automatic and cm_group respectively. When nis_server calculates which autogroups it expects and any that are not represented in the cm_group_automatic_result table are created. (there is also a cm_group_dynamic and cm_group_dynamic_results which do the same thing for dynamic groups.)