Giter VIP home page Giter VIP logo

mdt-dialout-collector's Introduction

Build status

Table of Content

Introduction

mdt-dialout-collector & gRPC dial-out libraries are leveraging the gRPC Framework to implement a multi-vendor gRPC Dial-out collector. The doc/Changelog file is including additional details about the supported network devices.

The collector functionalities can be logically grouped into three categories:

  1. Data Collection - they are steering the daemon(s) behavior.
  2. Data Manipulation - they are conveniently transforming the in-transit data-stream.
  3. Data Delivery - they are inter-connecting the collector with the next stage in the pipeline.

The doc/CONFIG-KEYS file is including the description for each one of the available options.

Deployment options

The gRPC dial-out data-collection functionality can be deployed in two ways:

Standalone binary with mdt-dialout-collector

              +------------------------------------------------------+
+---------+   | +------------+   +--------------+   +--------------+ |   +---------+
| network |-->| | collection |-->| manipulation |-->| kafka client | |-->| kafka   |
+---------+   | +------------+   +--------------+   +--------------+ |   | cluster |
              |              [mdt-dialout-collector]                 |   +---------+
              +------------------------------------------------------+

the building process is generating a single binary:

/opt/mdt-dialout-collector/bin/mdt_dialout_collector

which, by default, is reading the running options from:

/etc/opt/mdt-dialout-collector/mdt_dialout_collector.conf

Additionally, the default configuration file can be further specified via the following command line:

/opt/mdt-dialout-collector/bin/mdt_dialout_collector -f <file.conf>

Library/Header integration with pmtelemetryd

              +---------------------------------------------------------+
+---------+   | +------------+   +--------------+   +-----------------+ |   +------------+
| network |-->| | collection |-->| manipulation |-->| ZMQ (PUSH/PULL) | |-->| pipeline   |
+---------+   | +------------+   +--------------+   +-----------------+ |   | next stage |
              |                    [pmtelemetryd]                       |   +------------+
              +---------------------------------------------------------+

the building process is generating both the library and the header file required to build pmtelemetryd with gRPC dial-out support:

/usr/local/lib/libgrpc_collector.la

/usr/local/include/grpc_collector_bridge/grpc_collector_bridge.h

there is one main pmtelemetryd CONFIG-KEYS which is mandatory in order to enable the embedded gRPC dial-out collector:

KEY:     telemetry_daemon_grpc_collector_conf
DESC:    Points to a file containing the configuration of the gRPC collector thread. An
         example of the configuration plus all available config keys is available here:
         https://github.com/network-analytics/mdt-dialout-collector
DEFAULT: none

Build/Install

install.sh is automating the build/install process, taking care of all dependencies.

  • The Standalone binary can be deployed using:
sudo /bin/sh -c "$(curl -fsSL https://github.com/network-analytics/mdt-dialout-collector/raw/main/install.sh)" -- -b -v current
  • The Library/Header can be deployed using:
sudo /bin/sh -c "$(curl -fsSL https://github.com/network-analytics/mdt-dialout-collector/raw/main/install.sh)" -- -l -v current

References

mdt-dialout-collector's People

Contributors

ahassany avatar scuzzilla avatar scuzzilla-swisscom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdt-dialout-collector's Issues

serialization: json not json_string

I have been trying out this tool, looks very promissing..

there one thing though, is there a way I can make it serialize it into a json blob and not a json string where it escapes all the double quotes?

My use case is that I feed this into Kafka, and then ingest it into my ClickHouse database directly using a Kafka-Engine and then a materialized view and JSONEachRow which makes it easy for me to pick the objects I want and insert it into my table.

It sorta complicates things a bit if its not a "true" json object, but a string instead.. Can I turn change the behavior somewhere?

Esben

Geeting an error while running make for mdt-dialout-collector

Ability to disable SSL verification for Kafka connection

In our lab environment, the certificate being used by Kafka is not always a valid one (either self-signed or the CN/SAN does not match the hostname). Kafka has a property that can be set, "enable.ssl.certificate.verification" but this is not available to the gRPC Kafka configuration. We are looking for something like the following for the pmtelemetryd-grpc-dialout.conf

