LoginSignup
16
4

More than 1 year has passed since last update.

ElastiFlowでNetFlowを解析し、Thousand EyesでZoom可視化にチャレンジ

Last updated at Posted at 2021-12-06

はじめに

この投稿はシスコシステムズ合同会社の有志でお送りする Advent Calendar 2021 の一環でお届けします。
ぜひ他の投稿もご覧ください!
- Cisco Systems Japan Advent Calendar 2021
- Cisco Systems Japan Advent Calendar 2021 2nd

前書き

コロナ禍での Work from home やリモートワークが身近になった一方で、自宅・オフィスなどでWeb会議が繋がらない、音が途切れる、などの事象に頭を悩ませている方もさぞかし多いことかと思います。

我が家でも、妻や子供のリモートワーク・リモート学習でオンラインツールを利用する機会が非常に増えました。
子供が通っている塾ではZoomがオンラインコミュニケーションツールとして採用され、子供たちがオンラインでも学習機会を得たのは大きな進歩であると大変嬉しく思う一方(もちろん、1人のCisco社員としてはWebExが採用されないことに微妙な気持ちはあるのですが)、その学習が滞りないように、Zoomのアプリケーション可視化は非常に重要な課題と感じたのが、今回の投稿の動機です。

シスコでは2020年にクラウドサービスの稼働状況をリアルタイムに可視化できるマルチレイヤ監視ソリューション「ThousandEyes」を買収しており、ThousandEyesを活用することでZoomの可視化はできそうです。

一方でZoomはどこを監視すればいいのでしょう?
ネットワーク界隈ではZoomはアプリケーション可視化が難しいアプリケーションとされています。その理由はZoomのインフラの使い方にあります。
Zoomは元々自前のデータセンターでオンプレで運用されていたと言われています。しかしコロナ禍以降は、下記の通り、Oracle Cloud, AWS, Azureが併用されていると言われています。これはIPアドレスだけ見てもOracle, AWS, Azureのものとしかわからないことを示しています。また、混雑時にはビデオ会議の都度ダイナミックにこれらのインスタンスから必要なリソースが払い出されている、とも言われています。
Zoom、ユーザー急増への対応でOracle Cloudへインフラを拡張 AWS、Azureと併用
ビデオ会議ツールZoom、利用急拡大への対応で「Oracle Cloud」採用

なので、今回はまずZoomが実際にどんなトラフィックを出しているか確認し、監視点になり得る場所があるのか、調査し、次に実際にThousand Eyesで可視化していきたいと思います。

1.ElastiFlowでNetFlowを解析する

1-1. ElastiFlow docker-compose.yamlの用意

今回はIOS-XEが稼働するルータからNetFlowを取得して、NetFlowコレクターで解析することで、Zoomがどのようなトラフィックを出しているのか調べてみたいと思います。
NetFlowコレクターはなるべく手軽に立てたかった & 手持ち機材の都合上、今回はElastiFlow (Elasticsearch,Kibana,LogstashのいわゆるELKスタック)で構成してみたいと思います。
この分野ではOSSでNetFlowを解析しよう!ElastiFlowの記事が非常にまとまって参考にさせていただきました。今回はさらに気軽に始めたかったので、コンテナベースで何かできないか探したところGithubによい情報がありました。

「This legacy version of ElastiFlow™ is now deprecated.」とあり、こちらに移行して開発が進んでいるようです。ざっと調べたところ新しいものはELKスタック全てを一発でインストール出来そうなdocker-compose.yamlは置いていないので、今回は旧版で行きたいと思います。

Githubのマニュアルを見つつ、docker-compose.yamlをコピー、永続ストレージのディレクトリのelastiflow_esを作成。のちにNetFlowでアプリケーションIDを引っ張ってくる関係で、アプリケーションIDとアプリケーション名の定義が書いてあるGitHubのlogstash/elastiflow フォルダをコピーして、こちらも永続ストレージとしてアタッチします。(永続ストレージのアタッチ先やディレクトリの権限付与、Linuxホスト側の各種設定(SELINUXとか)はお忘れなきよう。)
好みですが、IPアドレスをDNSに変換してくれた方が楽なのでそのように設定変更。

主な変更点
elastiflow-logstash:
~snip~~
volumes:
- ./logstash/elastiflow:/etc/logstash/elastiflow
~snip~~
environment:
ELASTIFLOW_RESOLVE_IP2HOST: 'endpoints'

