Cisco::SNMP::CPU - CPU Interface for Cisco Management
use Cisco::SNMP::CPU;
The following methods are for CPU utilization. These methods implement the CISCO-PROCESS-MIB and OLD-CISCO-SYS-MIB.
CISCO-PROCESS-MIB
OLD-CISCO-SYS-MIB
my $cm = Cisco::SNMP::CPU->new([OPTIONS]);
Create a new Cisco::SNMP::CPU object with OPTIONS as optional parameters. See Cisco::SNMP for options.
my @cpuOIDS = $cm->cpuOIDS();
Return list of CPU MIB object ID names.
my $cpuinfo = $cm->cpu_info();
Populate a data structure with CPU information. If successful, returns pointer to an array containing CPU information.
$cpuinfo->[0]->{'Name', '5sec', '1min', ...} $cpuinfo->[1]->{'Name', '5sec', '1min', ...} ... $cpuinfo->[n]->{'Name', '5sec', '1min', ...}
Allows the following accessors to be called.
$cpuinfo->cpuName([#]);
Return the name of the CPU at index '#'. Defaults to 0. This is a derived value from ENTITY-MIB not an actual MIB OID.
ENTITY-MIB
$cpuinfo->cpuType([#]);
Return the type of the CPU at index '#'. Defaults to 0. This is a derived value, not an actual MIB OID.
$cpuinfo->cpu5sec([#]);
Return the 5sec utilization of the CPU at index '#'. Defaults to 0.
$cpuinfo->cpu1min([#]);
Return the 1min utilization of the CPU at index '#'. Defaults to 0.
$cpuinfo->cpu5min([#]);
Return the 5min utilization of the CPU at index '#'. Defaults to 0.
The following are inherited methods. See Cisco::SNMP for more information.
None by default.
This distribution comes with several scripts (installed to the default bin install directory) that not only demonstrate example uses but also provide functional execution.
bin
This software is released under the same terms as Perl itself. If you don't know what that means visit http://perl.com/.
Copyright (C) Michael Vincent 2015
http://www.VinsWorld.com
All rights reserved
To install Cisco::SNMP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cisco::SNMP
CPAN shell
perl -MCPAN -e shell install Cisco::SNMP
For more information on module installation, please visit the detailed CPAN module installation guide.