crawl()
id()
interfaceEnabled()
interfaceNames()
linkTopology()
neighbourCapability()
neighbourId()
neighbourPort()
neighbours()
OID_CDP_DEVICE_ID
OID_CDP_INTERFACE_ENABLED
OID_CDP_INTERFACE_NAME
OID_CDP_NEIGHBOUR_CAPABILITY
OID_CDP_NEIGHBOUR_ID
OID_CDP_NEIGHBOUR_PORT
A class for performing SNMP V2 queries on Cisco devices
copyright | Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland |
---|---|
author | Barry O'Donovan |
crawl(array $devices, string $device, array $ignore) : array
Array form is same as that returned by neighbours()
see | \neighbours() |
---|
array
Unless you're doing something funky, just pass an empty array. This is where the result will be found.
string
CDP device ID of next host to crawl. On first pass, set to null - used internally when recursing
array
An array of CDP device IDs to ignore. I.e. to not include in recursive crawling
array
The resultant array of all crawled devices (same as that passed in the @param $devices parameter)id() : string
string
The device's CDP (Cisco Discovery Protocol) IDinterfaceEnabled() : array
Applies the TruthValue post processor (self::ppTruthValue()) to turn SNMP values into true / false.
array
The device's interfaces CDP enabled status' (as boolean true / false)interfaceNames() : array
array
The device's interface names as seen in CDPlinkTopology(array $devices) : array
Huh? This function:
I.e. if a link is found A -> B, then the same B -> A link will not be included
The array returned is, for example:
[cr-sw04.degkcp.example.ie] => Array ( [cd-sw02.degkcp.example.ie] => Array ( [GigabitEthernet1/0/3] => Array ( [remotePort] => FastEthernet0/1 [isLAG] => false )
[cr-sw03.degkcp.example.ie] => Array
(
[GigabitEthernet1/0/23] => Array
(
[remotePort] => GigabitEthernet1/0/23
[isLAG] => false
)
[GigabitEthernet1/0/24] => Array
(
[remotePort] => GigabitEthernet1/0/24
[isLAG] => false
)
)
)
This tells us that cr-sw04(GigabitEthernet1/0/3) is connected to cd-sw02(FastEthernet0/1).
It also tells us that cr-sw04 has two connections to cr-sw03.
You'll notice it also tells us if it's a LAG or not. More information can be added as needed.
see | \crawl() |
---|
array
The result of crawl() (if null, this function performs a crawl())
array
L2 topology as described above.neighbourCapability() : array
array
The device's CDP neighbour capabilities (as a decimal integer) indexed by the current device's port IDneighbourId() : array
array
The device's CDP neighbours (by their CDP ID) indexed by the current device's port IDneighbourPort() : array
E.g. a sample call may return:
Array ( [10101] => GigabitEthernet0/1 [10102] => FastEthernet0/2 [10103] => GigabitEthernet1/0/24 [10105] => GigabitEthernet1/0/2 )
meaning, for example, that our local port with ID 10101 is connected to port GigabitEthernet0/1 on the neighbour connected to that local port. You can discover the neighbour ID via neighbourId().
see | \neighbourId() |
---|
array
The device's CDP neighbours connected port *description* indexed by the current device's port IDneighbours() : array
Returns an array of neighbours indexed by the neighbour CDP ID. For example:
Array ( [cr-sw03.ixdub1.opensolutions.ie] => Array ( [0] => Array ( [localPortId] => 10101 [localPort] => GigabitEthernet1/0/1 [remotePort] => GigabitEthernet0/1 )
[1] => Array
(
[localPortId] => 10102
[localPort] => GigabitEthernet1/0/2
[remotePort] => FastEthernet0/2
)
)
[ ... ]
)
see | \neighbourId() |
---|---|
see | \OSS\SNMP\MIBS\Interface::descriptions() |
see | \neighbourPort() |
array
CDP neighbours and their connected portsOID_CDP_DEVICE_ID
OID_CDP_INTERFACE_ENABLED
OID_CDP_INTERFACE_NAME
OID_CDP_NEIGHBOUR_CAPABILITY
OID_CDP_NEIGHBOUR_ID
OID_CDP_NEIGHBOUR_PORT