最終的なdocker-compose.yamlの例はこちら

#------------------------------------------------------------------------------
# Portions of this file are Copyright (C)2020 Robert Cowart
#
# Portions of this file are subject to the Robert Cowart Public License (the
# "License") and may not be used or distributed except in compliance with the
# License. You may obtain a copy of the License at:
#
# http://www.koiossian.com/public/robert_cowart_public_license.txt
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License.
#
# The Original Source Code was developed by Robert Cowart. Portions created by
# Robert Cowart are Copyright (C)2020 Robert Cowart. All Rights Reserved.
#------------------------------------------------------------------------------

version: '3'

services:
  elastiflow-elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.8.1
    container_name: elastiflow-elasticsearch
    restart: 'no'
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 131072
        hard: 131072
      nproc: 8192
      fsize: -1
    network_mode: host
    volumes:
      # You will need to create the path and permissions on the local file system where Elasticsearch will store data.
      # For example...
      #   mkdir /var/lib/elastiflow_es && chown -R 1000:1000 /var/lib/elastiflow_es
      - ./elastiflow_es:/usr/share/elasticsearch/data
    environment:
      # JVM Heap size
      #   - this should be at least 2GB for simple testing, receiving only a few flows per second.
      #   - for production environments upto 31GB is recommended.
      ES_JAVA_OPTS: '-Xms4g -Xmx4g'

      cluster.name: elastiflow

      bootstrap.memory_lock: 'true'

      network.host: 0.0.0.0
      http.port: 9200
      discovery.type: 'single-node'

      indices.query.bool.max_clause_count: 8192
      search.max_buckets: 250000

      action.destructive_requires_name: 'true'

  elastiflow-kibana:
    image: docker.elastic.co/kibana/kibana:7.8.1
    container_name: elastiflow-kibana
    restart: 'no'
    depends_on:
      - elastiflow-elasticsearch
    network_mode: host
    environment:
      SERVER_HOST: 0.0.0.0
      SERVER_PORT: 5601
      SERVER_MAXPAYLOADBYTES: 8388608

      ELASTICSEARCH_HOSTS: "http://127.0.0.1:9200"
      ELASTICSEARCH_REQUESTTIMEOUT: 132000
      ELASTICSEARCH_SHARDTIMEOUT: 120000

      KIBANA_DEFAULTAPPID: "dashboard/653cf1e0-2fd2-11e7-99ed-49759aed30f5"
      KIBANA_AUTOCOMPLETETIMEOUT: 3000
      KIBANA_AUTOCOMPLETETERMINATEAFTER: 2500000

      LOGGING_DEST: stdout
      LOGGING_QUIET: 'false'

  elastiflow-logstash:
    image: robcowart/elastiflow-logstash:4.0.1
    container_name: elastiflow-logstash
    restart: 'no'
    depends_on:
      - elastiflow-elasticsearch
    network_mode: host
    volumes:
      - ./logstash/elastiflow:/etc/logstash/elastiflow
    environment:
      # JVM Heap size - this MUST be at least 3GB (4GB preferred)
      LS_JAVA_OPTS: '-Xms4g -Xmx4g'

      # ElastiFlow global configuration
      ELASTIFLOW_AGENT_ID: elastiflow
      ELASTIFLOW_GEOIP_CACHE_SIZE: 16384
      ELASTIFLOW_GEOIP_LOOKUP: 'true'
      ELASTIFLOW_ASN_LOOKUP: 'true'
      ELASTIFLOW_OUI_LOOKUP: 'false'
      ELASTIFLOW_POPULATE_LOGS: 'true'
      ELASTIFLOW_KEEP_ORIG_DATA: 'true'
      ELASTIFLOW_DEFAULT_APPID_SRCTYPE: '__UNKNOWN'

      # Name resolution option
      ELASTIFLOW_RESOLVE_IP2HOST: 'endpoints'
      ELASTIFLOW_NAMESERVER: '127.0.0.1'
      ELASTIFLOW_DNS_HIT_CACHE_SIZE: 25000
      ELASTIFLOW_DNS_HIT_CACHE_TTL: 900
      ELASTIFLOW_DNS_FAILED_CACHE_SIZE: 75000
      ELASTIFLOW_DNS_FAILED_CACHE_TTL: 3600

      ELASTIFLOW_ES_HOST: '127.0.0.1:9200'
      #ELASTIFLOW_ES_USER: 'elastic'
      #ELASTIFLOW_ES_PASSWD: 'changeme'

      ELASTIFLOW_NETFLOW_IPV4_PORT: 2055
      ELASTIFLOW_NETFLOW_UDP_WORKERS: 2
      ELASTIFLOW_NETFLOW_UDP_QUEUE_SIZE: 4096
      ELASTIFLOW_NETFLOW_UDP_RCV_BUFF: 33554432

      ELASTIFLOW_SFLOW_IPV4_PORT: 6343
      ELASTIFLOW_SFLOW_UDP_WORKERS: 2
      ELASTIFLOW_SFLOW_UDP_QUEUE_SIZE: 4096
      ELASTIFLOW_SFLOW_UDP_RCV_BUFF: 33554432

      ELASTIFLOW_IPFIX_UDP_IPV4_PORT: 4739
      ELASTIFLOW_IPFIX_UDP_WORKERS: 2
      ELASTIFLOW_IPFIX_UDP_QUEUE_SIZE: 4096
      ELASTIFLOW_IPFIX_UDP_RCV_BUFF: 33554432

