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

Adding mac address in output #4

Open
Nyanyah opened this issue Oct 12, 2016 · 2 comments
Open

Adding mac address in output #4

Nyanyah opened this issue Oct 12, 2016 · 2 comments

Comments

@Nyanyah
Copy link

Nyanyah commented Oct 12, 2016

Hello it's me again.

I would like netcrawl to also put the mac address of the neighbour in the output.
I'm not very comfortable with ruby yet so I apologize for my lack of knowledge.

I made these changes to the peer.rb file :

  • added :mac to attr_accessor
  • added @mac to the initialize method
  • added 'mac address' => mac.to_s, to the to_hash method

Then for the lldp.rb, I don't really understand how the code works, and thus how to add the mac address.
I know the MIB for the mac address is 1.0.8802.1.1.2.1.4.1.1.5 but that's it.

Adding peer.mac = @mib[OID[:lldpRemChassisId], peer_id].value gave me the "wrong number of arguments (1 for 0)" error.

Any help would be appreciated.
And thanks for the program, my internship tutor really likes it.

@ytti
Copy link
Owner

ytti commented Oct 12, 2016

I'm traveling until 21st day, and after that will have some catching up to do. It looks like you've made solid progress, and I'm confident you'll be able to figure it out. I would encourage looking into 'pry' and adding 'binding.pry' here and there in code, to review how it works.

I can help you implement this, but it'll take quite a while before I have time for it.

@Nyanyah
Copy link
Author

Nyanyah commented Oct 12, 2016

I understand, thanks a lot already :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants