NAME
SNMP::Info::CDP - Perl5 Interface to Cisco Discovery Protocol (CDP) using SNMP
DESCRIPTION
CDP provides Layer 2 discovery of attached devices that also speak CDP, including switches, routers and hubs.
AUTHOR
Max Baker (max@warped.org
)
SYNOPSIS
my $cdp = new SNMP::Info::CDP( DestHost => 'router' ,
Community => 'public' );
$hascdp = $cdp->hasCDP() ? 'yes' : 'no';
@neighbor_ips = values( %{$cdp->ip()} );
CREATING AN OBJECT
- new SNMP::Info::CDP()
-
Arguments passed to new() are passed on to SNMP::Session::new()
my $cdp = new SNMP::Info::CDP( DestHost => $host, Community => 'public' ) die "Couldn't connect.\n" unless defined $cdp;
- $cdp->session()
-
Sets or returns the SNMP::Session object
# Get my $sess = $cdp->session(); # Set my $newsession = new SNMP::Session(...); $cdp->session($newsession);
Your Device May Vary
Each device implements a subset of the global and cache entries. Check the return value to see if that data is held by the device.
CDP GLOBAL VALUES
- $cdp->hasCDP()
-
Is CDP is active in this device?
Accounts for SNMP version 1 devices which may have CDP but not cdp_run()
- $cdp->cdp_run()
-
Is CDP enabled on this device?
(cdpGlobalRun)
- $cdp->cdp_interval()
-
Interval in seconds at which CDP messages are generated.
(cdpGlobalMessageInterval)
- $cdp->cdp_holdtime()
-
Time in seconds that CDP messages are kept.
(cdpGlobalHoldTime)
- $cdp->cdp_id()
-
Returns CDP device ID.
This is the device id broadcast via CDP to other devices, and is what is retrieved from remote devices with $cdp->id().
(cdpGlobalDeviceId)
CDP CACHE ENTRIES
- $cdp->c_proto()
-
Returns remote address type received. Usually IP.
(cdpCacheAddressType)
- $cdp->c_ip()
-
Returns remote IP address
(cdpCacheAddress)
- $cdp->c_ver()
-
Returns remote hardware version
(cdpCacheVersion)
- $cdp->c_id()
-
Returns remote device id string
(cdpCacheDeviceId)
- $cdp->c_port()
-
Returns remote port ID
(cdpDevicePort)
- $cdp->c_platform()
-
Returns remote platform id
(cdpCachePlatform)
- $cdp->c_capabilities()
-
Returns Device Functional Capabilities bitmap.
Anyone know where I can get info on how to decode this?
(cdpCacheCapabilities)
- $cdp->c_domain()
-
Returns remote VTP Management Domain as defined in CISCO-VTP-MIB::managementDomainName
(cdpCacheVTPMgmtDomain)
- $cdp->c_vlan()
-
Returns the remote interface native VLAN.
(cdpCacheNativeVLAN)
- $cdp->c_duplex()
-
Returns the port duplex status from remote devices.
(cdpCacheDuplex)