How to export a simple group list via UIMAPI or SQL
search cancel

How to export a simple group list via UIMAPI or SQL

book

Article ID: 212338

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

How to export a group list via UIMAPI or SQL

Environment

Any UIM Version

Resolution

If it's a simple list of servers you can do it via UIMAPI calls or directly via a sql query:


-- get all groups and get group-id
curl -X GET "http://<hostname>/uimapi/devicegroups" -H "accept: application/json"
-- use group-id to request members
curl -X GET "http://<hostname>/uimapi/devicegroups/10/members" -H "accept: application/json"

-- or via sql:
SELECT CS.cs_id,CS.name as robotname,CG.name as groupname
FROM cm_computer_system AS CS WITH (NOLOCK)
INNER JOIN cm_group_member AS GM WITH (NOLOCK) ON GM.cs_id = CS.cs_id
INNER JOIN cm_group AS CG WITH (NOLOCK) ON GM.grp_id = CG.grp_id
where CG.name = 'test'

 

You could try a query like: (you can add a test on an OS if needed)
---------------
select g.name, s.name, s.ip, s.os_type,s.os_name, r.domain,r.hub,r.robot,r.origin,s.dedicated, nimbus_type,r.address
from CM_COMPUTER_SYSTEM s with(nolock), CM_GROUP g with(nolock), CM_GROUP_MEMBER m with(nolock),CM_NIMBUS_ROBOT r with(nolock)
where g.grp_id = m.grp_id and m.cs_id = s.cs_id and s.name = robot
and robot_id not in (select robot_id from CM_NIMBUS_PROBE where probe_name = 'controller')