-
Notifications
You must be signed in to change notification settings - Fork 11
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
Discover host ip address netmasks #346
Conversation
5f04ade
to
5ecd810
Compare
"10.1.1.6" | ||
], | ||
"netmasks": [ | ||
24, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing what concerns me is we must just think about using always the correct index in trento web for ip addresses and netmasks:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the length of ip addresses and netmasks is always the same, you can use the standard zip
and unzip
functions to combine them pretty easily
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, today I learned about lodash zipWith. Okay, this is cool!
Then never mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Discover host netmasks and send them in the
netmasks
field. Each value corresponds the value in the same position forip_addresses
.I'm aware that this "position related" usage is not optimal, and actually, in the 1st commit I implemented a more complex struct to send complete network interfaces. But this makes compatibility between old web/new agent, new web/old agent more difficult, so I sticked to simplest solution.
If for some reason, in the future we need more information about network interfaces, I finally think that we will need something more complex implementation that eventually will require some upgrade in api versioning or even major version of agent/web.
How was this tested?
Partially tested...
We don't have any code testing host discoveries, and in fact, testing
network
related things is pretty difficult.Basically the serialization as json is the unique thing that it is tested.
In any case, the used functions are not changed, just the composed final code, so as everything was working now, i expect that it will continue working