nebula icon indicating copy to clipboard operation
nebula copied to clipboard

add ssh command to print device info

Open kazzmir opened this issue 2 years ago • 3 comments

This PR adds a new ssh command device-info that responds with the name of the tun device, and the cidr of the tun. Example output:

name=tun0 cidr=192.168.200.13/24

I need the tun device name because I would like to monitor the network device using other programs, and since the tun device name is dynamic, querying nebula seems like the best way to get it. I actually don't need the cidr, but since its available on the Device interface it seems easy enough to print as well.

If this seems reasonable I can add a json flag like the other print-xxx commands. Also the name of the ssh command is negotiable.

kazzmir avatar Oct 07 '22 06:10 kazzmir

Thanks for the PR! The name of the command seems fine and I believe the a json flag would be helpful if you don't mind adding it.

nbrownus avatar Feb 13 '23 20:02 nbrownus

:+1: ok will do soon

kazzmir avatar Feb 13 '23 20:02 kazzmir

@nbrownus updated now.

$ ssh user@localhost -p 4000 device-info
name=tun0 cidr=10.0.100.8/24
$ ssh user@localhost -p 4000 device-info -json
{"name":"tun0","cidr":"10.0.100.8/24"}
$ ssh user@localhost -p 4000 device-info -json -pretty
{
    "name": "tun0",
    "cidr": "10.0.100.8/24"
}

kazzmir avatar Feb 27 '23 06:02 kazzmir

@kazzmir looks good, mind signing the latest CLA?

nbrownus avatar Apr 29 '24 19:04 nbrownus

Sure, where do I go to sign it? Its suprisingly hard to find. Maybe the main readme should have a link to the cla.

kazzmir avatar Apr 29 '24 20:04 kazzmir

That is a wonderful question. A fresh commit might trigger the bot to prompt for it, I am searching for another solution in the mean time.

nbrownus avatar Apr 29 '24 20:04 nbrownus

Thanks for the contribution! Before we can merge this, we need @kazzmir to sign the Salesforce Inc. Contributor License Agreement.

salesforce-cla[bot] avatar Apr 29 '24 20:04 salesforce-cla[bot]