1-2. ElastiFlowでNBAR2を使うための設定

先ほどコピーしておいたlogstash/elastiflow フォルダの中の logstash/elastiflow/user_settings/app_id.srctype.yml に NBAR2を利用するNetFlow Exporter のIPアドレスと、"cisco_nbar2"を利用するよう書き換えましょう。

# vim logstash/elastiflow/user_settings/app_id.srctype.yml

#------------------------------------------------------------------------------
# Copyright (C)2020 Robert Cowart
#
# The contents of this file and/or repository are subject to the Robert Cowart
# Public License (the "License") and may not be used or distributed except in
# compliance with the License. You may obtain a copy of the License at:
#
# http://www.koiossian.com/public/robert_cowart_public_license.txt
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License.
#
# The Original Source Code was developed by Robert Cowart. Portions created by
# Robert Cowart are Copyright (C)2020 Robert Cowart. All Rights Reserved.
#------------------------------------------------------------------------------

# You must specify the application_id source type for your devices below. This
# value is used by the pipeline to specify which dictionary to use for
# translating the application_id to a user-friendly description.

# These first two entries are examples. But they also ensure the pipeline loads without errors when no other devices are specified.
# DO NOT DELETE these two entries unless you have added your own entries.
"[YOUR NETFLOW EXPORTER IP ADDRESS]": "cisco_nbar2" ## <-- IPアドレスを追加
"192.0.2.2": "fortinet"
"192.0.2.3": "velocloud"

1-3. ElastiFlow の立ち上げ

当方の環境は Rocky Linux 8.5 (CentOS Projectの共同設立者のGregory Kurtzer氏が立ち上げたコミュニティで開発している無償のRHEL(Red Hat Enterprise Linux)クローン)を利用しています。また Docker ではなく ディストリビューションに標準インストールされている Podman を利用します。
ElastiFlowからネットワーク機器のIPアドレスを正しく認識してほしかったので、RootlessがウリなPodmanではありますが Rootfull で起動します。

1-3-1. Podman事前設定

1-3-2. ElastiFlowの起動

docker-compose.yaml のあるフォルダで下記を実行
# /usr/local/bin/podman-compose up -d

1-3-3. 利用ポートの解放 (Kibana と NetFlow (IPFIX))

# firewall-cmd --add-port=5601/tcp --permanent
# firewall-cmd --add-port=4739/udp --permanent
# firewall-cmd --reload

1-3-4. Kibanaの設定

http://[host IP address]:5601 から Kibanaにアクセス。
Stack management -> Kibana -> Saved Objects からGithub にあるテンプレート(elastiflow.kibana.7.8.x.ndjson) をインポート。
Screen Shot 2021-11-30 at 20.01.36.png

GithubのElastiFlow™ Installationにはパフォーマンスチューニングやパラメータ設定、データリテンションなどの情報があるので参考にしてください。

2. IOS-XEルータの設定

IOS-XEルータからはNetFlow v5でもv9でも良いのですが、IPFIX形式でNetflowを出力してもらうことにしました。IPFIXならフォーマットが決まっているので、特段ElastiFlow定義しなくても認識してくれる、はず。

# flow の定義
# Source/DestのIP+port+カウンタに加えて、NBAR2で認識するApplication Name情報を取得し、ipfix形式で出力
flow record RECORDv4
 match ipv4 tos
 match ipv4 protocol
 match ipv4 source address
 match ipv4 destination address
 match transport source-port
 match transport destination-port
 match application name
 collect counter bytes long
 collect counter packets long
