The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Cisco::SNMP::Sensor - Sensor Interface for Cisco Management

SYNOPSIS

  use Cisco::SNMP::Sensor;

DESCRIPTION

The following methods are for Sensor statistics. These methods implement the CISCO-ENTITY-SENSOR-MIB.

METHODS

new() - create a new Cisco::SNMP::Sensor object

  my $cm = Cisco::SNMP::Sensor->new([OPTIONS]);

Create a new Cisco::SNMP::Sensor object with OPTIONS as optional parameters. See Cisco::SNMP for options.

sensOIDs() - return OID names

  my @sensOIDs = $cm->sensOIDs();

Return list of Sensor MIB object ID names.

sensor_info() - return sensor statistics info

  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.

sensType() - return sensor type

  $sensinfo->sensType([#]);

Return the type of the sensor at index '#'. Defaults to 0.

sensScale() - return sensor scale

  $sensinfo->sensScale([#]);

Return the scale of the sensor at index '#'. Defaults to 0.

sensPrecision() - return sensor precision

  $sensinfo->sensPrecision([#]);

Return the precision of the sensor at index '#'. Defaults to 0.

sensValue() - return sensor value

  $sensinfo->sensValue([#]);

Return the value of the sensor at index '#'. Defaults to 0.

sensStatus() - return sensor status

  $sensinfo->sensStatus([#]);

Return the status of the sensor at index '#'. Defaults to 0.

sensValueTimeStamp() - return sensor value timestamp

  $sensinfo->sensValueTimeStamp([#]);

Return the value timestamp of the sensor at index '#'. Defaults to 0.

sensValueUpdateRate() - return sensor value update rate

  $sensinfo->sensValueUpdateRate([#]);

Return the value update rate of the sensor at index '#'. Defaults to 0.

sensEntityId() - return sensor entity ID

  $sensinfo->sensEntityId([#]);

Return the entity ID of the sensor at index '#'. Defaults to 0. This is a derived value, not an actual MIB OID.

DIRECT ACCESS METHODS

The following methods can be called on the Cisco::SNMP::Sensor object directly to access the values directly.

get_sensType (#)
get_sensScale (#)
get_sensPrecision (#)
get_sensValue (#)
get_sensStatus (#)
get_sensValueTimeStamp (#)
get_sensValueUpdateRate (#)

Get Sensor OIDs where (#) is the OID instance, not the index from sensor_info. If (#) not provided, uses 0.

INHERITED METHODS

The following are inherited methods. See Cisco::SNMP for more information.

close
error
session

EXPORT

None by default.

EXAMPLES

This distribution comes with several scripts (installed to the default bin install directory) that not only demonstrate example uses but also provide functional execution.

LICENSE

This software is released under the same terms as Perl itself. If you don't know what that means visit http://perl.com/.

AUTHOR

Copyright (C) Michael Vincent 2015

http://www.VinsWorld.com

All rights reserved