Re: Capture Serial Number from Cisco Router jconnolly Mar 10, 2009 9:15 AM ( in response to Yann ) try a script command, issue 'sho inv' on the router this should capture to 1 file for each device. How to locate the device serial number using show version or show inventory command. NAME: 'sw3550_01', DESCR: 'Cisco Catalyst 3550 24 10/100 baseT ports + 2 Gig upl inks fixed configuration Layer 2/3 Ethernet Switch' PID: WS-C3550-24-SMI, VID: L0, SN: CAT0812N33C. Cisco Date of Manufacture From Serial Number Do a 'show version' and locate the System Serial Number. The serial number is in this format: LLLYYWWSSSS LLL = location of the supplier YY = year of manufacture WW = week of manufacture SSSS = serial-id Year codes: 01 = 1997 02 = 1998. The serial number will be in the format: ‘LLLYYWWSSSS’; where ‘YY’ is the year of manufacture and ‘WW’ is the week of manufacture. The date code can be found in the 4 middle digits of the serial number. In the case of serial number SAD08300D4W, ‘08’ is the year code and ‘30’ is the week code. You can then decode the date use the following.
- Cisco Catalyst 6500/6000 Serial Numbers: Cisco Catalyst 6500/6000 switches can run CatOS system software on the Supervisor Engine and Cisco IOS Software on the MSFC. Or, the switches can run Cisco IOS System Software, with a software bundle for both the Supervisor Engine and MSFC.
- At times your service provider may ask for the serial number. To fi nd the serial number for your receiver, look on the bottom of the receiver for the label. The serial number is a 9-digit numeric code to the right of the letters “S/N” on the label. Use the space provided here to record the serial number: _____.
Similar Messages:
Cisco Firewall :: Find PIX 515e Serial Number?
Sep 27, 2011How can I find the serial number at Cisco PIX-515E ?
Find The Serial Number Of Lexmark Pro 900 Series Printer?
Dec 13, 2011i need the address of my pro 900 series printer to install the program for my Sony note pad
Cisco Wireless :: Can Get Serial Number Of SFP In WLC 5508 By GUI Or CLI
Apr 17, 2013I need to get the serial number of SFP in WLC 5508 ver 7.0 but can't find the command, is this possible and if yes how can I get the S/N of SFF in WLC?
Cisco Wireless :: View Serial Number Of AP1310 Using GUI?
Nov 24, 2011I have a problem with an AP1310 which may need me to open a case for RMA. is there any way I can view the serial number using the GUI since the AP is already installed on a high mast but I didn't enable telnet on that?
Cisco :: LMS 3.2 Serial Number Required
Sep 29, 2011i have LMS 3.2 installed in my campus. i need the serial number of the LMS suite to open a service request with cisco. but unable to find the same. How to find the same.
Cisco :: How To Get Ciscoworks LMS 4.0.1 Serial Number
Dec 11, 2011How to get Ciscoworks LMS 4.0.1 serial number ? I need that to put the product under mainrtenance, and I can't manage to get it.
D-Link DIR-655 :: Missing Serial Number?
Jun 10, 2012I'm based in the UK and am using a DIR-655 router but I have no record of its serial number (there is no sticker on the item, and the original box is now missing) - is there any way I can ascertain which version of the router I have? As I understand matters, I need to know this so that I can apply the correct firmware upgrade, which is what I wish to do.
Cisco :: OID Used By ASA 55XX Series To Get Serial Number
Mar 1, 2012What is the equivalent oid as chassisid - .1.3.6.1.4.1.9.3.6.3.0, which gets the serial number for most cisco switches/routers is for the ASA 55XX series firewalls.
Cisco Serial Number Format Pdf
Cisco Switching/Routing :: Need To Know Serial Number Of Sup720
Dec 10, 2011How can i find the serial number of sup-720 which is totally dead and not boot?By which sticker on SUP and where ? How many digits ?
Cisco Switching/Routing :: AS 5350 XM - Serial Number
Oct 16, 2011I have about (12x) AS 5350 XM installed in a remote site. I would like to know their serial numbers (the one on the sticker outside the AS) I know that this SN begins with JMX and contains 11 characters. When tel netting those AS, and type the following commands : show inventory, show hardware, show version, show diag.. i can't find those serial numbers. I can find others which begins with JAE !
Cisco Switching/Routing :: C2960S Flexstack Serial Number
Mar 21, 2012Is there a CLI-command to see the serial number of the flexstack module installed in a C2960S.
Cisco Infrastructure :: 2950 - Determine The Serial Number On GBIC
Jun 27, 2004Im trying to determine the serial number of Gbics already installed and running on a Catalyst 2950 switch. Is there a specific command to do so? There is a command on Catalyst 4506 that gives all info regarding the Gbic ('show idprom interface gi 1/1') Is there something equivalent for 2950?
Cisco :: View 3750 Stack Serial Number Inventory LMS 3.2?
Oct 17, 2011Cisco Serial Number Format Download
I am trying to come up with an inventory report of all our 3750v2 stack switches, but for some reason I could not get the serial number of the member switch under each stack. Can Ciscowork LMS 3.2 see the serial number for each switch under a stack?
Cisco Firewall :: ASA 5520 - Chassis Serial Number Not In Right Format
Oct 24, 2011I have a faulty ASA5520 and I am not sure if I have a SMART net contract for it or not (I manage over 200+ ASAs). The problem is that the Serial Number sticker that is normally on the back of the ASA is missing. The ASA5520 is also faulty and doesn't power on so I cannot boot it up and run 'show ver' or similar. If I open the chassis there appears to be other Serial numbers on the Power Supply, and Motherboard etc but they do not seem to be the correct Chassis serial number i.e not in the right format, and if I put them into the Trade tool I get no results.
There must be another record of the serial numbers besides 1x sticker to the rear of the chassis that can fall off? How I can get the chassis serial when the device isn't booting. or (Cisco) is there a way to find the chassis serial number from the power or motherboard serial?
Sony Vaio - How To Trace Stolen Laptop Via Serial Number
Jan 4, 2012My Sony Vaio was stolen and I dont have any tracking software on it. I was told it can be traced using the serial number this is not going to work as the serial number is not digital is this correct? If so is there any inbuilt device or software ect: that comes installed when you purchase the laptop? I am desperate to find my laptop as it has personal information stored on it of my partner who recently passed away and non of this is replaceable. I would prefer to find it without using the authorities as i know who this person is i just dont know where this person has stored the laptop. It would be best for the authorities not to be involved for my safety.
HP Pavilion Dm4 1065dx - Trace Stolen Laptop Via Serial Number
Jul 9, 2011My laptop 'hp pavillion dm4-1065dx' hass been stolen and i have not installed any theft or tracking related softwares. Kindly tell me how to work dis out and find my laptop.
Cisco Firewall :: Serial Number On ASA5555X Do Not Match Show Version
Jan 22, 2013This is the second one of the new ASA 55.5X series appliances where I have seen this issue:When I SHOW VERSION, I can see the serial number displayed. However, this does not match the serial number from the sticker affixed to the outside of the chassis.This makes it confusing on opening TAC cases and for updating licenses.
Cisco Switching/Routing :: Location Of Nexus 1010 Serial Number?
Jun 5, 2013Where on the case is the serial number located? I have a dead one that needs RMA.
Cisco Switching/Routing :: CatOS 2948G Serial Number - Show Version / Sprom And Sticker Don't
Oct 25, 2012I am trying to find the serial number on the CLI that matches the serial number sticker on the back of a WS-C2948G-GE-TX switch that runs CatOS. I am running code cat4000-k9.8-3-2-GLX.bin. I have 4 different switches and all the stickers have a serial that starts with JPE.. and both 'show version' and 'show sprom 1' and 'show sprom 2' gives me a completely different serial number that starts wtih JAE... All of these serial numbers I get from the CLI match with each other. The command 'show sprom chassis' says 'Feature not supported.'
Is it possible to find the serial number that matches the sticker from the CLI on a 2948G? Why does Cisco make this so confusing?
Cisco Wireless :: WAP4410N / Cannot Log Into The WAP To Find The PIN Number
Jan 18, 2011I am trying to set up a Linksys WAP4410N on our network. We are trying to run it using unrestricted access, but it is requiring a pin number. The prompt I get when trying to connect to the WAP is that the number should be in the original documentation. I can not find the original documentation and I cannot log into the WAP to find the PIN number.
Find The Wep Number To Connect Via Wireless?
Dec 29, 2011i just need to know how to find my wep number on my computer cant seem to find it
Linksys Wireless Router :: Wrtter54g2 - Can't Find Pin Number
Oct 25, 2008my new laptop is asking for pin number: i have a wrtter54g2 v1 router.... can't find pin number
Cisco Switching/Routing :: To Find Out The Serial No For Cip Card 7500
Feb 8, 2012How do we find out the serial no. for a CIP card on a cisco 7500 router.
Linksys Wireless Router :: WRT54GS - Cannot Find Version Number
Jul 9, 2007I am trying to find out what version my router is, all it has on the model number is 'WRT54GS' no version number attached to it.
Linksys Wireless Router :: E4200 V2 - Find Hardware Version Number?
Nov 28, 2012In January 2012 I bought a Linksys E4200v2. I am trying to download a firmware version upgrade and it wants to know what hardware version I have. The top of my router (where the model number is displayed), only has E4200. I have looked through my receipts, the box it came in, and anything else I can find to do with the router - they all have the E4200v2. In case the 'v2' portion is for the hardware version, I do not want to download the wrong firmware version and end up with a router that doesn't work
Can't Find My Wep Id Number
Jul 10, 2011Can't find my wep id number
How To Find Port Number Of Any Url
May 28, 2012How to know port number of any URL, for example what is port number used by google.
How To Find Network Id Number
Nov 12, 2012what is a network ID number and how do i find it?
Cisco Serial Number Format Number
To Find A Pass Phase Number
Jul 24, 2011How to do the above thing.
How To Find Out Mobile Number Network
Jul 28, 2012How to find out mobile number network
Find Mobile Number From Name And Address?
Aug 7, 2012How to find the mobile number from Name and address of the person.
Cisco WAN :: How To Find Adsl Line Number From 886VA
Mar 28, 2012Is there a way to find in a remote branch the adsl line number in a cisco router 886VA.
When giving show controllers vdsl 0
we can see the upload/download speed but there is no information about the line number. We need this information in order to troubleshoot adsl line problems with our ISP's in remote branch offices.
This has been written for network engineers to be able to create an Excel inventory of switch/router device info from a folder of 'Show version' .txt files. I've put it here to help me learn about Python and how I could potentially improve my coding, so please, feel free to rip into this and criticise!
1 Answer
$begingroup$With
Every time you use it is something like
Except for one, which is just
Since a trailing t
on its own is invisible, the simpler solution would be to write a funciton
You forgot a space here:
and similar for a few other function calls. You also don't have spaces after the comment hash (#
). Other than that, the style is reasonable.
You use with
to open showfile
but you neglect to do so for inventorytxt
. Don't; put it in a with
.
Many of your comments aren't very useful. Consider
You know that from reading the code so you don't need to repeat it. An example of a good comment would be
shortened to
Note that this now only tells you the information that's not already in the code:
- It's temporary
- It holds device data
- 'a' means 'append'
If it doesn't give you new or clarifying information, it shouldn't be a comment.
This comment should be a docstring:
eg.
There's no real reason for concatenation here:
Just use
This:
should just be
since files are iterable. This will prevent the need to hold the whole file in memory. Also, prefer list(showfile)
to showfile.readlines
.
i
is a good variable name if it is uniformly increasing by a fixed amount each iteration and its use it obvious. In this case, that isn't true. Something more descriptive like count_sh_vers
. Note that that would imply reducing the count by 1 everywhere. However, the count is reset every loop iteration so the check i <= 2
is always True. Remove the variable and check.
You repeat this three times:
for three if/elif
s. Just use or
in the condition:
Cisco Model By Serial Number
Better might be using re
:
You do
The second can never run since the condition is the same, but it doesn't matter as the body is the same too. Just remove the elif
. The same thing happens again with if 'System serial number' in line
. Are you sure you understand what elif
does?
This simplifies the first function to
This is still too deeply nested to another function woulud be appropriate. This gives
In csv_to_xls
, you do
This can just be
csvfile_reader
should also use with
:
You write
which is then used by embed_txt_files
and rename_files
. Since you call these as
You could trivially remove the global by doing
Globals variables are evil; they prevent you from reusing your functions (such as how now you couldn't do this in parallel on several directories) and make data flow hard to figure out. Don't use them.
Verify Cisco Serial Number
I do find it odd that you're doing
where moments before you were using
but since you're using Windows-only APIs it's a bearable crime.
Do note that
is prone to TOCTOU race conditions. It's probably not especially worrisome here since your whole code is one big race condition of that kind, but you should be aware of the risks.
In embed_txt_files
you write
range
is one of the most fundemental builtins; it's best not shadow it. You only use this once so I'd put it at point of use:
With
you can probably do
since 0 False
in Python. I suggest doing so since it makes the action self-explanatory.
This could be better with formatting:
to
or moving to new-style formatting (this would change your other format) with
The name f
should also be improved to, say, filename
. Same with ol
(I chose ole_obj
).
Now in rename_file
, remove dead comments like
You can simplify
to
although now the raw_input
line is so short it might as well just be
I wouldn't wrap
The wrapping seems more intrusive than a line of length 87.
You can probably move most print_new_section
calls into main
; where possible a function shouldn't be dealing with both logic and UI. rename_file
seems to be the exception, so keep that as-is.
You do global folder
in main
; just pass it in as parameters to your functions.
main
's docstring is now
This seems misleading; the function does far more than that. It should be a comment above the code it's talking about, not the function.
Finally, you do
Use a version specifier:
This all gives:
I haven't been able to test this so it's probably broken somewhere.