Skip to content

Adding mac address in output #4

@Nyanyah

Description

@Nyanyah

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions