NAME

Cisco::SNMP::IP - IP Interface for Cisco Management

SYNOPSIS

use Cisco::SNMP::IP;

DESCRIPTION

The following methods are for IP management. These methods implement the IP-MIB.

METHODS

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

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

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

ipOIDs() - return OID names

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

Return list of IP MIB object ID names.

addrOIDs() - return OID names

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

Return list of IP address MIB object ID names.

routeOIDs() - return OID names

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

Return list of route MIB object ID names.

ip_info() - return IP info for device

my $ips = $cm->ip_info();

Populate a data structure with the IP information for device.

Allows the following accessors to be called.

ipForwarding() - return IP forwarding state

$ips->ipForwarding();

Return the IP forwarding state of the device.

ipDefaultTTL() - return IP default ttl

$ips->ipDefaultTTL();

Return the IP default time to live of the device.

ipInReceives() - return IP in receives

$ips->ipInReceives();

Return the IP in receives of the device.

ipInHdrErrors() - return IP in hardware errors

$ips->ipInHdrErrors();

Return the IP in hardware errors of the device.

ipInAddrErrors() - return IP in address errors state

$ips->ipInAddrErrors();

Return the IP in address errors of the device.

ipForwDatagrams() - return IP forward datagrams

$ips->ipForwDatagrams();

Return the IP forward datagrams of the device.

InUnknownProtos() - return IP unknown protocols

$ips->InUnknownProtos();

Return the IP unknown protocols of the device.

ipInDiscards() - return IP in discards

$ips->ipInDiscards();

Return the IP in discards of the device.

ipInDelivers() - return IP in delivers state

$ips->ipInDelivers();

Return the IP in delivers of the device.

ipOutRequests() - return IP out requests

$ips->ipOutRequests();

Return the IP out requests of the device.

ipOutDiscards() - return IP out discards

$ips->ipOutDiscards();

Return the IP out discards of the device.

ipOutNoRoutes() - return IP out no routes

$ips->ipOutNoRoutes();

Return the IP out no routes of the device.

ipReasmTimeout() - return IP reassembly timeout

$ips->ipReasmTimeout();

Return the IP reassembly timeout of the device.

ipReasmReqds() - return IP reassembly required

$ips->ipReasmReqds();

Return the IP reassembly required of the device.

ipReasmOKs() - return IP reassembly OK

$ips->ipReasmOKs();

Return the IP reassembly OK of the device.

ipReasmFails() - return IP reassembly fails

$ips->ipReasmFails();

Return the IP reassembly fails of the device.

ipFragOKs() - return IP fragments OK

$ips->ipFragOKs();

Return the IP fragments OK of the device.

ipFragFails() - return IP fragment fails

$ips->ipFragFails();

Return the IP fragment fails of the device.

ipFragCreates() - return IP fragment creates

$ips->ipFragCreates();

Return the IP fragment creates of the device.

ip_forwardingOn - enable IP forwarding

$cm->ip_forwardingOn;

Enable IP forwarding (ip routing command).

ip_forwardingOff - disable IP forwarding

$cm->ip_forwardingOff;

Disable IP forwarding (no ip routing command).

addr_info() - return IP address info for interfaces

my $addrs = $cm->addr_info();

Populate a data structure with the IP information per interface. If successful, returns a pointer to a hash containing interface IP information.

$addrs->{1}->[0]->{'Addr', 'IfIndex, 'NetMask', ...}
             [1]->{'Addr', 'IfIndex, 'NetMask', ...}
             ...
...
$addrs->{n}->[0]->{'Addr', 'IfIndex, 'NetMask', ...}

First hash value is the interface ifIndex, next array is the list of current IP information per the interface ifIndex.

Allows the following accessors to be called.

addrAddr() - return IP address

$addrs->addrAddr([$if[,$ip]]);

Return the address of the IP on interface $if, IP address index $ip. Defaults to 0.

addrIfIndex() - return IP address interface index

$addrs->addrIfIndex([$if[,$ip]]);

Return the interface index of the IP on interface $if, IP address index $ip. Defaults to 0.

addrNetMask() - return IP address mask

$addrs->addrNetMask([$if[,$ip]]);

Return the mask of the IP on interface $if, IP address index $ip. Defaults to 0.

addrBcastAddr() - return brodcast address

$addrs->addrBcastAddr([$if[,$ip]]);

Return the broadcast address of the IP on interface $if, IP address index $ip. Defaults to 0.

addrReasmMaxSize() - return reassembly max size

$addrs->addrReasmMaxSize([$if[,$ip]]);

Return the reassembly max size of the IP on interface $if, IP address index $ip. Defaults to 0.

route_info() - return route info

my $route = $cm->route_info();

Populate a data structure with the route information for the device. If successful, returns a pointer to a hash containing route information.

$route->[0]->{'Dest', 'IfIndex, 'Metric1', ...}
        [1]->{'Dest', 'IfIndex, 'Metric1', ...}
        ...
...
$route->[0]->{'Dest', 'IfIndex, 'Metric1', ...}

Allows the following accessors to be called.

routeDest() - return route destination

$route->routeDest($ip);

Return the destination of the route $ip. Defaults to 0.0.0.0.

routeIfIndex() - return route interface index

$route->routeIfIndex($ip);

Return the interface index of the route $ip. Defaults to 0.0.0.0.

routeMetric1() - return route metric1 value

$route->routeMetric1($ip);

Return the metric1 value of the route $ip. Defaults to 0.0.0.0.

routeMetric2() - return route metric2 value

$route->routeMetric2($ip);

Return the metric2 value of the route $ip. Defaults to 0.0.0.0.

routeMetric3() - return route metric3 value

$route->routeMetric3($ip);

Return the metric3 value of the route $ip. Defaults to 0.0.0.0.

routeMetric4() - return route metric4 value

$route->routeMetric4($ip);

Return the metric4 value of the route $ip. Defaults to 0.0.0.0.

routeNextHop() - return route next hop

$route->routeNextHop($ip);

Return the next hop of the route $ip. Defaults to 0.0.0.0.

routeType() - return route type

$route->routeType($ip);

Return the type of the route $ip. Defaults to 0.0.0.0.

routeProto() - return route protocol

$route->routeProto($ip);

Return the protocol of the route $ip. Defaults to 0.0.0.0.

routeAge() - return route age

$route->routeAge($ip);

Return the age of the route $ip. Defaults to 0.0.0.0.

routeMask() - return route mask

$route->routeMask($ip);

Return the mask of the route $ip. Defaults to 0.0.0.0.

routeMetric5() - return route metric5 value

$route->routeMetric5($ip);

Return the metric5 value of the route $ip. Defaults to 0.0.0.0.

routeInfo() - return route info

$route->routeInfo($ip);

Return the info of the route $ip. Defaults to 0.0.0.0.

DIRECT ACCESS METHODS

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

get_ipForwarding
get_ipDefaultTTL
get_ipInReceives
get_ipInHdrErrors
get_ipInAddrErrors
get_ipForwDatagrams
get_ipInUnknownProtos
get_ipInDiscards
get_ipInDelivers
get_ipOutRequests
get_ipOutDiscards
get_ipOutNoRoutes
get_ipReasmTimeout
get_ipReasmReqds
get_ipReasmOKs
get_ipReasmFails
get_ipFragOKs
get_ipFragFails
get_ipFragCreates

Get IP OIDs.

set_ipForwarding
set_ipDefaultTTL

Set IP OIDs.

get_addrAddr (ip)
get_addrIfIndex (ip)
get_addrNetMask (ip)
get_addrBcastAddr (ip)
get_addrReasmMaxSize (ip)

Get IP address OIDS where (ip) is the IP address.

get_routeDest (ip)
get_routeIfIndex (ip)
get_routeMetric1 (ip)
get_routeMetric2 (ip)
get_routeMetric3 (ip)
get_routeMetric4 (ip)
get_routeNextHop (ip)
get_routeType (ip)
get_routeProto (ip)
get_routeAge (ip)
get_routeMask (ip)
get_routeMetric5 (ip)
get_routeInfo (ip)

Get route OIDS where (ip) is the IP route.

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