Creating discovery formulas for a file-based technology pack

You can create your own discovery formulas for the resources from the file-based devices to be discovered by Telco Network Cloud Manager - Performance.

About this task

You can create discovery formulas for new file-based devices and their resources based on their resource types. These discovery formulas can be directly discovered.

Procedure

  1. Create the discovery formula files as follows:
    For example, create the discovery formula files as follows for a Huawei device:
    • network.discovery
      engine file
      when type is 'bsc' then resource.vendor == 'Huawei' and resource.technology == 'GSM' and resource.version == 'v900r021c10spc600'
      select * from local.bsc 
      set id = new RegExp('.+').test(resource.networkId) ? new RegExp('.+').exec(resource.networkId):'undefined'
      set type = 'network'
      set networkType = 'GSM'
      set displayName = new RegExp('.+').test(resource.networkId) ? new RegExp('.+').exec(resource.networkId):'undefined'
      unset regionId
      unset parentId
      
    • bsBbuBoard.discovery
      
         engine file
      when resource.type like 'bsBbuBoard' and resource.vendor == 'Huawei' and resource.technology == 'GSM' and resource.version == 'v900r021c10spc600'
      select * from local.bsBbuBoard
      set parentId = new RegExp('(.+?)\/').test(resource.id) ? new RegExp('(.+?)\/').exec(resource.id)[1]:null
      set displayName = resource.id
      set boardType = new RegExp('.+\/(.+)\/.+\/.+\/.+').test(resource.id) ? new RegExp('.+\/(.+)\/.+\/.+\/.+').exec(resource.id)[1]:null
      set cabinetNo = new RegExp('.+\/.+\/(.+)\/.+\/.+').test(resource.id) ? new RegExp('.+\/.+\/(.+)\/.+\/.+').exec(resource.id)[1]:null
      set subrackNo = new RegExp('.+\/.+\/.+\/(.+)\/.+').test(resource.id) ? new RegExp('.+\/.+\/.+\/(.+)\/.+').exec(resource.id)[1]:null
      set slotNo = new RegExp('.+\/.+\/.+\/.+\/(.+)').test(resource.id) ? new RegExp('.+\/.+\/.+\/.+\/(.+)').exec(resource.id)[1]:null
      unset bscId
  2. Save the file in /workspace/<my_pack>/discovery/<group> folder. Arrange the discovery formulas in separate directories to avoid conflicts.
    Note: All the discovery formulas must have the file extension as .discovery.
  3. Create all the formulas to discover devices and their resource types.

What to do next

Validate the content to make sure there are no errors in the formulas.