flow exporter EXPORTER-1
 destination [YOUR ElastiFlow IP address]
 transport udp 4739
 export-protocol ipfix
flow monitor FLOW-MONITOR-1
 exporter EXPORTER-1
 record RECORDv4

# 定義した netflow 設定をインターフェースに設定
# 今回はunicastだけで良いので unicastを指定
interface VlanX
 description ### for client devices vlan ###
 ip flow monitor FLOW-MONITOR-1 unicast input
 ip flow monitor FLOW-MONITOR-1 unicast output

ルータ上のIPFIXのキャッシュ情報を確認

#show flow monitor FLOW-MONITOR-1 cache
  Cache type:                               Normal (Platform cache)
  Cache size:                                32768
  Current entries:                             170
  High Watermark:                             2301

  Flows added:                              245815
  Flows aged:                               245645
    - Active timeout      (  1800 secs)        141
    - Inactive timeout    (    15 secs)     245504

IPV4 SOURCE ADDRESS:       192.168.10.39
IPV4 DESTINATION ADDRESS:  219.100.37.51
TRNS SOURCE PORT:          51188
TRNS DESTINATION PORT:     443
IP TOS:                    0x00
IP PROTOCOL:               6
APPLICATION NAME:          layer7 unknown
counter bytes long:        240
counter packets long:      5

IPV4 SOURCE ADDRESS:       192.168.10.7
IPV4 DESTINATION ADDRESS:  54.215.23.174
TRNS SOURCE PORT:          41718
TRNS DESTINATION PORT:     443
IP TOS:                    0x00
IP PROTOCOL:               6
APPLICATION NAME:          layer7 ssl
counter bytes long:        9654
counter packets long:      137

キャッシュ情報が出てきたので、大丈夫そうですね

Kibanaに戻って見ると、情報が出てきました

Top-N, Theats, Flows, ASなどの観点で分析できます。見ているだけで楽しいですね。
Screen Shot 2021-12-01 at 15.21.17.png

最初からあるダッシュボードのうち、ElastiFlow: Traffic Details (types)が希望に近いのですが、NBAR2で取得したアプリケーション名でソートできないのでフィルタ項目に "netwrok.application"を追加します。
Screen Shot 2021-11-30 at 23.17.06.png

Application名でFlowをソートアウトできるようになりました。

Screen Shot 2021-11-30 at 23.17.41.png

ZoomやWebEx、Youtubeなどの大多数のアプリケーション名はきちんと表示されていますが、applicationId -> アプリケーション名の変換が足りていないところは、NBAR2 Protocol Pack Libraryを参考にアプリケーション名変換テーブルであるlogstash/elastiflow/dictionaries/app_id.yml を書き換えると幸せになります。

Zoomでフィルタリングすると出てきました。
Screen Shot 2021-12-01 at 9.52.26.png

いくつかのZoom callを持って調べていましたが、どうやらいくつか傾向がありそうです。
- 企業契約のZoomの場合、リアルタイム系と思われる 8801/udp は 複数のcallで共通のAWS EC2のノードが使われていた。都度別のインスタンスがアサインされるのではなく、固定されるようだ。
- 別企業契約のZoomになると、call 先が Zoom自前DCと思われるIPアドレスが使われている。
- 個人のフリー契約のZoomだと、Zoom自前DCと思われるIPアドレスも使われている。

このようにインスタンスごと(もしかするとcallごとに?)通信先が変わってきていて、これがZoomが難しいと言われる所以ですね。分析の確らしさは今後も継続的にチェックが必要ですが、今回は、前者の8801/udpが飛んでいくEC2のアドレスをまずは監視してみようと思います。

3. ThousandEyes agent のインストール

ThousandEyesでSaaSを監視するには、一番の方法はEnterpriseエージェントと呼ばれる監視エージェントをインストールすることです。
元来Virtual Appliance (OVA/OVF, Hyper-V, VirtualBox, IntelNUC, Raspberry Pi4)、Linux用パッケージ、Dockerなどのインストール方法があります。
Enterprise エージェント インストール ガイド (Intel NUC編 2021)
ThousandEyes documentation Enterprise agent