## Kafka configuration ###
bootstrap_servers = "jedha-kafka-kafka-mtlsext-0.kafka.svc:9096,jedha-kafka-kafka-mtlsext-1.kafka.svc:9096,jedha-kafka-kafka-mtlsext-2.kafka.svc:9096";
topic = "matterhorn.ietf.grpc-raw";
enable_idempotence = "true";
client_id = "mdt-dialout-collector";
# valid options are either plaintext or ssl
security_protocol = "ssl";
ssl_key_location = "/etc/pmacct/ssl/kafka.key";
ssl_certificate_location = "/etc/pmacct/ssl/kafka.crt";
ssl_ca_location = "/etc/pmacct/ssl/ca.crt";
enable_ssl_certificate_verification = "false";  <---- New Kafka config property

Thanks,
Sean

install.sh vcpu count has issues in Kubernetes/OpenShift

When running the install.sh script, it determines the number of vCPUs by the following line:

readonly available_vcpu=$(egrep 'processor' /proc/cpuinfo | wc -l)

Later in the script, the value is used to determine the number of jobs to run for the 'make' command:

make -j`echo $((${available_vcpu} - 1))`

When running in Kubernetes/OpenShift, "egrep 'processor' /proc/cpuinfo | wc -l" gives the total number of processors on the node running the build as /proc/cpuinfo is not scoped by cgroup. The result is that it runs with as many jobs as there are cores (in our case, 72) which blows the RAM usage through the roof.

I was able to fix this by changing the value to 2 manually in the Dockerfile but if this could be added as an argument to install.sh (or available to override via an env variable) that would allow the build to work more effectively in a k8s-based environment

Thanks,
Sean

Code: recommend to rename struct Payload to avoid namespace conflicts

In src/bridge/grpc_collector_bridge.h it is defined struct Payload. Such naming is very generic and, when used in 3rd party tools (ie. pmacct), it may be source of namespace conflicts. I would recommend to rename it to something more specific, ie. grpcPayload or something like that.

    typedef struct {
        char *event_type;
        char *serialization;
        char *writer_id;
        char *telemetry_node;
        char *telemetry_port;
        char *telemetry_data;
    } __attribute__ ((packed)) Payload;

Problem connecting to interface in container

We have already dealt with this after some conversations with Salvatore et al but we wanted to add a new issue to formally track it

When running pmtelemetryd with the mdt-dialout-collector library, the code cannot bind to a network interface defined by the 'iface' config key when the container is not running as root (which is a security requirement for our environment). Salvatore recommended trying to comment out the following code in src/core/mdt-dialout-core.cc:

    if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
        iface.c_str(), strlen(iface.c_str())) != 0) {
        spdlog::get("multi-logger")->
            error("[CustomSocketMutator()]: Unable to bind [{}] "
            "on the configured socket(s)", iface);
        std::abort();
    }

Removing this code worked and allowed the daemon to start up without any issues.

Could the 'iface' config key be made optional (or ignored) when deploying this into a container on Kubernetes/OpenShift? This would probably require a start arg or config key to identify when deploying in a container as well

Thanks,
Sean

docs: configuration example

The supplied example configuration is quite involved, probably to showcase all existing config directives, but it's probably not immediately applicable in a simple setup arranged for a proof-of-concept. I recommend to move the list of all config keys in a separate doc and provide a simpler example (or a few of them of increasing complexity). Maybe starting with:

writer_id = "mdt-dout-collector-01";
client_id = "mdt-dialout-collector";

iface = "eth0";

ipv4_socket_cisco = "0.0.0.0:10007";
ipv4_socket_huawei = "0.0.0.0:10008";
ipv4_socket_juniper = "0.0.0.0:10009";

replies_cisco = "10";
replies_juniper = "100";
replies_huawei = "1000";

cisco_workers = "1";
juniper_workers = "1";
huawei_workers = "1";

console_log = "true";
spdlog_level = "debug";
log_level = "0";

bootstrap_servers = "localhost:9093";
topic = "json.topic";
security_protocol = "plaintext";
enable_idempotence = "true";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.