Retrieving list of devices under each device server (DS) from the database
search cancel

Retrieving list of devices under each device server (DS) from the database

book

Article ID: 331085

calendar_today

Updated On:

Products

VMware Smart Assurance Network Observability

Issue/Introduction

It can be useful to extract the list of devices from each Device Server (DS) from the database. This provides the steps, and commands needed, in order to do so. 

Environment

NCM - All supported versiions

Resolution

There is no relationship created in the controlDB for a device server and its associated devices. You can however, get this information from the cflist (infraDB) as follows:

  • To extract the idx for the device server and associated devices, but first source NCM with:
    source /etc/voyence.conf
  • Go into the following directory:
 opt/voyence/cgi-bin/ 
  • Then run the cflist command to make a copy of the cflist as follows:

    ./cflist.cgi > cflist.out
    
  • Then you can view the cflist.out file, and what you should see is similar to as follows:

    HEAD RTypeList= PollTypeList= UserList= DispositionList= DeliveryList= UrlList= PopList=1000 NetList=999 :
    POP 1000 "<Device Server name>" NetList= RsrcList= DevList=1001,1002,1003,1004,1005 EmsList= : ADDR="<IP address>" AGE_DAYS=<Number of Day> CLEANUP_DAYS=<Numeric value> AD_ENABLE=0 AD_ARPCACHE=0 AD_DFLTROUTE=0 AD_AUTO_RESOURCE=0 AD_DEFAULT_POLL=0 SNMP_TIMEOUT=<Time out value> SNMP_RETRY=<Retry value> CM_DEBUGSESSION=0 SORTCONFIG=1 CM_MAXMAINTASKS=20 CM_PULLTIMER=<Timer value in seconds> CUTTHRU_PULLTIMER=<Cutthru pull timer in seconds> MAX_COMM_ATTEMPTS="5" CM_SMGR_CACHING_ENABLED=1 CM_SMGR_SESSION_TIMEOUT=60 CM_SMGR_SESSIONS_PER_DEVICE=4 AD_BATCHSIZE=1000 AD_NUMHOP=10 AD_TIMEOUT=10 AD_LOOPCNT=2 CM_NATTEDIP_LOOKUP=1 RECORDVER="1.0"
    DEV 1001 "<Device name 1>" ElemList= PopParent=1000 EmsParent= : UID="<Alpha numeric  value>" SYSOBJECTID="1.3.6.1.4.1.9.1.186" ADDR="<IP address>" PACKAGE=1 PACKAGE_IS_SET=0 CM_MANAGED=1 CREATE_DATE=<Date in seconds> AUTO_DISCOVERED=1
    DEV 1002 "<Device name 2>" ElemList= PopParent=1000 EmsParent= : UID="<Alpha numeric  value>" SYSOBJECTID="1.3.6.1.4.1.9.1.694" ADDR="<IP address>" PACKAGE=2 PACKAGE_IS_SET=0 CM_MANAGED=1 CREATE_DATE=<Date in seconds> AUTO_DISCOVERED=1
    DEV 1003 "<Device name 3>" ElemList= PopParent=1000 EmsParent= : UID="<Alpha numeric  value>" SYSOBJECTID="1.3.6.1.4.1.9.1.695" ADDR="<IP address>" PACKAGE=2 PACKAGE_IS_SET=0 CM_MANAGED=1 CREATE_DATE=<Date in seconds> AUTO_DISCOVERED=1
    DEV 1004 "<Device name 4>" ElemList= PopParent=1000 EmsParent= : UID="<Alpha numeric  value>" SYSOBJECTID="1.3.6.1.4.1.9.1.694" ADDR="<IP address>" PACKAGE=2 PACKAGE_IS_SET=0 CM_MANAGED=1 CREATE_DATE=<Date in seconds> AUTO_DISCOVERED=1
    DEV 1005 "<Device name 5>" ElemList= PopParent=1000 EmsParent= : UID="<Alpha numeric  value>" SYSOBJECTID="1.3.6.1.4.1.9.1.516" ADDR="<IP address>" PACKAGE=2 PACKAGE_IS_SET=0 CM_MANAGED=1 CREATE_DATE=<Date in seconds> AUTO_DISCOVERED=1
    NET 999 "Default Network" RsrcList= PopList= :


  • The POP 1000: that is the idx of the device server itself

  • The DEV 1001 1005 are idx 1001 to 1005:  these are the devices under the device server idx 1000. You can extract that info from the PopParent attribute in the device detail, for example:
    DEV 1005 "<device name>" ElemList= PopParent=1000
  • You can also see the Device name here as well
  • You can then access the controlDB to view the details such as IP address etc:
  • To login into the db, as root on your db server type:

    su - pgdba -c 'psql voyencedb voyence'
    
  • To get data on the devices, you can run the following:
    voyencedb=# select device_idx AS "Device ID",
    voyencedb-# management_ip_address AS "IP Address"
    voyencedb-# from voyence.cm_device;
    
    Device ID | IP Address
    -----------+--------------
    -1 |
    1002 | <IP address>
    1004 | <IP address>
    1001 | <IP address>
    1003 | <IP address>
    1005 | <IP address>


  • To get the info on the device server:

    voyencedb=# select * from cm_device_server;
    device_server_id | device_server_name | device_server_idx | version
    ---------------------------------------------------+--------------------+-------------------+---------
    \012@\034\305\2257\357?\352\370/\037N\001\000\000 | <DS server name> | 1000 | 0
    (1 row)