📄 test_parse_show_version.pl
字号:
## ----------------------------------------------------------------------------------------------## test_parse_show_version.pl#### Example file to demonstrate Cisco::Version## This uses an existing "show version" output#### $Id: test_parse_show_version.pl 71 2007-07-23 20:26:08Z mwallraf $## $Author: mwallraf $## $Date: 2007-07-23 22:26:08 +0200 (Mon, 23 Jul 2007) $#### This program is free software; you can redistribute it and/or## modify it under the same terms as Perl itself.## ----------------------------------------------------------------------------------------------use strict;use lib '../lib';use Cisco::Version;use Data::Dumper;## load the output of 'show version' in a stringmy $show_version = &sample_show_version();## crate a new Cisco::Version object my $sv = Cisco::Version->new($show_version);## parse the output$sv->parse();## and get some results# print the amount of RAM foundprint "total DRAM memory = ", $sv->get_memory(), "\n";# pwdrecovery was not found in this 'show version', what now ?print "pwdrecovery = ", $sv->get_pwdrecovery(), "\n";# print the current 'not found value'print "'not found value' = ", $sv->get_not_found_value(), "\n";# let's change this value$sv->set_not_found_value("-----");# and see what happensprint "pwdrecovery = ", $sv->get_pwdrecovery(), "\n";# and print it out once moreprint "'not found value' = ", $sv->get_not_found_value(), "\n";## let's print a dump of all the parameters we foundprint &Dumper($sv->get_summary());#### this is an example output of a Cisco router 'show version'## put your own version to test##sub sample_show_version() {return <<ENDCisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(8), RELEASE SOFTWARE (fc1)Technical Support: http://www.cisco.com/techsupportCopyright (c) 1986-2006 by Cisco Systems, Inc.Compiled Mon 15-May-06 14:54 by prod_rel_teamROM: System Bootstrap, Version 12.4(1r) [hqluong 1r], RELEASE SOFTWARE (fc1)ROUTERA uptime is 26 weeks, 5 days, 22 hours, 25 minutesSystem returned to ROM by power-onSystem restarted at 11:40:19 GMT+2 Sat Jan 13 2007System image file is "flash:c2800nm-advipservicesk9-mz.124-8.bin"This product contains cryptographic features and is subject to UnitedStates and local country laws governing import, export, transfer anduse. Delivery of Cisco cryptographic products does not implythird-party authority to import, export, distribute or use encryption.Importers, exporters, distributors and users are responsible forcompliance with U.S. and local country laws. By using this product youagree to comply with applicable laws and regulations. If you are unableto comply with U.S. and local laws, return this product immediately.A summary of U.S. laws governing Cisco cryptographic products may be found at:http://www.cisco.com/wwl/export/crypto/tool/stqrg.htmlIf you require further assistance please contact us by sending email toexport\@cisco.com.Cisco 2821 (revision 53.51) with 249856K/12288K bytes of memory.Processor board ID FCZ102772EM2 Gigabit Ethernet interfaces1 Serial interface1 Channelized E1/PRI port1 Virtual Private Network (VPN) ModuleDRAM configuration is 64 bits wide with parity enabled.239K bytes of non-volatile configuration memory.62720K bytes of ATA CompactFlash (Read/Write)Configuration register is 0x2102END;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -