File-based discovery process

After the discovery, the discovered devices and their resources are stored in Cassandra database in the Inventory Service.

Discovery formulas

Discovery rules are available in the as predefined discovery formulas for specific vendors and technologies. These discovery formulas are used by Telco Network Cloud Manager - Performance to discover the vendor-specific devices and their resources.

An example of Avro record from Apache NiFi from where basic inventory and metric information can be obtained:
{
  "resource" : "deviceIP=10.71.214.65, deviceID=7340054, deviceName=FTTO_Test1, resourceID=NE:7340054;FR:0;S:5;CP:-1;PP:--0-;ONU:0, id=FTTO_Test1/Frame:0/Slot:5/Port:0/ONU ID:0, type=huaweiGponOnt, granularityPeriod=15, indicatorGroupID=IG80112",
  "time" : 1526372100000,
  "tpe" : "NUMBER",
  "kpi" : "upAverageThroughput",
  "value" : "110.00"
}

After the Technology Pack is installed, you can see the discovery formulas in the following location:
/opt/basecamp/file-collector/content/discoveries/<tech_pack>. The discovery formulas have .discovery as the file extension. These formulas contain additional discovery rules to obtain more information about the resources, properties, and their relationships.

Typically, every Technology Pack has three types of discovery formulas.
  • Device discovery rule

    These rules are used in discovery formulas in built-in Technology Packs for resource discovery to create or enrich in-band discovered resources and the relation discovery (stitch) to create relations among the resources.

    For example,
    engine file
    when resource.type like 'cabinet'
    select * from local.cabinet
    set vendor = 'cabinet'
    set prop2 = resource.prop2
    unset prop1
    
  • Resource and properties discovery rules that are specific to a resource type.
    Optionally, formulas can contain discovery rules to obtain additional properties. For example,
    engine file
    when resource.type like 'cabinet'
    select * from local.<reousrce_type>
    set prop1 = <reousrce_type>.prop1
    set prop2 = <reousrce_type>.prop2
    set prop2 = <reousrce_type>.prop3
    
  • Resource relationship rules
    For example,
    engine file
    relate device to cabinet as contain when target.name == source.prop2
    
nokiaDevice.discovery file contents.

engine file
when resource.vendor like 'Nokia'
select deviceName from local.gponIgmpCard UNION ALL select deviceName from local.gponMulticastSystem UNION ALL select deviceName from local.gponInterface UNION ALL select deviceName from local.gponEthernetLag UNION ALL select deviceName from local.gponCard UNION ALL select deviceName from local.gponOnt UNION ALL select deviceName from local.gponUniPort UNION ALL select deviceName from local.gponVoice UNION ALL select deviceName from local.gponOntEthernetPort UNION ALL select deviceName from local.gponVlan UNION ALL select deviceName from local.gponBridgePortVlan UNION ALL select deviceName from local.gponXdsl
set id = resource.deviceName
set name = resource.deviceName
set type = 'device'
set vendor = 'Nokia'

Discovery model files

Discovery model files are applicable for both SNMP and File-based discovery. Two types of model files are available in the Inventory Service:
  • /opt/itoa/services/inventory/content/model/Property
    The model files have .model as the file extension. Every resource type has its own property model file that describes all the properties that are available in that resource type. For example, the contents of gponCard.model file is as follows:
    type gponCard extends snmpPollable{
            property index String{
                    required = true
            }
            property vendor String
            property id String
            property hwFrameType String
            property tpFrameId String
            property tpSlotId String
            property hwSerialNumber String
            property cardType String
            property sysName String
            property deviceType String
            property portType String
            property displayName String
            property deviceName String
            property deviceIP String
            property objectID String
            property cardID String
            property portSlot String
            property portShelf String
            property portRack String
            property portPort String
            property card String
            property portCard String
            property deviceID String
            property resourceID String
            property granularityPeriod String
            property waitPeriod String
            property interval String
    }
    }
    
  • /opt/itoa/services/inventory/content/model/Relationship
    The model files have .model as the file extension. Every resource type has its own relationship model file that describes the resource grouping based on the resource type and the device. For example, the contents of device-card.model file is as follows:
    relationship contain device ->> card

Stages in discovery

Apache NiFi and File Collector Service parse and extract the information from the input files from EMS.

Inventory data flow Performance data is collected in different file formats as CSV or XML and sent to Apache NiFi. Apache NiFi converts the data into Avro format records and sends the data to Kafka. The data is written to file-collector.records Kafka topic. File Collector Service reads the data in the topic and segregates the data. File Collector Service runs the vendor-specific discovery rules (discovery formulas) and sends the inventory data (resources and their relationships) to the Resource Management System. The Inventory Service in Resource Management system handles the data and stores it in Cassandra database. File Collector Service runs the vendor-specific collection formulas and sends the metric data to the Timeseries Service. Optionally, the metric data is processed and aggregated based on user-defined calculations (UDC) and stored in CarbonData database in DiamondDB Service.