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

Cisco devices - SN display #244

Open
pfunkylol opened this issue Dec 16, 2022 · 5 comments
Open

Cisco devices - SN display #244

pfunkylol opened this issue Dec 16, 2022 · 5 comments
Labels

Comments

@pfunkylol
Copy link

Hi,

This is more of a cosmetic issue, but i was wondering why in General > Serial Number field, it's not always populated or when it is populated it has the wrong SN in it, like for a module/transceiver the device has.

I have compared the output of the command : show inventory and the regex in the Cisco_IOS.js script and they seem to capture the right thing.

e.g. i have the following in the Module tab for a device , but nothing is displayed in SN

CISCO1921/K9 CISCO1921/K9 FCZZZZZZ
4 Port FE Switch on Slot 0 SubSlot 0 HWIC-4ESW FOCXXXXX

Another device, same model has the SN of the switch module in it

CISCO1921/K9 chassis CISCO1921/K9 FCAAAAA
4 Port FE Switch on Slot 0 SubSlot 0 HWIC-4ESW FOCBBBBB

Regards,
Paul

@SCadilhac
Copy link
Contributor

Hello, the current version of the Cisco IOS driver looks for "chassis" in the show inventory output to identify the main part and assigns the corresponding serial number as main serial number of the device. This doesn't seem to work properly with Cisco 1921... Can you post full examples of show inventory taken from your devices (but with fake serial numbers) so we can adjust the driver code?

@SCadilhac SCadilhac added the bug label Jan 3, 2023
@pfunkylol
Copy link
Author

Hello,

show inventory
NAME: "CISCO1921/K9", DESCR: "CISCO1921/K9 chassis, Hw Serial#: FCXXXXXXXX, Hw Revision: 1.0"
PID: CISCO1921/K9 , VID: V05 , SN: FCXXXXXXXX

NAME: "4 Port FE Switch on Slot 0 SubSlot 0", DESCR: "4 Port FE Switch"
PID: HWIC-4ESW , VID: V01 , SN: FOCXXXXXCR

I would say that this is not necessarily relate to 1921 products but to others as well.
A observation would be that if the word "/Chassis/" isn't found, it just displays the output of the last module / line that it can parse having serialNumber: match[5] .

This would be another example

NAME: "chassis", DESCR: "1841 chassis"
PID: CISCO1841 , VID: V05 , SN: FCZXXXXXX

NAME: "WIC/HWIC 0", DESCR: "4 Port FE Switch"
PID: HWIC-4ESW , VID: V01 , SN: FOCXXXXXXX

@SCadilhac
Copy link
Contributor

So we could match for /[Cc]hassis/.
What is the full example (show inventory) of the 1921 where the serial number of the switch module gets captured as main serial number?

@pfunkylol
Copy link
Author

I can confirm that it works with /[Cc]hassis/ for that router family.
As for 1921, that is the whole output.

I've tested with the following code and appears to do the trick.

if (module.slot.match(/[Cc]hassis/)) {
device.set("serialNumber", module.serialNumber);
}
if (module.slot.match(/CISCO1921/)) {
device.set("serialNumber", module.serialNumber);
}

@pfunkylol
Copy link
Author

Hi,

I would require your help another issue if you could and have the time.
For stack switches, i would like to display in the Serial Number field the SN for both ( SW1: SN1 / SW2: SN2 ), right now it's only displayed for the last member in the stack.

I assume that would require some kind of a loop to see if there's one configure, something like if in the show inventory command there is a NAME: "1" and a NAME: "2" and the PID is the same to set the SN for each of the one.

show inventory
NAME: "1", DESCR: "WS-C3750G-24TS"
PID: WS-C3750G-24TS-S  , VID: M0 , SN: CATXXXX

NAME: "2", DESCR: "WS-C3750G-24TS"
PID: WS-C3750G-24TS-S  , VID: V08, SN: FDOYYYY

BR,
Paul

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

No branches or pull requests

2 participants