overthesun / simoc-sam

Live backend for SAM at Biosphere 2
2 stars 1 forks source link

Add the netinfo.py script and the `hosts` command to simoc-sam.py. #62

Closed ezio-melotti closed 6 months ago

ezio-melotti commented 6 months ago

This PR adds the netinfo.py script and the hosts command to simoc-sam.py.

The netinfo.py script can be run directly with python3 netinfo.py, or can be invoked using python3 simoc-sam.py hosts.

It will print something like:

Scanning <172.27.0.0/24> (might take a few seconds)...
+------------+---------------+--------+-----------+-------------------+
|     IP     |   Hostname    | Status | Interface |        MAC        |
+------------+---------------+--------+-----------+-------------------+
| 172.27.0.1 | samrpi1.local |   Up   |    ???    |        ???        |
| 172.27.0.2 | samrpi2.local |   Up   |   bat0    | 06:f3:3a:5d:37:21 |
| 172.27.0.3 | samrpi3.local |   Up   |   bat0    | aa:7c:0d:c9:b8:56 |
+------------+---------------+--------+-----------+-------------------+