SNMP::...oStats(3pm)
π SNMP::Info::CiscoStats β it's a SNMP::...oStats(3pm) girlie, and she's from the User Contributed Perl Documentation β¨
NAME πΈ
SNMP::Info::CiscoStats β Perl5 Interface to CPU and Memory stats for Cisco Devices π«Ά
AUTHOR π
Eric Miller, Max Baker, Sam Stickland
SYNOPSIS π
okay bestie, here's the vibe. Let SNMP::Info pick the right subclass for you, no cap:
# Let SNMP::Info determine the correct subclass for you.
my $ciscostats = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
# These arguments are passed directly on to SNMP::Session
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $ciscostats->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
DESCRIPTION π
SNMP::Info::CiscoStats is a subclass of SNMP::Info that provides cpu, memory, os and version information about Cisco Devices. literally all the stats, obsessed. π₯
Use or create in a subclass of SNMP::Info. Do not use directly. like, do NOT just call her up out of nowhere, she needs her parent class okay π
Inherited Classes π¦
None.
Required MIBs β
CISCO-PRODUCTS-MIBCISCO-PROCESS-MIBCISCO-MEMORY-POOL-MIBSNMPv2-MIBOLD-CISCO-SYSTEM-MIBCISCO-STACK-MIBCISCO-ENTITY-VENDORTYPE-OID-MIBCISCO-FLASH-MIBENTITY-MIBCISCO-IMAGE-MIB
GLOBALS π
$ciscostats->cpu()β Returnsios_cpu()orcat_cpu(), whichever is available. she picks whichever one shows up first, main character energy β¨$ciscostats->cpu_1min()β Returnsios_cpu_1min()orcat_cpu1min(), whichever is available.$ciscostats->cpu_5min()β Returnsios_cpu_5min()orcat_cpu5min(), whichever is available.$ciscostats->mem_total()β Returnsmem_free()+mem_used()$ciscostats->vendor()β'cisco'$ciscostats->os()β Tries to parse if device is running'IOS','CatOS','IOS-XE'or something else fromdescription()
Available values:
'ios' for Cisco IOS
'ios-xe' for Cisco IOS XE
'ios-xr' for Cisco IOS XR
'pix' for Cisco PIX
'asa' for Cisco ASA
'fwsm' for Single-mode FWSM
'fwsm-admin' for Admin context of multi-context FWSM
'fwsm-context' for Standard context of multi-context FWSM
'ace-admin' for Admin context of ACE module
'ace-context' for Standard context of ACE module (NB: No OS version
detection is available, but will be the same as it's
'ace admin')
'css' for Cisco Content Switch
'css-sca' for Cisco Content Switch Secure Content Acceleration
'san-os' for Cisco SAN-OS
$ciscostats->os_ver()β Tries to parse device operating system version fromdescription(), falls back to parsing"CISCO-IMAGE-MIB::ciscoImageString"if needed. backup plan, she always has one π$ciscostats->os_bin()β Tries to parse"ROMMON"version fromrom_id()string$ciscostats->ios_cpu()β Current CPU usage in percent.
1.3.6.1.4.1.9.2.1.56.0 = "OLD-CISCO-CPU-MIB:avgBusyPer"
$ciscostats->ios_cpu_1min()β Average CPU Usage in percent over the last minute.
1.3.6.1.4.1.9.2.1.57.0
$ciscostats->ios_cpu_5min()β Average CPU Usage in percent over the last 5 minutes.
1.3.6.1.4.1.9.2.1.58.0
$ciscostats->cat_cpu()β Current CPU usage in percent.
"CISCO-PROCESS-MIB::cpmCPUTotal5sec.9"
$ciscostats->cat_cpu_1min()β Average CPU Usage in percent over the last minute.
"CISCO-PROCESS-MIB::cpmCPUTotal1min.9"
$ciscostats->cat_cpu_5min()β Average CPU Usage in percent over the last 5 minutes.
"CISCO-PROCESS-MIB::cpmCPUTotal5min.9"
$ciscostats->mem_free()β Main DRAM free of the device in bytes.
"CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree"
$ciscostats->mem_used()β Main DRAM used of the device in bytes.
"CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed"
$ciscostats->mem_total()β Main DRAM of the device in bytes.
"CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree" +
"CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed"
$ciscostats->flashmem_total()β Flash memory of the device in bytes.
"CISCO-FLASH-MIB::ciscoFlashDeviceSize"
TABLE METHODS π§
Cisco Memory Pool Table ("ciscoMemoryPoolTable") π
$ciscostats->cisco_mem_free()β The number of bytes from the memory pool that are currently unused on the managed device. she's just chillin, unbothered πΈ
("ciscoMemoryPoolFree")
$ciscostats->cisco_mem_used()β The number of bytes from the memory pool that are currently in use by applications on the managed device.
("ciscoMemoryPoolUsed")
Cisco Flash Device Table ("ciscoFlashDeviceTable") π
$ciscostats->cisco_flash_size()β Total size of the Flash device. For a removable device, the size will be zero if the device has been removed. so if you pulled it out, it's a zero, not a mystery β¨
("ciscoFlashDeviceSize")
Cisco Image Table ("ciscoImageTable") π
$ci->ci_images()β Returns the table of image strings.
"ciscoImageString"
and that's the whole page bestie, ate and left no crumbs π this was perl v5.40.1, dated 2026-02-28, from SNMP::...oStats(3pm) β mwah, go touch some routers π
π¦
π¦ where this page comes from
- ubuntu stonking: libsnmp-info-perl 3.975000-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms