AOSOM-Streaming Guide
AOSOM-Streaming Overview
AOSOM streaming is demonstration software, not intended for production environments.
You can configure Apstra to generate Google Protocol Buffer (protobuf) streams for counter data (perfmon), alerts, and events. Each data type is sent to a streaming receiver over its own TCP socket. Even if all three data types are configured for the same streaming receiver, three connections are created between the Apstra server and the streaming receiver. This also allows for all three types to be sent to three different streaming receivers. You can choose from the many open-source projects, or develop your own solutions to capture, store and inspect the protobuf data. Apstra has developed a project available on GitHub called AOSOM-Streaming to demonstrate how this can be achieved using several open-source components. The AOSOM-Streaming project is meant to help you understand how you can consume the AOS protobuf stream. It is for demonstration purposes only, except for the Apstra Telegraf input plugin. Apstra software fully supports this plug-in for use as part of your streaming telemetry solution.
The Aosom Streaming project provides a packaged solution to collect and visualize telemetry streaming information coming from an Apstra server. This provides a web interface experience and example queries to handle alerts, counters, and Apstra events. This open-source project officially lives on Github at https://github.com/Apstra/aosom-streaming.
The packaged solution includes:
- A graphical Interface based on Grafana (port 3000)
- Prometheus for Counters and Alerts (port 9090)
- Influxdb for Events (port 8086)
- 2 Collectors, one for each database based on Telegraf.
Grafana
From a web browser enter the URL http://<aosom-streaming>:3000 and enter username admin (default) and password admin (default).
The grafana GUI includes two main sections (top left). Apstra AOS Blueprint describes overall telemetry alerts and traffic throughput, as well as individual devices for interface telemetry. Blueprints are learned automatically using the Apstra ‘telegraf’ Docker container; no further configuration is necessary.
In the screenshot above, we can observe traffic in the demo Apstra environment, and aggregate CPU, traffic, and errors.
To filter telemetry events based on specific and individual devices, change the dashboard at the top to Apstra AOS Device. Here we can observe there are two active route anomalies in the blueprint, and Apstra has received telemetry for two leaf switches.
Scroll down to view device statistics such as CPU and Memory:
Prometheus
Prometheus is used for alerts and device telemetry counter storage in the Aosom-streaming appliance. From a web browser enter the URL http://<aosom-streaming>:9090 to access the Prometheus GUI.
When incoming events appear, Apstra dynamically builds each of the queries. To see example query names, begin typing under ‘execute’. Starting with ‘alert’ it tab-completes available alerts that prometheus has received from Apstra.
Here is an example of BGP Neighbors being offline.
InfluxDB
InfluxDB is used to store Apstra events from telemetry streaming. From a web browser enter the URL http://<aosom-streaming>:8083 to access InfluxDB.
We can show the available influxdb keys with queries, such as show field keys or show measurements.
Once we know a measurement, we can view the data and keys with select * from <measurement> -- In this case, we’ll capture the LAG interface status.
Developing an influx-db application is beyond the scope of this documentation.
Configure Aosom-Streaming
To configure telemetry streaming as part of this project, you'll edit
variables.env
, run the make start
file and
restart the containers. No Apstra server configuration is required.
Documentation for starting, stopping, and clearing data is available at https://github.com/Apstra/aosom-streaming
The telegraf project connects to the Apstra API and posts an IP:Port that Apstra uses to stream realtime telemetry data back to.
Reconfigure Aosom-streaming after Apstra Server Upgrade
Build Aosom-Streaming VM (Optional)
You can build your own Aosom-streaming VM, which is a Docker container. This steps show you how to set up a basic Docker server.
Install Ubuntu 16.04.2
Download the Ubuntu 16.04.2 ISO and provision a new VM. The default username is aosom and the password is admin.
For larger blueprints, we recommend changing RAM to at least 8GB and CPU to at least 2 vCPU. More disk space may also be required.
Resource | Quantity |
---|---|
RAM | 8GB |
CPU | 2 vCPU |
Network | 1 vNIC |
Install Packages
Install required packages, based on Ubuntu 16.04.2.
apt-get update
Update the system to ensure all packages are up to date.
apt-get install docker docker-compose git make curl openssh-server
aosom@ubuntu:~$ sudo apt-get install docker docker-compose git make curl openssh-server [sudo] password for aosom: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: bridge-utils cgroupfs-mount containerd dns-root-data dnsmasq-base docker.io git-man liberror-perl libnetfilter-conntrack3 libperl5.22 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libyaml-0-2 patch perl perl-modules-5.22 python python-backports.ssl-match-hostname python-cached-property python-cffi-backend python-chardet python-cryptography python-docker python-dockerpty python-docopt python-enum34 python-funcsigs python-functools32 python-idna python-ipaddress python-jsonschema python-minimal python-mock python-ndg-httpsclient python-openssl python-pbr python-pkg-resources python-pyasn1 python-requests python-six python-texttable python-urllib3 python-websocket python-yaml python2.7 python2.7-minimal rename runc ubuntu-fan xz-utils Suggested packages: mountall aufs-tools btrfs-tools debootstrap docker-doc rinse zfs-fuse | zfsutils git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn diffutils-doc perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make python-doc python-tk python-cryptography-doc python-cryptography-vectors python-enum34-doc python-funcsigs-doc python-mock-doc python-openssl-doc python-openssl-dbg python-setuptools doc-base python-ntlm python2.7-doc binutils binfmt-support make The following NEW packages will be installed: bridge-utils cgroupfs-mount containerd dns-root-data dnsmasq-base docker docker-compose docker.io git git-man liberror-perl libnetfilter-conntrack3 libperl5.22 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libyaml-0-2 patch perl perl-modules-5.22 python python-backports.ssl-match-hostname python-cached-property python-cffi-backend python-chardet python-cryptography python-docker python-dockerpty python-docopt python-enum34 python-funcsigs python-functools32 python-idna python-ipaddress python-jsonschema python-minimal python-mock python-ndg-httpsclient python-openssl python-pbr python-pkg-resources python-pyasn1 python-requests python-six python-texttable python-urllib3 python-websocket python-yaml python2.7 python2.7-minimal rename runc ubuntu-fan xz-utils make 0 upgraded, 54 newly installed, 0 to remove and 3 not upgraded. Need to get 32.4 MB of archives. After this operation, 174 MB of additional disk space will be used. Do you want to continue? [Y/n] y
Add the aosom user to the Docker group. This allows ‘aosom’ to make Docker configuration changes without having to escalate to sudo.
aosom@ubuntu:~/aosom-streaming$ sudo usermod -aG docker aosom Log out and log back in again for ‘aosom’ user to be properly added to the group.
Copy the Aosom-streaming Docker containers over with ‘git clone’.
aosom@ubuntu:~$ git clone https://github.com/Apstra/aosom-streaming.git Cloning into 'aosom-streaming'... remote: Counting objects: 303, done. remote: Total 303 (delta 0), reused 0 (delta 0), pack-reused 303 Receiving objects: 100% (303/303), 64.10 KiB | 0 bytes/s, done. Resolving deltas: 100% (176/176), done. Checking connectivity... done. aosom@ubuntu:~$
Set Container Restart Policy
The AOSOM-Streaming package does not set the Docker restart policy; this is up to
your orchestration toolchain. Open aosom-streaming/docker-compose.yml and add
restart: always
to each of the service directives. This
ensures that Docker containers are online after a service reboot.
git diff docker-compose.yml
aosom@ubuntu:~/aosom-streaming$ git diff docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml index 799d4c5..0d0fcc2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,7 @@ services: - prometheus ports: - "3000:3000" + restart: always # ------------------------------------------------------------------------- # Prometheus - @@ -30,6 +31,7 @@ services: - '-config.file=/etc/prometheus/prometheus.yml' ports: - '9090:9090' + restart: always # ------------------------------------------------------------------------- # influxdb @@ -43,6 +45,7 @@ services: ports: - "8083:8083" - "8086:8086" + restart: always # ------------------------------------------------------------------------- # Telegraf - Prom @@ -57,6 +60,7 @@ services: - /etc/localtime:/etc/localtime ports: - '6666:6666' + restart: always # ------------------------------------------------------------------------- # Telegraf - Influx @@ -71,3 +75,4 @@ services: - /etc/localtime:/etc/localtime ports: - '4444:4444' + restart: always
Set up variables.env
and start container per Aosom-Streaming
application setup section.
Change System Hostname
Modify /etc/hostname
to aosom, and change the loopback IP in
/etc/hosts
to aosom from ubuntu.
Troubleshooting
While most troubleshooting information is included in the Github main page at https://github.com/Apstra/aosom-streaming, you can run some simple commands to make sure the environment is healthy.
Check for Logs from Apstra to Aosom-streaming
Run Docker logs aosomstreaming_telegraf-influx_1
You should see a blueprint ID, and some influxdb ‘write’ events when telemetry events occur on AOS - BGP, liveness, config deviation, etc.
GetBlueprints() - Id 0033cf3f-41ed-4ddc-91f5-ea68318fba9b 2017-07-31T23:59:13Z D! Finished to Refresh Data, will sleep for 20 sec 2017-07-31T23:59:15Z D! Output [influxdb] buffer fullness: 11 / 10000 metrics. 2017-07-31T23:59:15Z D! Output [influxdb] wrote batch of 11 metrics in 5.612057ms 2017-07-31T23:59:20Z D! Output [influxdb] buffer fullness: 4 / 10000 metrics. 2017-07-31T23:59:20Z D! Output [influxdb] wrote batch of 4 metrics in 5.349171ms 2017-07-31T23:59:25Z D! Output [influxdb] buffer fullness: 11 / 10000 metrics. 2017-07-31T23:59:25Z D! Output [influxdb] wrote batch of 11 metrics in 4.68295ms 2017-07-31T23:59:30Z D! Output [influxdb] buffer fullness: 4 / 10000 metrics. 2017-07-31T23:59:30Z D! Output [influxdb] wrote batch of 4 metrics in 5.007029ms GetBlueprints() - Id 0033cf3f-41ed-4ddc-91f5-ea68318fba9b 2017-07-31T23:59:33Z D! Finished to Refresh Data, will sleep for 20 sec
Ensure Containers are Running
To see and ensure that all the expected containers are running, run
docker ps
:
aosom@ubuntu:~/aosom-streaming$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e03d003a2ef9 grafana/grafana:4.1.2 "/run.sh" 3 minutes ago Up 3 minutes 0.0.0.0:3000->3000/tcp aosomstreaming_grafana_1 3042d45f1107 prom/prometheus:v1.5.2 "/bin/prometheus -con" 3 minutes ago Up 3 minutes 0.0.0.0:9090->9090/tcp aosomstreaming_prometheus_1 429328fbb5ac apstra/telegraf:1.2 "telegraf -debug" 3 minutes ago Up 3 minutes 0.0.0.0:6666->6666/tcp aosomstreaming_telegraf-prom_1 0a84241e1366 apstra/telegraf:1.2 "telegraf -debug" 3 minutes ago Up 3 minutes 0.0.0.0:4444->4444/tcp aosomstreaming_telegraf-influx_1 f4d2deb0e428 influxdb:1.1.1-alpine "/entrypoint.sh influ" 3 minutes ago Up 3 minutes 0.0.0.0:8083->8083/tcp, 0.0.0.0:8086->8086/tcp aosomstreaming_influxdb_1