またCiscoのネットワーク機器にdocker形式でEnterprise agentをインストールすることも可能になりました。
- IOS-XE 17.3.3 - Catalyst 9300/Catalyst 9300L
- IOS-XE 17.5.1 - Catalyst 9400
- IOS-XE 17.6.1 - ISR4000シリーズ、Catalyst 8300/8200/8200L
- Cisco Nexus 9300 or 9500 series switch running NXOS version 9.3.(7a) or higher, DCNM version 11.5.3 or higher (for switches managed via DCNM).
最新のサポートプラットフォームの情報はThousandEyes Documentationをご参照ください。

各プラットフォームごとのインストレーションガイドはこちら
Installing Enterprise Agents on Cisco Catalyst 9000 Series Switches
Installing Enterprise Agents on Cisco Routers
Installing Enterprise Agents on Cisco Nexus 9000 Series Switches

(参考)ISR4000シリーズでの System Requirements

ThousandEyes のコンテナを利用するためのシステム要件です。BootflashやDRAMのアップグレードが必要なので注意してください。

Platforms Bootflash FRU storage DRAM
ISR446x 8GB NIM-SSD (external) 8GB/ 16 GB / 32GB
ISR4451 8GB NIM-SSD (external) 8GB/ 16 GB
ISR4351/31 16GB NIM-SSD (external) 8GB/ 16 GB
ISR4321 8GB NIM-SSD (external) 8G
ISR4221X 8GB NIM-SSD (external) 8G

CiscoのIOS-XEネットワーク製品はデータプレーン転送とコンテナを実行するCPUコアが異なっているので、コンテナ利用による性能低下はないので安心してご利用ください。(4300シリーズではBOOSTライセンス使用時にコンテナ機能が使えなくなるので注意が必要です)
今回はISR4321にインストールしていきたいと思います。インストレーションガイドを参考に設置していきます。

#先週リリースされたばかりの IOS-XE 17.6.2の Autonomous mode (非SD-WAN)を使っていきます
Router#sh version
Cisco IOS XE Software, Version 17.06.02
Cisco IOS Software [Bengaluru], ISR Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.6.2, RELEASE SOFTWARE (fc7)

#Dockerで使うVirtualPortGroupの設定
Router(config)interface VirtualPortGroup0
Router(config)ip address 10.100.152.100 255.255.255.0
Router(config)ip nat inside

#Internetに抜けるネットワークにNATの設定
Router(config)interface GigabitEthernet0/0/0
Router(config) ip nat outside
Router(config) ip nat inside source list NAT interface GigabitEthernet0/0/0 overload
Router(config) ip access-list extended NAT
Router(config) 10 permit ip 10.100.152.0 0.0.0.255 any

#コンテナを利用するためにioxを設定
Router(config)#iox

#IOXが立ち上がっていることを確認
Router#show iox-service

IOx Infrastructure Summary:
---------------------------
IOx service (CAF)              : Running
IOx service (HA)               : Not Supported
IOx service (IOxman)           : Running
IOx service (Sec storage)      : Not Supported
Libvirtd 5.5.0                 : Running

#ガイドの通りWebからパッケージを落としてきても良いのですが、https証明書をインストールしないと進まないので、ローカルで落としてコピーします。
Router#copy ftp://[ID:PASSWORD]@[FTP server IP address]/thousandeyes-enterprise-agent-4.0.2.cisco.tar flash:
Destination filename [thousandeyes-enterprise-agent-4.0.2.cisco.tar]?
Accessing ftp://*:*@[FTP server IP address]/thousandeyes-enterprise-agent-4.0.2.cisco.tar...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 212244480/4096 bytes]

212244480 bytes copied in 173.714 secs (1221804 bytes/sec)

#MD5でファイル転送が成功したか確認
Router#verify /md5 flash:thousandeyes-enterprise-agent-4.0.2.cisco.tar
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Done!
verify /md5 (bootflash:thousandeyes-enterprise-agent-4.0.2.cisco.tar) = 595513485b256c5e0fba4cec1b69e0b3

#dockerイメージをルータにインストール
#appIDには[0-9a-zA-Z_]の文字しか使えないので注意
Router#app-hosting install appid isr4321te package flash:thousandeyes-enterprise-agent-4.0.2.cisco.tar
Installing package 'bootflash:thousandeyes-enterprise-agent-4.0.2.cisco.tar' for 'te_docker'. Use 'show app-hosting list' for progress.
*Dec  1 02:11:26.945: %IM-6-INSTALL_MSG: R0/0: ioxman: app-hosting: Install succeeded: isr4321te installed successfully Current state is DEPLOYED

