diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-19 03:24:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-04-19 03:24:59 +0000 |
commit | fb609850970d4d9596ade5368f169efc2f530261 (patch) | |
tree | 041417f57fc9958e43b1385573c2d5d709b0630e /resources/metric | |
parent | 50187dfd2c619b25a907a1ad1f66a16021c32bba (diff) | |
parent | cb66bce8bbc5a32bbc219cca4a0f3b3027f6fa70 (diff) |
Merge "Add nDPI tasks"
Diffstat (limited to 'resources/metric')
-rw-r--r-- | resources/metric/nDPI.yaml | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/resources/metric/nDPI.yaml b/resources/metric/nDPI.yaml new file mode 100644 index 00000000..c73d367f --- /dev/null +++ b/resources/metric/nDPI.yaml @@ -0,0 +1,76 @@ +############################################################################## +# Copyright (c) 2017 ZTE Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + + +- name: prepare sample pcap file + get_url: + url: "https://build.opnfv.org/artifacts.opnfv.org/qtip/utilities/test.pcap" + dest: "{{ qtip_dump }}/localhost/{{ nDPI_file }}" + validate_certs: no # required when using proxy for https + run_once: yes + delegate_to: localhost + +- name: installing nDPI dependencies if CentOS + yum: + name: '{{ item }}' + state: present + when: ansible_os_family == "RedHat" + with_items: + - git + - gcc + - patch + - perl-Time-HiRes + - autofconf + - automake + - libpcap-devel libtool + +- name: installing nDPI dependencies if Ubuntu + apt: + name: build-essential + state: present + when: ansible_os_family == "Debian" + +- name: making nDPI temporary directory + file: + path: "{{ nDPI_cwd }}" + state: directory + +- name: clone nDPI + git: + repo: https://github.com/ntop/nDPI.git + dest: "{{ nDPI_cwd }}" + depth: 1 + +- name: build nDPI library + command: '{{ item }}' + with_items: + - ./autogen.sh + - ./configure + - make + args: + chdir: "{{ nDPI_cwd }}" + +- name: copy sample packet file + copy: + src: "{{ qtip_dump }}/localhost/{{ nDPI_file }}" + dest: "{{ nDPI_cwd }}/example/{{ nDPI_file }}" + +- name: + command: "./ndpiReader -i {{ nDPI_file }}" + args: + chdir: "{{ nDPI_cwd }}/example/" + register: nDPI_out + +- name: collect DPI metrics from nDPI + collect: + string: "{{ nDPI_out.stdout }}" + patterns: + - '^\s+nDPI throughput:.+?(?P<pps>\d+.\d+)\s.+\spps.+?(?P<bps>\d+.\d+)\s.+\/sec' + dump: 'nDPI.log' + register: dpi_metrics |