Juniper / jtimon

Junos Telemetry Interface (JTI) client
Apache License 2.0
30 stars 10 forks source link

Unable to susbscibe to /junos/fpc-pg-timeout-information/ #41

Closed xp600 closed 2 months ago

xp600 commented 3 months ago

Hello, With jtimon_internal I am able to subscribe to this sensor: /junos/fpc-pg-timeout-information/

However I am unable to subscribe using jtimon_external.

Please help as the use case for Google calls for the sensor to be in the same json file as the others.

Error: ccl@wf-ccl-vmocst1:~/B2_2024$ ./jtimon_new --config test_r5.orig --print 2024/06/17 09:32:48 Version: v2.0.4-46fa0e4d61aceb7f96178d9d4bdb3abb8e2b34e4-ccl_issue BuildTime 2024-06-11T15:31:30-0700 2024/06/17 09:32:48 logging in for [2001:4860::192:168:0:5]:10162 [periodic stats every 0 seconds] 2024/06/17 09:32:48 logging in TelemetrySensorData.log for [2001:4860::192:168:0:5]:10162 [in the format of internal jtimon tool] 2024/06/17 09:32:48 logging in TelemetrySensorData.log_pre-gnmi for [2001:4860::192:168:0:5]:10162 [in the format of internal jtimon tool] Running config of JTIMON: { "port": 10162, "host": "[2001:4860::192:168:0:5]", "user": "csim", "password": "Juniper123", "cid": "r5_ocst_ee_22", "meta": false, "eos": true, "grpc": { "ws": 5242880, "tunnel-server": { "address": "", "dial-target": "", "dial-target-type": "", "tls": { "clientcrt": "", "clientkey": "", "ca": "", "servername": "", "insecure": false } } }, "tls": { "clientcrt": "/home/ccl/B2_2024/certs/client/client.crt", "clientkey": "/home/ccl/B2_2024/certs/client/client.key", "ca": "/home/ccl/B2_2024/certs/ca/ca.crt", "servername": "R6", "insecure": false }, "influx": { "server": "", "port": 0, "dbname": "", "user": "", "password": "", "recreate": false, "measurement": "", "batchsize": 102400, "batchfrequency": 2000, "http-timeout": 30, "retention-policy": "", "accumulator-frequency": 2000, "write-per-measurement": false }, "kafka": null, "internal-jtimon": { "data-log-file": "TelemetrySensorData.log", "csv-log-file": "" }, "paths": [ { "path": "/junos/fpc-pg-timeout-information", "freq": 30000, "mode": "", "origin": "", "pre-gnmi": true, "gnmi": false } ], "log": { "file": "", "periodic-stats": 0, "verbose": false }, "vendor": { "name": "", "remove-namespace": false, "schema": null, "gnmi": null }, "alias": "", "password-decoder": "", "enable-uint": false } invoking getInfluxClient for init invoking getInfluxClient [2001:4860::192:168:0:5], jctx.config.Kafka.producer: New alias creation failed for [2001:4860::192:168:0:5], err: open : no such file or directory compression = none Connecting to [2001:4860::192:168:0:5]:10162 Calling subscribe() ::: test_r5.orig gNMI host: [2001:4860::192:168:0:5]:10162, receiving data.. gRPC headers from host [2001:4860::192:168:0:5]:10162 init-response: [response { subscription_id: 9 } path_list { path: "/junos/fpc-pg-timeout-information/" sample_frequency: 30000 } ] content-type: [application/grpc] grpc-accept-encoding: [identity,deflate,gzip] accept-encoding: [identity,gzip] Receiving telemetry data from [2001:4860::192:168:0:5]:10162 gNMI host: [2001:4860::192:168:0:5]:10162, receive response failed: rpc error: code = InvalidArgument desc = Request doesn't have subscription list Returns subscribe() ::: test_r5.orig CODE ::: 0 subscribe returns, reconnecting after 10s for worker testr5.orig &{0xc00032e3c0 0x534240 [2001:4860::192:168:0:5]:10162 {passthrough {passthrough /[2001:4860::192:168:0:5]:10162 /[2001:4860::192:168:0:5]:10162 false false }} R6 { [] [] {{1000000000 1.6 0.2 120000000000}} false false 0 {grpc-go/1.53.0 false [] 0xc000354488 {0 0 false} [] 5242880 5242880 32768 32768 true} [] false false false []} 0xc0003157d0 0xc000342400 0xc00037e560 0xc0003157a0 {{{0 0} 0 0 {{} 0} {{} 0}} 0xc0003545a8} 0xc0003463c0 {} 0xc00037e540 {{0 0} 0 0 {{} 0} {{} 0}} 0xc0000a2690 map[] {0 0 false} {0 0} }.TelemetrySubscribe() = _, rpc error: code = Canceled desc = grpc: the client connection is closing ^CStreaming for host [2001:4860::192:168:0:5] will be stopped (SIGINT) 2024/06/17 09:32:53 all done ... exiting!

xp600 commented 3 months ago

@amohit1315 - checking to see the status

penieljacobpaulg commented 3 months ago

I verified that the sensor /junos/fpc-pg-timeout-information/ works with the new jtimon when included in the combined sensor list.

However, when subscribing to it as a single sensor, it fails. I tried two JSON formats:

JSON 1:

{
  "host": "[2001:4860::192:168:0:5]",
  "port": 10162,
  "user": "csim",
  "password": "Juniper123",
  "gnmi": {
    "mode": 0,
    "encoding": 2
  },
  "cid": "r5_ocst_ex3333t_11",
  "vendor": {
    "gnmi": {
      "encoding": "protobuf"
    }
  },
  "grpc": {
    "ws": 5242880
  },
  "eos": true,
  "tls": {
    "clientcrt": "/home/ccl/B2_2024/certs/client/client.crt",
    "clientkey": "/home/ccl/B2_2024/certs/client/client.key",
    "ca": "/home/ccl/B2_2024/certs/ca/ca.crt",
    "servername": "R6"
  },
  "paths": [
    {
      "path": "/junos/fpc-pg-timeout-information/",
      "freq": 30000,
      "pre-gnmi": true
    }
  ]
}

JSON 2:

{
  "host": "[2001:4860::192:168:0:5]",
  "port": 10162,
  "user": "csim",
  "password": "Juniper123",
  "cid": "r5_ocst_ex3333t_11",
  "grpc": {
    "ws": 5242880
  },
  "eos": true,
  "tls": {
    "clientcrt": "/home/ccl/B2_2024/certs/client/client.crt",
    "clientkey": "/home/ccl/B2_2024/certs/client/client.key",
    "ca": "/home/ccl/B2_2024/certs/ca/ca.crt",
    "servername": "R6"
  },
  "paths": [
    {
      "path": "/junos/fpc-pg-timeout-information/",
      "freq": 30000,
      "pre-gnmi": true
    }
  ]
}

Error:

Connecting to [2001:4860::192:168:0:5]:10162 Calling subscribe() ::: test_new_1 gNMI host: [2001:4860::192:168:0:5]:10162, receiving data.. gRPC headers from host [2001:4860::192:168:0:5]:10162 accept-encoding: [identity,gzip] init-response: [response { subscription_id: 3 } path_list { path: "/junos/fpc-pg-timeout-information/" sample_frequency: 30000 } ] content-type: [application/grpc] grpc-accept-encoding: [identity,deflate,gzip] Receiving telemetry data from [2001:4860::192:168:0:5]:10162 gNMI host: [2001:4860::192:168:0:5]:10162, receive response failed: rpc error: code = InvalidArgument desc = Request doesn't have subscription list Returns subscribe() ::: test_new_1 CODE ::: 0 subscribe returns, reconnecting after 10s for worker test_new_1

xp600 commented 2 months ago

With release v2.1.1 I am now able to subscribe to this sensor (proper yang pkgs have to be installed on the DUT prior)

Json file: ccl@wf-ccl-vmocst1:~/B2_2024$ cat R5_temp.json { "host": "[2001:4860::192:168:0:5]", "port": 10162, "user": "csim", "password": "Juniper123", "gnmi": { "mode": 0, "encoding": 2 }, "cid": "r5_ocstt_17", "vendor": { "gnmi": { "encoding": "protobuf" } }, "grpc": { "ws": 5242880 }, "eos": true, "tls": { "clientcrt": "/home/ccl/B2_2024/certs/client/client.crt", "clientkey": "/home/ccl/B2_2024/certs/client/client.key", "ca": "/home/ccl/B2_2024/certs/ca/ca.crt", "servername": "R6" }, "paths": [ { "path": "/junos/fpc-pg-timeout-information/", "freq": 30000, "pre-gnmi": true } ] }

subscription: ccl@wf-ccl-vmocst1:~/B2_2024$ ./jtimon-v2_1_1 --config R5_temp.json --print --no-per-packet-goroutines

Router output: Subscription Details : Subscription ID : 9
Type : juniper
Client IP : ipv6:2018:cafe::10:254:3:2:4465 Subscription Time (UTC) : Wed Jun 26 18:25:12 2024

Sensor Statistics :
    Sensor Path                                    : /junos/fpc-pg-timeout-information/
    Reporting Interval                             : 30                   
    Component(s)                                   : xmlproxyd_TM_Thread_7
    Bytes Sent                                     : 246                  
    Packets Sent                                   : 1                    
    Drops                                          : 0                    
    Average iLatency (ms)                          : 0                    
    Average Circular Buffer Used (%)               : 0                    
    Initial Sync Bytes Sent                        : 155                  
    Initial Sync Packets Sent                      : 1                    
    Initial Sync Drops                             : 0                    
    Initial Sync Average iLatency (ms)             : 1                    
    Initial Sync Average Circular Buffer Used (%)  : 0 

jtimon output: path: sensor_1038:/junos/fpc-pg-timeout-information/:/junos/fpc-pg-timeout-information/:xmlproxyd_TM_Thread_7 sequence_number: 5 timestamp: 1719426471491 sync_response: false key: timestamp uint_value: 1719426471491 key: junos_re_stream_creation_timestamp uint_value: 1719426471153 key: junos_re_payload_get_timestamp uint_value: 1719426471491 ^CStreaming for host [2001:4860::192:168:0:5] will be stopped (SIGINT) 2024/06/26 11:27:54 all done ... exiting!