All Projects → nileshsimaria → jtimon

nileshsimaria / jtimon

Licence: MIT license
Junos Telemetry Interface client

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to jtimon

cpp client telemetry
1DS C++ SDK
Stars: ✭ 62 (-19.48%)
Mutual labels:  telemetry-collection
ixgen
Ixgen is yet-another open-source, multi-platform generator for peering configurations on IXs incorporating the global peeringdb api, but also is able to spin up its own "compatible" server for faster results. Ixgen is configured by an INI- or JSON-style format, producing custom template-driven or fixed json-style configurations, that can be prin…
Stars: ✭ 38 (-50.65%)
Mutual labels:  junos
vrnetlab
Run virtual routers with docker
Stars: ✭ 879 (+1041.56%)
Mutual labels:  junos
mlxsh
mlxsh is the missing, fast power command-line and shell that enables you to enter configuration changes or run commands simultaneously to groups of Brocade or Extreme Networks Netiron devices (MLX, CER, MLXE, XMR, ICX, Ironware), SLX-Devices or Juniper switches via Secure Shell (ssh).
Stars: ✭ 22 (-71.43%)
Mutual labels:  junos
junos-automation-with-ansible
How to automate Junos with Ansible. This project has many ready-to-use Ansible playbooks to interact with Junos devices.
Stars: ✭ 69 (-10.39%)
Mutual labels:  junos
toptout
📡 Easily opt-out from telemetry collection
Stars: ✭ 89 (+15.58%)
Mutual labels:  telemetry-collection
WeConnect-python
Python API for the Volkswagen WeConnect Services
Stars: ✭ 27 (-64.94%)
Mutual labels:  telemetry-collection

Build Status

jtimon

Junos Telemetry Interface client

Setup

$ git clone https://github.com/nileshsimaria/jtimon.git
$ cd jtimon
$ make linux or make darwin
$ ./jtimon-linux-amd64 --help or jtimon-darwin-amd64 --help

Please note that if you use make to build source, it will produce binary with GOOS and GOARCH names e.g. jtimon-darwin-amd64, jtimon-linux-amd64 etc. Building the source using make is recommended as it will insert git-revision, build-time info in the binary.

To understand what targets are available in make, run the make help command as follows:

$ make help

Note

If you are cloning the source and building it, please make sure you have environment variable GOPATH is set correctly. https://golang.org/doc/code.html#GOPATH

Docker container

Alternatively to building jtimon native, one can build a jtimon Docker container and run it dockerized while passing the local directory to the container to access the json file.

To build the container:

make docker

Check the resulting image:

$ docker images jtimon
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
jtimon              latest              f1a794609339        7 minutes ago       24.5MB

Run it:

docker run -ti --rm -v ${PWD}:/u:ro jtimon --help

Or simply by calling ./jtimon, which is a symlink to launch-docker-container.sh, capable of launching the container by name with the current directory mounted into /u:

$ ./jtimon
Enter config file name: bla.json
2018/03/02 13:53:44 File error: open bla.json: no such file or directory

CLI Options

$ ./jtimon-linux-amd64 --help
Usage of ./jtimon-linux-amd64:
      --compression string         Enable HTTP/2 compression (gzip)
      --config strings             Config file name(s)
      --config-file-list string    List of Config files
      --consume-test-data          Consume test data
      --explore-config             Explore full config of JTIMON and exit
      --generate-test-data         Generate test data
      --json                       Convert telemetry packet into JSON
      --log-mux-stdout             All logs to stdout
      --max-run int                Max run time in seconds
      --no-per-packet-goroutines   Spawn per packet go routines
      --pprof                      Profile JTIMON
      --pprof-port int32           Profile port (default 6060)
      --prefix-check               Report missing __prefix__ in telemetry packet
      --print                      Print Telemetry data
      --prometheus                 Stats for prometheus monitoring system
      --prometheus-host string     IP to bind Prometheus service to (default "127.0.0.1")
      --prometheus-port int32      Prometheus port (default 8090)
      --stats-handler              Use GRPC statshandler
      --version                    Print version and build-time of the binary and exit
pflag: help requested

Config

To explore what can go in config, please use --explore-config option.

Except connection details like host, port, etc no other part of the config is mandatory e.g. do not use influx in your config if you dont want to insert data into it.

$ ./jtimon-linux-amd64 --explore-config                                                                                                                                   [8/1981]
2021/10/02 17:15:22 Version: v2.3.0-7bfd8fdf2fcae1d55079e3d9eceb761be0842eae-master BuildTime 2021-10-02T19:51:16-0400
2021/10/02 17:15:22
{
    "port": 0,
    "host": "",
    "user": "",
    "password": "",
    "cid": "",
    "meta": false,
    "eos": false,
    "grpc": {
        "ws": 0
    },
    "tls": {
        "clientcrt": "",
        "clientkey": "",
        "ca": "",
        "servername": ""
    },
    "influx": {
        "server": "",
        "port": 0,
        "dbname": "",
        "user": "",
        "password": "",
        "recreate": false,
        "measurement": "",
        "batchsize": 0,
        "batchfrequency": 0,
        "http-timeout": 0,
        "retention-policy": "",
        "accumulator-frequency": 0,
        "write-per-measurement": false
    },
    "kafka": null,
    "paths": [
        {
            "path": "",
            "freq": 0,
            "mode": ""
        }
    ],
    "log": {
        "file": "",
        "periodic-stats": 0,
        "verbose": false
    },
    "vendor": {
        "name": "",
        "remove-namespace": false,
        "schema": null,
        "gnmi": null
    },
    "alias": "",
    "password-decoder": "",
    "enable-uint": false
}    

I am explaining some config options which are not self-explanatory.

meta : send username and password over gRPC meta instead of invoking LoginCheck() RPC for authentication. 
Please use SSL/TLS for security. For more details on how to use SSL/TLS, please refer wiki
https://github.com/nileshsimaria/jtimon/wiki/SSL
cid : client id. Junos expects unique client ids if multiple clients are subscribing to telemetry streams.
eos : end of sync. Tell Junos to send end of sync for on-change subscriptions.
grpc/ws : window size of grpc for slower clients

Kafka Publish

To publish gRPC/Openconfig JTI data to Kafka, use the following json config.

$ cat kafka-test-1.json
{
    "host": "2.2.2.2",
    "port": 32767,
    "user": "username",
    "password": "password",
    "cid": "cid123",
    "kafka": {
        "brokers": ["1.1.1.1:9094"],
        "topic": "test",
        "client-id": "testjtimonmx86"
    },

    "paths": [
        {
            "path": "/interfaces",
            "freq": 10000
        }
    ]
}

Below are all possible Kafka config options.

type KafkaConfig struct {
	Version            string   `json:"version"`
	Brokers            []string `json:"brokers"`
	ClientID           string   `json:"client-id"`
	Topic              string   `json:"topic"`
	CompressionCodec   int      `json:"compression-codec"`
	RequiredAcks       int      `json:"required-acks"`
	MaxRetry           int      `json:"max-retry"`
	MaxMessageBytes    int      `json:"max-message-bytes"`
	SASLUser           string   `json:"sasl-username"`
	SASLPass           string   `json:"sasl-password"`
	TLSCA              string   `json:"tls-ca"`
	TLSCert            string   `json:"tls-cert"`
	TLSKey             string   `json:"tls-key"`
	InsecureSkipVerify bool     `json:"insecure-skip-verify"`
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].