#showコマンドでインストールされていること確認
Router#show app-hosting list
App id                                   State
---------------------------------------------------------
isr4321te                                DEPLOYED

dockerに与えるパラメーターを設定していきます

#dockerコンテナに固定IP、デフォルトゲートウェイ、DNSの設定、dockerに渡すパラメター(TEで利用するtoken、TEagentの名前)
Router(config)#
app-hosting appid isr4321te
 app-vnic gateway0 virtualportgroup 0 guest-interface 0
  guest-ipaddress 10.100.152.120 netmask 255.255.255.0
 app-default-gateway 10.100.152.100 guest-interface 0
 app-resource docker
  prepend-pkg-opts
  run-opts 1 "-e TEAGENT_ACCOUNT_TOKEN=YOUR_THOUSANDSEYES_TOKEN_IS_HERE"
  run-opts 2 --hostname=isr4321te
 name-server0 208.67.222.222
 name-server1 208.67.202.202

#dockerイメージのactivate
Router#app-hosting activate appid isr4321te
isr4321te activated successfully
Current state is: ACTIVATED

#dockerイメージのstart
Router#app-hosting start appid isr4321te
isr4321te started successfully
Current state is: RUNNING

#ThousandEyes agentが起動しました
Router#show app-hosting list
App id                                   State
---------------------------------------------------------
isr4321te                                RUNNING

Thousand Eyes のポータルでも、ISRにインストールしたエージェントが認識されました
Screen Shot 2021-12-01 at 14.19.45.png

ISR4321/K9 Cisco Application Hosting となっています。
Screen Shot 2021-12-01 at 14.19.55.png

4. Thousand Eyes の監視設定

ではThousand Eyes の監視設定を入れていきましょう。
Thousand Eyes > Cloud & Enterprise Agent > Test Settings > Add New test で新しいテスト項目を作成します。
Network Test, Agent to Server を選択し、Target (監視先) は先ほどのElastiFlowで見つけたIPアドレス/FQDNを、ProtocolでUDPが選択できないので今回はTCP 80で設定しました。
Screen Shot 2021-12-01 at 14.29.05.png

監視対象に先ほどインストールしたエージェントを選択します
Screen Shot 2021-12-01 at 14.29.20.png

しばらくするとCloud & Enterprise Agent > Views からテスト結果が確認できるようになります。
Latency, Jitter, Packet loss, Path (Traceroute)のデータが得られます。
Screen Shot 2021-12-01 at 14.38.57.png

テストはテスト設定に基づき、標準では2分に1回実行されます。このテストを常にWebGUIで見ているわけにはいかないので、時系列の変化をレポートで見ていきましょう。
Thousand Eyes > Reports から Add new widget、Line を選択します。
Screen Shot 2021-12-01 at 14.47.34.png

レポート用のパラメーターを設定していきます。
データソースとして、 Cloud&Enterprise Agents を、Categoryは先ほどのテスト内容の Network - Agent to Server、メトリックはLatency、Measurementは中間値のMedianを今回は選んでいきます。
Screen Shot 2021-12-01 at 14.45.53.png

このようなグラフが生成されました。
Screen Shot 2021-12-01 at 14.46.03.png

また監視内容が一定の閾値を超過した場合はAlartを設定することもできます。
Thousand Eyes > Alerts > Alert Rules > Add New Alert Rule から、たとえばJitterが100msを超えた場合など、条件を超えた場合、Email、Webhook、SlackなどにAlartを飛ばすことができます。
Screen Shot 2021-12-01 at 14.50.19.png

これでZoomが遅いとクレームを家族から受ける前に気づけるはず。
(監視点がこれで良いのかは継続的な確認が必要ですね。。)

まとめ

今回はCiscoの各ソリューションを利用して、Thousand Eyes のエージェントのインストール、クラウドアプリケーションの監視までの設定例をご紹介しました。
皆様も良いネットワークライフを!

免責事項

本サイトおよび対応するコメントにおいて表明される意見は、投稿者本人の個人的意見であり、シスコの意見ではありません。本サイトの内容は、情報の提供のみを目的として掲載されており、シスコや他の関係者による推奨や表明を目的としたものではありません。各利用者は、本Webサイトへの掲載により、投稿、リンクその他の方法でアップロードした全ての情報の内容に対して全責任を負い、本Web サイトの利用に関するあらゆる責任からシスコを免責することに同意したものとします。

16
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
4