Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto detect hostnames from ip addresses #60

Open
jpfleischer opened this issue May 6, 2022 · 3 comments
Open

auto detect hostnames from ip addresses #60

jpfleischer opened this issue May 6, 2022 · 3 comments
Assignees
Labels
1 priority one (highest) easy enhancement New feature or request

Comments

@jpfleischer
Copy link
Member

jpfleischer commented May 6, 2022

implementation without ips is done as. implemented in cloudmesh inventory

cms host find

+-------+----------------+------+---------------+-------------------+------------+--------+------------------+
| name  | ip             | user | os            | mac               | model      | memory | serial           |
+-------+----------------+------+---------------+-------------------+------------+--------+------------------+
| red   | 192.168.50.163 | pi   | 11 (bullseye) | dc:a6:... | Pi 4 B 1.4 | 7.7Gi  | 10000000... |
| red01 | 192.168.50.249 | pi   | 11 (bullseye) | dc:a6:... | Pi 4 B 1.1 | 3.8Gi  | 10000000... |
+-------+----------------+------+---------------+-------------------+------------+--------+------------------+
cms host find [--ips=IPS]
ips = Parameter.expand(arguments.ips)
for ip in ips:
    try:
      r = Shell.run(f"ssh {ip} hostname -I").strip()
      # we find the hostname, maybe with try except
      if error:
          report
    except Exception as e:
        print(e)
        Console.error("failed")

how do we use this?
cms host names --ips=192.168.1.[100-103]
add "How to use" this into the FAQ
e.g. "what if my hostnames dont show up in my network?"

perhaps use nmap... it must be installed first.
find mac addresses
https://raspberrypi.stackexchange.com/questions/28365/what-are-the-possible-ouis-for-the-ethernet-mac-address
https://standards-oui.ieee.org/oui/oui.txt

@jpfleischer jpfleischer added enhancement New feature or request 1 priority one (highest) labels May 6, 2022
@jpfleischer jpfleischer self-assigned this May 6, 2022
@laszewsk
Copy link
Member

laszewsk commented May 7, 2022

command will be host find

@laszewsk laszewsk self-assigned this May 7, 2022
@laszewsk
Copy link
Member

laszewsk commented May 7, 2022

Gregor implemented

  • needs only documentation on piplanet

@laszewsk laszewsk added the easy label May 27, 2022
@laszewsk
Copy link
Member

there were lots of confusion about this. Former student die not think it works, however i think other then documentation this works and was implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 priority one (highest) easy enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants