openconfig / gnmi

gRPC Network Management Interface
Apache License 2.0
473 stars 196 forks source link

juniper_gnmi.service: Main process exited, code=exited, status=2/INVALIDARGUMENT #177

Open arbabali999 opened 6 months ago

arbabali999 commented 6 months ago

I have created a service for gnmi so that it can scrap stats to Prometheus but service is showing below error and couldn't start the service.

juniper_gnmi.service:

[Unit] Description=Juniper gNMI Service After=network-online.target Wants=network-online.target

[Service] Type=simple User=gnmi ExecStart=/usr/local/bin/gnmi_cli --debug --config /home/gnmi/juniper_gnmi.yml Restart=on-failure

[Install] WantedBy=multi-user.target

sudo systemctl status juniper_gnmi.service × juniper_gnmi.service - Juniper gNMI Service Loaded: loaded (/etc/systemd/system/juniper_gnmi.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2024-04-24 14:41:33 PKT; 6min ago Process: 14860 ExecStart=/usr/local/bin/gnmi_cli --debug --config /home/gnmi/juniper_gnmi.yml (code=exited, status=2) Main PID: 14860 (code=exited, status=2) CPU: 24ms

14:41:33 gNMIc systemd[1]: juniper_gnmi.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

14:41:33 gNMIc gnmi_cli[14860]: -with_per_rpc_auth

14:41:33 gNMIc gnmi_cli[14860]: Use per RPC auth.

14:41:33 gNMIc gnmi_cli[14860]: -with_user_pass

14:41:33 gNMIc gnmi_cli[14860]: When set, CLI will prompt for username/password to use when connecting to a target.

14:41:33 gNMIc systemd[1]: juniper_gnmi.service: Failed with result 'exit-code'.

14:41:33 gNMIc systemd[1]: juniper_gnmi.service: Scheduled restart job, restart counter is at 5.

14:41:33 gNMIc systemd[1]: Stopped Juniper gNMI Service.

14:41:33 gNMIc systemd[1]: juniper_gnmi.service: Start request repeated too quickly.

14:41:33 gNMIc systemd[1]: juniper_gnmi.service: Failed with result 'exit-code'.

14:41:33 gNMIc systemd[1]: Failed to start Juniper gNMI Service.

juniper_gnmi.yml:

port: 57400 timeout: 10s insecure: true

targets: 10.1.1.1: username: admin password: admin subscriptions:

subscriptions: junos_interface_state: paths:

outputs: prom: type: prometheus listen: :9274 path: /metrics metric-prefix: gnmic append-subscription-name: true export-timestamps: true debug: false

Need assistance.

dplore commented 6 months ago

Hi @arbabali999 I recommend checking out https://github.com/openconfig/gnmic instead of using gnmi_cli. gnmi_cli is no longer maintained.