Self-Solve Knowledge Search

Minimize Maximize
Server Automation (SA): Tools to test and report on Dynamic Device Groups (SA 10...
Title :
Server Automation (SA): Tools to test and report on Dynamic Device Groups (SA 10.10 and up)
Document ID :
KM02149634
Product - Version:
server automation ;
OS :
Updated :
Tue Feb 23 14:11:24 GMT 2016
Summary :
Description and location of three tools provided by HP SA support that allows for the reporting and testing of Dynamic Device Groups (DDGs) used in a SA environment (SA version 10.10 and above).
What tools are available for use in testing and reporting on Dynamic Device Groups (DDGs) in a
Server Automation environment
Solution

Dynamic Dervice Groups (DDGs) in Server Automation are dynamically maintained lists of SA
managed servrers that grows and contracts as servers are added and removed from the
SA environment.  They are very handy, but if used incorrectly DDGs can have a negative effect
on the performance of the SA database server as their memberships are recalculated hourly;
if the rules defining the DDGs are inefficient and/or there are a very large number of DDGs
in the environment, their recalculations can make the SA database very busy.

Starting with SA 10.10, three tools were introduced via the SA Rollups (product patches that
can be obtained from HP Support). The tools/scripts are called dgDump, dgTree and dgUsage.
All three tools (if installed) will be found in /opt/opsware/support/bin, and each has man pages
in /opt/opsware/support/man/man1. 

dgDump - Dumps the details of a dynamic device group, reports on the select statement being
generated by the membership rules of the DDG.  The optional -t flag, if specified, will also
cause the select statements to be executed, and will report both the amount of time required
by the select statement and how many members currently belong in the DDG.

Example of the dgDump usage..

              dgDump -t 5540001

              role_class_id: 5540001
              role_class_full_name: Device Groups Private brett Demo DeviceGroup
              role_class_short_name: Demo DeviceGroup
              created_by: brett
              created_dt: 20150414T06:42:01
              modified_by: : brett
              modified_dt: : 20150414T06:44:37
              parent_role_class_id: 5410001
              rule: ((device_ram LESS_THAN_OR_EQUAL_TO â2048â))
              rule(raw):(eJyNk1FPwjAUhf8Kb33xYcyB6NuCRTHLhhvggyFN7YqW1HZZB5EQ/rvtGGWQiXvcPeee+
              7Xr3QEixZIzUjDxCR46zk0HpExlHG+RwN9Ul0IpqK4qyikpZI5Yqovd/uDWcZxuoBXjUxkmxgwe4Xw8h
              OgpjmYTlMAADqdRDLSLfDGe5lRo0w4g3/fhT5ZTpZgUL2uh50sjve8agFYnHczCcRSaPGrb0VE/oLle3
              6K1HLrQ1nP1LxT5sUKEY6UMy0VLW6iaaYP5mqJim5V3N5o3XtSIUZ7OjbM1Va1Fy5uqF7iON7jArOhcS
              7c0rRVYKQ48q11+Fzk+JnSd2zu3rO8X+39GyIzmWD8lgxTAJEHTZz9EUYzg68wP0DQyjLpbrnNC0QGoD
              Om592co9dArLFd+mn0Fp8h+m0i7DdWSgF7PMzJoGpdU5vJYkp+WJZokb34M7fD6VjUP/wWr9CCG)
              sql: SELECT DISTINCT dvc_id from  (select /* ResourceTypeView.01 */ devices.*
              from truth.devices where devices.DVC_ID in (((((select /* RA.device_base_view */
               distinct devices.dvc_id from   (select /* RA.device_ram */ devices.dvc_id as
              dvc_id, round(to_number(mem.quantity) / 1024) as device_ram from truth.devices
              left join (select * from truth.memory_components where memory_type = âRAMâ) mem
              on devices.dvc_id = mem.dvc_id) device_ram,  truth.devices where
              devices.opsw_lifecycle != âDELETEDâ and devices.dvc_id = device_ram.dvc_id  and
              device_ram.device_ram <= 2048)))))) devices
              time_to_execute: 1 devices in 0.002 seconds.

Of note in the above, is the name of the DDG, the creator, the rules used in SA to define the membership, and the resulting
SQL generated by SA.   The amount of time and the number of devices present in the DDG will only
be present if the -t option is selected.

dgTree - Reports on the number and type of Device groups for a specific user. 

Example of the dgTree output:

       # dgTree -di -s ascii2 "Private/jyaya"
       jyaya (D:17340001)
        +- Mine (D:17360001)
        |  +- Still Mine (D:17380001)
        |  â- Also Mine (D:17370001)
        +- My other Static (S:17400001)
        â- My Static (S:17390001)

It the example above, jyaya is the SA user, and the D or S before the Device Group ID is either Dynamic or Static.

dgUsage - Reports on the usage of the device groups by other components of SA (software policies, audit polices,
patch policies, etc.  Very useful to tracking down DDGs that are no longer used and that can be removed in order
to remove their impact on the database. 

Example of the dbUsage tool.

       # dgUsage --verbose Public/dgRoot
       dgRoot [17550001] - DeviceGroup:[17600001,17570001,17560001,17570002,17590001,17580001]
       dgRoot/AccessControlUserGroup [17600001] - AccessControl
       dgRoot/AuditLinkedDG [17570001] - AuditPolicy:[20001]
       dgRoot/SoftwarePolicyLinkedDG [17560001] - SoftwarePolicy:[1210001]
       dgRoot/MultiUsage [17570002] - SoftwarePolicy:[610001,920001],PatchPolicy:[17560002]
       dgRoot/PatchPolicyLinkedDG [17590001] - PatchPolicy:[980001,17560002]
       dgRoot/DeviceGroupWithServer [17580001] - ORPHAN

In the case above, ORPHAN indicates that the DDG is not being used by any SA component currently.

Again, man pages for each of these tools can be found in /opt/opsware/support/man/man1.