1SNMP::Info::CiscoStats(U3s)er Contributed Perl DocumentatSiNoMnP::Info::CiscoStats(3)
2
3
4
6 SNMP::Info::CiscoStats - Perl5 Interface to CPU and Memory stats for
7 Cisco Devices
8
10 Eric Miller, Max Baker, Sam Stickland
11
13 # Let SNMP::Info determine the correct subclass for you.
14 my $ciscostats = new SNMP::Info(
15 AutoSpecify => 1,
16 Debug => 1,
17 # These arguments are passed directly on to SNMP::Session
18 DestHost => 'myswitch',
19 Community => 'public',
20 Version => 2
21 )
22 or die "Can't connect to DestHost.\n";
23
24 my $class = $ciscostats->class();
25 print "SNMP::Info determined this device to fall under subclass : $class\n";
26
28 SNMP::Info::CiscoStats is a subclass of SNMP::Info that provides cpu,
29 memory, os and version information about Cisco Devices.
30
31 Use or create in a subclass of SNMP::Info. Do not use directly.
32
33 Inherited Classes
34 None.
35
36 Required MIBs
37 CISCO-PRODUCTS-MIB
38 CISCO-PROCESS-MIB
39 CISCO-MEMORY-POOL-MIB
40 SNMPv2-MIB
41 OLD-CISCO-SYSTEM-MIB
42 CISCO-STACK-MIB
43 CISCO-ENTITY-VENDORTYPE-OID-MIB
44 CISCO-FLASH-MIB
45 ENTITY-MIB
46 CISCO-IMAGE-MIB
47
48 MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
49
51 $ciscostats->cpu()
52 Returns ios_cpu() or cat_cpu(), whichever is available.
53
54 $ciscostats->cpu_1min()
55 Returns ios_cpu_1min() or cat_cpu1min(), whichever is available.
56
57 $ciscostats->cpu_5min()
58 Returns ios_cpu_5min() or cat_cpu5min(), whichever is available.
59
60 $ciscostats->mem_total()
61 Returns mem_free() + mem_used()
62
63 $ciscostats->vendor()
64 'cisco'
65
66 $ciscostats->os()
67 Tries to parse if device is running 'IOS', 'CatOS', 'IOS-XE' or
68 something else from description()
69
70 Available values:
71
72 'ios' for Cisco IOS
73 'ios-xe' for Cisco IOS XE
74 'ios-xr' for Cisco IOS XR
75 'pix' for Cisco PIX
76 'asa' for Cisco ASA
77 'fwsm' for Single-mode FWSM
78 'fwsm-admin' for Admin context of multi-context FWSM
79 'fwsm-context' for Standard context of multi-context FWSM
80 'ace-admin' for Admin context of ACE module
81 'ace-context' for Standard context of ACE module (NB: No OS version
82 detection is available, but will be the same as it's
83 'ace admin')
84 'css' for Cisco Content Switch
85 'css-sca' for Cisco Content Switch Secure Content Acceleration
86 'san-os' for Cisco SAN-OS
87
88 $ciscostats->os_ver()
89 Tries to parse device operating system version from description(),
90 falls back to parsing "CISCO-IMAGE-MIB::ciscoImageString" if needed
91
92 $ciscostats->os_bin()
93 Tries to parse "ROMMON" version from rom_id() string
94
95 $ciscostats->ios_cpu()
96 Current CPU usage in percent.
97
98 1.3.6.1.4.1.9.2.1.56.0 = "OLD-CISCO-CPU-MIB:avgBusyPer"
99
100 $ciscostats->ios_cpu_1min()
101 Average CPU Usage in percent over the last minute.
102
103 1.3.6.1.4.1.9.2.1.57.0
104
105 $ciscostats->ios_cpu_5min()
106 Average CPU Usage in percent over the last 5 minutes.
107
108 1.3.6.1.4.1.9.2.1.58.0
109
110 $ciscostats->cat_cpu()
111 Current CPU usage in percent.
112
113 "CISCO-PROCESS-MIB::cpmCPUTotal5sec.9"
114
115 $ciscostats->cat_cpu_1min()
116 Average CPU Usage in percent over the last minute.
117
118 "CISCO-PROCESS-MIB::cpmCPUTotal1min.9"
119
120 $ciscostats->cat_cpu_5min()
121 Average CPU Usage in percent over the last 5 minutes.
122
123 "CISCO-PROCESS-MIB::cpmCPUTotal5min.9"
124
125 $ciscostats->mem_free()
126 Main DRAM free of the device in bytes.
127
128 "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree"
129
130 $ciscostats->mem_used()
131 Main DRAM used of the device in bytes.
132
133 "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed"
134
135 $ciscostats->mem_total()
136 Main DRAM of the device in bytes.
137
138 "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree" +
139 "CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed"
140
141 $ciscostats->flashmem_total()
142 Flash memory of the device in bytes.
143
144 "CISCO-FLASH-MIB::ciscoFlashDeviceSize"
145
147 Cisco Memory Pool Table ("ciscoMemoryPoolTable")
148 $ciscostats->cisco_mem_free()
149 The number of bytes from the memory pool that are currently unused
150 on the managed device.
151
152 ("ciscoMemoryPoolFree")
153
154 $ciscostats->cisco_mem_used()
155 The number of bytes from the memory pool that are currently in use
156 by applications on the managed device.
157
158 ("ciscoMemoryPoolUsed")
159
160 Cisco Flash Device Table ("ciscoFlashDeviceTable")
161 $ciscostats->cisco_flash_size()
162 Total size of the Flash device. For a removable device, the size
163 will be zero if the device has been removed.
164
165 ("ciscoFlashDeviceSize")
166
167 Cisco Image Table ("ciscoImageTable")
168 $ci->ci_images()
169 Returns the table of image strings.
170
171 "ciscoImageString"
172
173
174
175perl v5.28.0 2018-11-29 SNMP::Info::CiscoStats(3)