# Edge Collector

## Overview

An Edge Collector is a type of RDA Agent that can discover and collect IT asset data in an agentless manner and send this data to the RDA platform. If a user wants to send data from their network devices (Chassis, Fabric Extender, Interfaces) to the RDA platform, users can install Edge collector in their local environment. Currently, Edge Collector can collect data using **SNMP** and **SSH** protocols.

## Prerequisites

* Linux OS
* Memory - 8 GB
* Disk - 50 GB
* Python 3.7.4
* [Docker version 18.09.2](https://docs.docker.com/engine/install/) (or above)&#x20;
* [Docker-compose](https://docs.docker.com/compose/install/) (1.27.x and above)

## Installation Instructions

#### Step-1: Download RDA Fabric Configuration and copy to host where Edge Collector Agent will be installed

Download RDA Fabric Configuration from the RDA SaaS portal by going to:&#x20;

Configuration > Fabric Configuration and download the file to the local filesystem where the Edge Collector Agent is going to be installed

* Save the file as `rda_network_config.json`

![](https://lh4.googleusercontent.com/DsLiTD-w9x1mSjWWE5z-8yGnSoo6XynOejPvLJ3KlzIm7NZgLBzwLb0v2tS2bQR-2dYyprA08vUkWh0lrncl34U8LgJg-ZDlvBqhIkVeXNBIxcpBn4BcCqCPCTYKAOOavqcugor8)

Download RDA Fabric configuration

* Copy the downloaded file to `~/network_config/rda_network_config.json`

```
mkdir -p ~/network_config
cp rda_network_config.json ~/network_config/rda_network_config.json
```

#### Step-2: Docker Login

&#x20;`$ docker login -u=readonly -p='readonly' cfxregistry.cloudfabrix.io`

`WARNING! Using --password via the CLI is insecure. Use --password-stdin. WARNING! Your password will be stored unencrypted in /home/ec2-user/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store`

#### Step-3: Docker Compose File Download

Download `edge-collector-docker-compose.yml` file from the following location

<https://macaw-amer.s3.amazonaws.com/releases/RDA/edgecollector-agent-docker-compose.yml>

#### Step-4: Create a credential file for accessing agent to perform discovery

```
bash# mkdir -p ~/cfxedgecollector
bash# mkdir -p ~/cfxedgecollector/cred
```

&#x20;create `credentials.json` file and enter credentials as shown below in the file  and copy file in the directory `~/cfxedgecollector/cred/credentials.json`

We  need  to  add all  required credentials for collection in the credentials.json file

`bash# cat credentials.json`

```
[
  {
    "ipAddress" : [
       "10.95.158.*",
       "10.95.123.10-10.95.123.20"
      ],
    "id": "<unique_name>",
    "type": "device-snmp-v1v2",
    "credentials": {
      "readCommunity": "*****",
      "protocol": "snmpv2c",
      "port": 161
    }
  },
  {
     "ipAddress" : [
       "10.95.158.*"
      ],
    "id": "<unique_name>",
    "type": "device-host-ssh",
    "credentials": {
      "username": "cfxuser",
      "password": "*****",
      "port": 22,
      "protocol": "SSHV2",
      "pkey": null,
      "passphrase": null
    }
  },
 {
     "ipAddress" : [
       "10.95.158.9,10.95.158.10"
      ],
    "id": "<unique_name>",
    "type": "device-host-ssh",
    "credentials": {
      "username": "cfxuser",
      "password": "*****",
      "port": 22,
      "protocol": "SSHV2",
      "pkey": null,
      "passphrase": null
    }
  }
]
```

**Note:** In the above `credentials.json` file,&#x20;

* `“id”` field indicates that you can give any unique name for the credential identifier,&#x20;
* `“type”` field is a standard type used for SNMP and SSH Devices. Supported types are
  * `“device-snmp-v1 or device-snmp-v2”` for **SNMP** data collection&#x20;
  * `"device-host-ssh"` for **SSH** data collection for the network devices

#### Step-5: Edit the `edgecollector-agent-docker-compose.yml` file and provide the name of the agent in the last line:

`vi edgecollector-agent-docker-compose.yml (or use your favorite editor to edit / update the file )`

```
rda_edgecollector_agent:
  image: 'cfxregistry.cloudfabrix.io/cfxcollector:3.0.0'
  restart: always
  ports:
    - '8889:5000'
  volumes:
    - '~/network_config:/network_config'
    - '~/cfxedgecollector:/cfxedgecollector'
    - '~/cfxedgecollector/cred:/cred'
  environment:
    RDA_NETWORK_CONFIG: /network_config/rda_network_config.json
    PYTHONPATH: /opt/cfxedgecollector/
  container_name: rda_edgecollector_agent
  ulimits:
    nproc:
      soft: 64000
      hard: 128000
    nofile:
      soft: 64000
      hard: 128000
  entrypoint:
    - /bin/bash
    - '-c'
    - >-
      cd /opt/cfxedgecollector/src/; python -c 'import edgecollector_rda_agent ;
      edgecollector_rda_agent.run()' --creddir  /cred/ --agent-group-name <name>

```

#### Step-6: Bring Up Edge Collector Agent:

`docker-compose -f edgecollector-agent-docker-compose.yml up -d`

#### Step-7: Check Edge  Collector Agent Status:

Check Edge Collector Agent status using `docker p`s command and ensure that Edge Collector Agent is up and running, without any restarts. If you see that the Edge Collector Agent is restarting, make sure you copied the RDA network config file to the correct location.&#x20;

```
[macaw@sysloglinux110 ~]$ docker ps | grep  rda_edgecollector_agent
0be4f22ba07e        cfxcollector:cfxcollector-1.0.1   "/bin/bash -c 'cd /o…"   2 days ago          Up 2 days           0.0.0.0:8889->5000/tcp   rda_edgecollector_agent
[macaw@sysloglinux110 ~]$
```

#### Step-8:  Verify  Edge Collector Agent in RDA Studio or rdac utility

Command: **!rdac agent-bots**

![](https://lh6.googleusercontent.com/HOAu_UQuI9FQjsOpsgiy1u0psEQuqgy0Erpr2bwMwYHUAyCT_pVPF9do_Eop4MUKJBlVUunyHqCo6Qb_X1cgucGw3QEzCUCUx0BYt1C1f5lam1XkjpFD7hqImiLk7fHeENnYOPDD)

If you have installed an RDA Client (rdac) command-line utility, you can also verify the newly created Edge Collector Agent using rdac agents command.&#x20;

Command: **rdac agent-bots**

![](https://lh6.googleusercontent.com/YjhgDNSoexMIshHgstbXfsq5W7FDLUuRbWz02MkeXO0KKYrwME7-9DBaTPITCEKfaHw7P3tmorq4G4avWS7KbJhKfsJ8Iud1tSWQahJCyLS1KDTzzEsV8ZwFk2YSozOqkFK6pZqk)

\ <br>
