xmacan / plugin_snver

Small Cacti plugin - try find serial numbers, versions and important information about devices
GNU Lesser General Public License v2.1
2 stars 0 forks source link

Mac Address #7

Closed Fabrice35 closed 1 year ago

Fabrice35 commented 1 year ago

Is it possible to add the mac address to each detected equipment?

The mac address is as important as the serial number and is present on the boxes when they are delivered.

This would be very useful!

BB

xmacan commented 1 year ago

that's not quite possible. OID for mac address exists but it isn't mandatory. Testing now ... a lot of devices return mac address. Ok, I will add it

xmacan commented 1 year ago

Please test code from actual master branch and let me know

Fabrice35 commented 1 year ago

It's good for a single device, not for a stack.

When I query my stack in snmp, I get the individual mac addresses: snmpwalk -v2c -c "***" 10.60.2.70 1.3.6.1.4.1.9.9.500.1.2.1.7

Ideally, it should be added to each device: Name: Switch 1 Description: C9200L-24T-4X MAC address: XX:XX:XX:XX:XX:XX HW revision: V01 FW revision: 0.1 SW revision: Amsterdam 17.03.05 Serial number: **** Model name: C9200L-24T-4X

xmacan commented 1 year ago

ups, my bad. I will fix it soon

xmacan commented 1 year ago

Fixed, please try actual master branch

xmacan commented 1 year ago

1.3.6.1.4.1.9.9.500.1.2.1.6 - it is cisco proprietary MIB. I will add it too

Fabrice35 commented 1 year ago

This is not good for me. First there are 2 instances of the same mac address, followed by a long list of mac addresses that don't match the devices (I think it's the mac addresses of the interfaces). Also, for my stack of 4 devices, I only have the same mac address listed twice.

I got the wrong CISCO OID. It is 1.3.6.1.4.1.9.9.500.1.2.1.1.7 for my switches But I can't find it for the Nexus...

Fabrice35 commented 1 year ago

I think there is another problem for the nexus (N9K for me)

The "HW revision", "Serial number" and "Model name" info is displayed for the "module-1" and for my N9K-C93180YC-EX device. I think it should only relate to the equipment, right?

Also, the revision number "SW revision" is only displayed for the module (when it should be displayed for the equipment).

Name: Module-1 48x10/25G + 6x40/100G Ethernet Module Description: 48x10/25G + 6x40/100G Ethernet Module HW revision: V03 FW revision: 7.0(3)I7(6) SW revision: 7.0(3)I7(6) Serial number: XXXXXXXXXXX Manufact. name: Cisco Systems, Inc. Model name: N9K-C93180YC-EX

Name: N9K-C93180YC-EX Description: N9K-C93180YC-EX HW revision: V03 Serial number: XXXXXXXXXXX Manufact. name: Cisco Systems, Inc. Model name: N9K-C93180YC-EX

BB

xmacan commented 1 year ago

It is Entity MIB. Vendor can use this MIB or not. If they use it, they may not use all items, sometimes it is not even possible. So snver is trying read information from this MIB and from some other (vendor specific MIBs - I will add cisco soon).

Maybe another nexus type has more (or less) information, I don't know. Maybe is problem in snver. You can try snmpwalk 1.3.6.1.2.1.47.1.1.1.1.2 and compare result with snver.

xmacan commented 1 year ago

This is not good for me. First there are 2 instances of the same mac address, followed by a long list of mac addresses that don't match the devices (I think it's the mac addresses of the interfaces). Also, for my stack of 4 devices, I only have the same mac address listed twice.

I got the wrong CISCO OID. It is 1.3.6.1.4.1.9.9.500.1.2.1.1.7 for my switches But I can't find it for the Nexus...

The same situation as Entity MIB - maybe for cisco is my MAC adress list useless but for other vendors (HPE, 3com) works fine. There is no common solution for all vendors, so I need add cisco vendor specific oids

Fabrice35 commented 1 year ago

