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

[FEATURE] core-cli query node should also contain position and geo #578

Closed
gh0st42 opened this issue Jun 1, 2021 · 6 comments
Closed

[FEATURE] core-cli query node should also contain position and geo #578

gh0st42 opened this issue Jun 1, 2021 · 6 comments
Assignees

Comments

@gh0st42
Copy link

gh0st42 commented Jun 1, 2021

Is your feature request related to a problem? Please describe.

We often use external (bash/python) scripts to interact with or visualize different aspects of the simulation.
coresendmsg and core-cli can be used to update positions but for external tools to extract the position we always parse the *.xy files in the filesystem as core-cli query node -i 39983 -n 1 only delivers the following output:

ID   | Name    | Type
1    | n1      | DEFAULT
Interfaces
Connected To | ID  | MAC Address       | IP4 Address        | IP6 Address
wlan3        | 0   | 00:00:00:aa:00:00 | 10.0.0.10/24       | 2001::10/128

Describe the solution you'd like

Either adding pos/geo to the default output or add a verbose flag that will contain these information would be really helpful - also for interactive debugging of headless simulations.
Similarly, having query session have all positions/geo locations in a tabular view for all nodes at once would be really nice!

Describe alternatives you've considered

--json does seem to contain these information but also much more. This behavior is kind of undocumented. It took me a while to find this. It's fine for automated parsing but pretty overwhelming for interactive analyses.

Thank you for the great work so far!

@bharnden
Copy link
Contributor

bharnden commented Jun 1, 2021

Thanks for the input. The JSON flag may be going away, possibly. I can look into adding positions as well.

It is also always possible to leverage the gRPC API directly within code or a standalone script to mold data into any shape you like. It does require some extra work, but it is a possibility and can be more specific.

@gh0st42
Copy link
Author

gh0st42 commented Mar 21, 2022

as the -js flag is now gone unfortunately and coordinate overview is not (yet) part of the core-cli query session output are there any plans or updates on this?

writing gRPC client scripts for everything is much more work and error-prone (as python and dev environment must be kept in sync and gRPC interface is still changing) than using the existing CLI tools and just some bash scripts to parse the output.

The alternative of core-cli query node for each node in a running session is not very efficient as it results in one query per node.

@bharnden
Copy link
Contributor

and coordinate overview is not (yet) part of the core-cli query session output are there any plans or updates on this?

What do you mean by this? I am assuming you want a call to query a session for the entire complete picture as one call, vs all nodes individually?

@gh0st42
Copy link
Author

gh0st42 commented Mar 21, 2022

Correct. I want to see all x/y and/or geo coordinates with one call - they are already pulled from the daemon through the session query gRPC call anyhow, just not passed to the user anymore.
We often use this for debugging headless sessions or periodically recording x/y to plot the movements later on.

In the past the json output contained everything (also including currently active wireless links) which was very useful to automate integration tests or debug stuff.

As a workaround, I quickly hacked together some helper tools using my rust gRPC client library but it is much more convenient if the standard tools that come with every coreemu installation already contained the most useful stuff to debug basic scenarios.

For me, an extra parameter such as core-cli query positions or core-cli query geo would also be fine.
I understand that json output is probably unstable and will change over time as the gRPC API changes.

If you say this bloats core-cli too much, the whole tool is to be made obsolete or you'd prefer a PR with the positions or json output added it would also be good to know :)

@bharnden
Copy link
Contributor

I think your asks are reasonable, I would probably look to add the json support back in with the caveat you noted, that it could change if the related protobufs change. That might be reasonable to deal with though and ideally don't end up changing often/much.

@bharnden
Copy link
Contributor

adding the json flag back, which will have similar values, some cases may not be directly protobuf translation, but the session dump will be.

also adding geo output to the session overview for the simple printed view, hopefully these are ok for now.

these are on develop for next release.

@bharnden bharnden self-assigned this Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants