Comments (2)
@colinmcintosh , thanks for coming back to me - this is a great project and saves me writing a bunch of code :D , which is even better.
I'll probably load from Netbox at some point , I'm just trying to get all the components to work , Clustering etc.
Another question on paths first.
I have two seperate requestss defined , one for Arista (eos) and one for Palo Alto (panos).
The second path in eos is to get the CPU stats
Again testing
gnmic -a arista-sw1:6030 -u eos -p password --insecure subscribe --path "components/component/cpu" --stream-mode on_change
{
"source": "arista-sw1:6030",
"subscription-name": "default-1629846458",
"timestamp": 1629847029458359290,
"time": "2021-08-24T23:17:09.45835929Z",
"updates": [
{
"Path": "components/component[name=CPU0]/cpu/utilization/state/instant",
"values": {
"components/component/cpu/utilization/state/instant": 6
}
}
]
}
........
When I spin up the GNMI GW I don't seem to get the CPU related output.
{
"request": {
"eos": {
"subscribe": {
"prefix": {
},
"subscription": [
{
"path": {
"elem": [
{
"name": "interfaces"
},
{
"name": "interface"
},
{
"name": "state"
},
{
"name": "counters"
}
]
}
},
{
"path": {
"elem": [
{
"name": "components"
},
{
"name": "component"
},
{
"name": "cpu"
}
]
}
}
]
}
},
"panos": {
"subscribe": {
"prefix": {
},
"subscription": [
{
"path": {
"elem": [
{
"name": "interfaces"
},
{
"name": "interface"
},
{
"name": "state"
},
{
"name": "counters"
}
]
}
}
]
}
}
},
"target": {
"arista-sw1": {
"addresses": [
"arista-sw1:6030"
],
"credentials": {
"username": "eos",
"password": "password"
},
"request": "eos",
"meta": {
"NoTLSVerify": "yes"
}
}
},
"panos-fw1": {
"addresses": [
"panos-fw1:9339"
],
"credentials": {
"username": "panos",
"password": "password"
},
"request": "panos",
"meta": {
"NoTLSVerify": "yes"
}
}
}
Is there a way to set the origin for a request also ? Something like ....
gnmi -addr arista-sw1:6030 -username admin
get origin=eos_native '/Kernel/proc/cpu/utilization/total'
from gnmi-gateway.
Hi @gavmckee80! The value of elem
is a list of each of the elements between the slashes in the xpath-style string that you would use with gNMIc. For /interfaces/interface/state/counters
it would look something like:
{
"request": {
"default": {
"subscribe": {
"prefix": {
},
"subscription": [
{
"path": {
"elem": [
{
"name": "interfaces"
},
{
"name": "interface"
},
{
"name": "state"
},
{
"name": "counters"
}
]
}
}
]
}
}
},
"target": {
"<host>": {
"addresses": [
"<host>:6030"
],
"credentials": {
"username": "xxxxxx",
"password": "xxxxxx"
},
"request": "default",
"meta": {
"NoTLSVerify": "yes"
}
}
}
}
You're also able to use xpath-style paths with the "simple" Target Loader in gnmi-gateway. For example your simple config file would look something like:
connection:
my-router:
addresses:
- my-router.test.example.net:9339
credentials:
username: myusername
password: mypassword
request: default
meta:
NoTLSVerify: yes
request:
default:
paths:
- /interfaces/interface/state/counters
from gnmi-gateway.
Related Issues (11)
- "NoTLS:yes" ignored HOT 3
- Support for Path.Origin field in Subscribe request HOT 4
- Cisco XR gnmi streaming telemetry error: unsupported encoding: JSON (need proto) HOT 2
- Prometheus exporter causes panic if result of e.deltaCalc.Calc(metricHash, value) is < 0 HOT 1
- Get "cache update error: update is stale," error after receiving subscription notification from a target. HOT 2
- Gateway exited with an error: could not open simple config file HOT 4
- Enhancement Request: Allow netbox configuration to be defined in JSON config file
- Feature request: Add support for Hashicorp Vault
- NX-OS issues HOT 1
- Using multiple instances within k8s deployment with zookeeper triggers panic and crashes pod
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnmi-gateway.