Cisco::SNMP::Sensor - Sensor Interface for Cisco Management
use Cisco::SNMP::Sensor;
The following methods are for Sensor statistics. These methods implement the CISCO-ENTITY-SENSOR-MIB.
CISCO-ENTITY-SENSOR-MIB
my $cm = Cisco::SNMP::Sensor->new([OPTIONS]);
Create a new Cisco::SNMP::Sensor object with OPTIONS as optional parameters. See Cisco::SNMP for options.
my @sensOIDs = $cm->sensOIDs();
Return list of Sensor MIB object ID names.
my $sensinfo = $cm->sensor_info();
Populate a data structure with sensor information. If successful, returns a pointer to an array containing sensor information.
$sensinfo->[0]->{'Type', 'Scale', 'Precision', ...} $sensinfo->[1]->{'Type', 'Scale', 'Precision', ...} ... $sensinfo->[n]->{'Type', 'Scale', 'Precision', ...}
Allows the following accessors to be called.
$sensinfo->sensType([#]);
Return the type of the sensor at index '#'. Defaults to 0.
$sensinfo->sensScale([#]);
Return the scale of the sensor at index '#'. Defaults to 0.
$sensinfo->sensPrecision([#]);
Return the precision of the sensor at index '#'. Defaults to 0.
$sensinfo->sensValue([#]);
Return the value of the sensor at index '#'. Defaults to 0.
$sensinfo->sensStatus([#]);
Return the status of the sensor at index '#'. Defaults to 0.
$sensinfo->sensValueTimeStamp([#]);
Return the value timestamp of the sensor at index '#'. Defaults to 0.
$sensinfo->sensValueUpdateRate([#]);
Return the value update rate of the sensor at index '#'. Defaults to 0.
$sensinfo->sensEntityId([#]);
Return the entity ID of the sensor at index '#'. Defaults to 0. This is a derived value, not an actual MIB OID.
The following methods can be called on the Cisco::SNMP::Sensor object directly to access the values directly.
Get Sensor OIDs where (#) is the OID instance, not the index from sensor_info. If (#) not provided, uses 0.
sensor_info
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.