ok, thanks. With the display info as img/snver.png, it would be great for my cisco stacks :-) I also have cisco 4500, 9800 and old nexus 5K (yes, we're married to cisco :-|) BB

xmacan commented 1 year ago

@Fabrice35 - do you have any other oid for cisco device which could be useful in snver?

Fabrice35 commented 1 year ago

Hi,

Here are the OIDs I found to get the mac addresses:

BB

xmacan commented 1 year ago

1.3.6.1.2.1.2.2.1.6..... it is EntityMIB and it has been functional before. Added the first one.

Please test actual master branch

Fabrice35 commented 1 year ago

ok, it's done. Thank you.

Is it possible to force the check of the information of all the devices?

xmacan commented 1 year ago

It isn't possible to run snver for more devices. I will add it

Fabrice35 commented 1 year ago

This is not good for my C9200 and c2960. I get a large list of mac addresses (more than 50). They correspond to each interface and not the device. If I query the oid 1.3.6.1.4.1.9.9.500.1.2.1.1.7 I get a single mac address (or N stacked hardware)

Same thing for C4500 and C9800: In cacti I get more than 200 mac addresses, while a snmpwalk shows me the hardware address: snmpwalk -v2c -c "***" 129.20.4.78 1.3.6.1.2.1.2.2.1.6.1 IF-MIB::ifPhysAddress.1 = Hex-STRING: XX XX XX XX XX XX

This is also the same for the nexus and the oid 1.3.6.1.2.1.2.2.1.6.151060481

Sincerely, BB

Fabrice35 commented 1 year ago

Is it possible to add the oid cisco?

Currently, the plugin does not collect the mac addresses of the different devices in a stack.

Example: snmpwalk -v2c -c "r" 10.0.20.14 1.3.6.1.4.1.9.9.500.1.2.1.7 CISCO-SMI::ciscoMgmt.500.1.2.1.1.7.1000 = Hex-STRING: 44 B6 BE ... ... 80 CISCO-SMI::ciscoMgmt.500.1.2.1.7.2000 = Hex-STRING: 44 B6 BE ... ... 00

The second address does not appear in the plugin snver list on cacti.

Kind regards, BB

xmacan commented 1 year ago

This is not good for my C9200 and c2960. I get a large list of mac addresses (more than 50). They correspond to each interface and not the device. If I query the oid 1.3.6.1.4.1.9.9.500.1.2.1.1.7 I get a single mac address (or N stacked hardware)

Same thing for C4500 and C9800: In cacti I get more than 200 mac addresses, while a snmpwalk shows me the hardware address: snmpwalk -v2c -c "***" 129.20.4.78 1.3.6.1.2.1.2.2.1.6.1 IF-MIB::ifPhysAddress.1 = Hex-STRING: XX XX XX XX XX XX

This is also the same for the nexus and the oid 1.3.6.1.2.1.2.2.1.6.151060481

Sincerely, BB

Yes, you got more addresses, but it is correct for me because all of these addresses belongs to your switch.

xmacan commented 1 year ago

Is it possible to add the oid cisco?

Currently, the plugin does not collect the mac addresses of the different devices in a stack.

Example: snmpwalk -v2c -c "r" 10.0.20.14 1.3.6.1.4.1.9.9.500.1.2.1.7 CISCO-SMI::ciscoMgmt.500.1.2.1.1.7.1000 = Hex-STRING: 44 B6 BE ... ... 80 CISCO-SMI::ciscoMgmt.500.1.2.1.7.2000 = Hex-STRING: 44 B6 BE ... ... 00

The second address does not appear in the plugin snver list on cacti.

Kind regards, BB

ok, I need have a look to the MIBS for the right query for more switches in stack

xmacan commented 1 year ago

please could you send me full output from OID 1.3.6.1.4.1.9.9.500.1.2.1.7? Thank you

Fabrice35 commented 1 year ago

Hi,

I sent it to you by email.

In fact, with Cisco, everything is a stack! A single material is a stack of 1 :O

xmacan commented 1 year ago

Please try run SQL query: INSERT INTO plugin_snver_steps (org_id,description,oid,result,method) VALUES (9,'Port mac addr','1.3.6.1.4.1.9.9.500.1.2.1.1.7','.*','walk');

And test it.

Fabrice35 commented 1 year ago

It works. I get the right mac address(es) in the "Vendor specific" section.

BB

xmacan commented 1 year ago

Thank you