Junos Telemetry Interface client
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
authentication A CLI based Junos Telemetry Interface Client. Jun 9, 2017
multi-vendor/cisco/iosxr check fields before merging Dec 20, 2018
sample-config add tests Dec 22, 2018
telemetry Junos 172x, end-of-sync / sync_response support. Jul 25, 2017
tests add prometheus test Jan 5, 2019
vendor add influxdb test Jan 4, 2019
.gitignore add coverage profile Jan 4, 2019
.travis.yml add tests in travis Jan 4, 2019
Dockerfile jtimon is now using golang's dep so we no longer need to go "go get ..." Apr 22, 2018
Gopkg.lock add influxdb test Jan 4, 2019
Gopkg.toml add more tests Dec 27, 2018
LICENSE Create LICENSE Nov 28, 2017
Makefile add covermode=count Jan 7, 2019
README.md update readme Jan 5, 2019
alias.go rework on alias and add tests Jan 5, 2019
alias_test.go rework on alias and add tests Jan 5, 2019
config.go rework on alias and add tests Jan 5, 2019
config_test.go add sub-tests Dec 22, 2018
defaults.go move consts to a separate file Jan 4, 2019
grpc.go remove deflate and add test cases for gzip Jan 3, 2019
influx.go rework on alias and add tests Jan 5, 2019
influx_test.go add sub-tests Dec 22, 2018
jtimon_test.go add prometheus test Jan 5, 2019
launch-docker-container.sh use /bin/sh instead of bash Mar 2, 2018
logs.go remove dropchecks and latency checks Jan 3, 2019
main.go rework on alias and add tests Jan 5, 2019
multi_vendor.go cleanup Dec 22, 2018
prom.png prometheus Nov 15, 2018
prometheus_exporter.go code cleanup Sep 15, 2018
statshandler.go remove dropchecks and latency checks Jan 3, 2019
subscribe_cisco_iosxr.go tests for sighup and sigint Dec 29, 2018
subscribe_cisco_iosxr_test.go add ios-xr influx tests Jan 4, 2019
subscribe_juniper_junos.go add prometheus test Jan 5, 2019
subscribe_juniper_junos_test.go add prometheus test Jan 5, 2019
testutils.go add tests for testutils Jan 4, 2019
testutils_test.go add tests for testutils Jan 4, 2019
workers.go rework on alias and add tests Jan 5, 2019

README.md

Build Status

jtimon

Junos Telemetry Interface client

Setup

go get github.com/nileshsimaria/jtimon
$GOPATH/bin/jtimon --help

OR

git clone https://github.com/nileshsimaria/jtimon.git
cd jtimon
go build or make
./jtimon --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              3b7622e1464f        6 minutes ago       174MB

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-darwin-amd64 --help
Usage of ./jtimon-darwin-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-port int32      Prometheus port (default 8090)
      --stats-handler              Use GRPC statshandler
      --version                    Print version and build-time of the binary and exit

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-darwin-amd64 --explore-config
2019/01/04 18:21:08 Version: e0ce6eccd0a02cc346bcd4e5e038d19b6747d33b-master BuildTime 2019-01-04T18:18:55-0800
2019/01/04 18:21:08
{
    "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,
        "retention-policy": "",
        "accumulator-frequency": 0
    },
    "paths": [
        {
            "path": "",
            "freq": 0,
            "mode": ""
        }
    ],
    "log": {
        "file": "",
        "periodic-stats": 0,
        "verbose": false
    },
    "vendor": {
        "name": "",
        "remove-namespace": false,
        "schema": null
    },
    "alias": ""
}

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