openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
193 stars 57 forks source link

Custom identifier / hostname possibilities #138

Closed andrgras closed 1 year ago

andrgras commented 1 year ago

Hello

Is it possible to add some custom identifier for IP? I'm using IP address in targets and for it would easier to recognize destinations with hostnames in telegraf output, something like 10.10.10.11=hostaname1 and 10.10.10.12=hostname2

username: admin password: admin insecure: true log-file: /var/logs/gnmic.log log-max-size: 5

targets: 10.10.10.11:57400: subscriptions:

outputs: influxdb-output: type: influxdb url: http://127.0.0.1:8086

karimra commented 1 year ago

yes you can set any name as a target key and use the address attribute to configure the addr:port:

username: admin
password: admin
insecure: true
log-file: /var/logs/gnmic.log
log-max-size: 5

targets:
  hostname1:
    address: 10.10.10.11:57400
    subscriptions:
    - ip_stats
  hostname2:
    address: 10.10.10.12:57400
    subscriptions:
    - ip_stats

outputs:
  influxdb-output:
    type: influxdb
    url: http://127.0.0.1:8086/
andrgras commented 1 year ago

Thanks @karimra I will try

andrgras commented 1 year ago

Such setup works targets: hostname1: address: 10.10.10.11:57400 subscriptions: