cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2740
Views
0
Helpful
3
Replies

How to define LLDP event

VRizk
Level 1
Level 1

So I'm reading about using LLDP with EEM but what I am unsure with is how do you define what it should be looking for? For example, have it so the listed configurations in the EEM applet will only apply to interfaces with a phone, not a PC etc. Is this possible?

This is on a 3560X POE switch version 12.2(55)SE8.

The most I have for this would be:

 

event manager applet LLDP-PHONE-EVENT

event neighbor-discovery interface regexp GigabitEthernet.* lldp add

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

You need to do more processing in the body of the applet.  You'll need to scan the value of the following variables to determine the one that will give you the details you need:

 

    $_nd_lldp_chassis_id
    $_nd_lldp_system_name
    $_nd_lldp_system_description
    $_nd_lldp_ttl
    $_nd_lldp_port_description
    $_nd_lldp_system_capabilities_string
    $_nd_lldp_enabled_capabilities_string
    $_nd_lldp_system_capabilities_bits
    $_nd_lldp_enabled_capabilities_bits
    $_nd_lldp_capabilities_bits
    $_nd_lldp_capabilities_bit_[0-31]

 

See https://supportforums.cisco.com/t5/network-infrastructure-documents/automatically-set-port-descriptions/ta-p/3119769/jump-to/first-unread-message for examples of how this is done with CDP.

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

You need to do more processing in the body of the applet.  You'll need to scan the value of the following variables to determine the one that will give you the details you need:

 

    $_nd_lldp_chassis_id
    $_nd_lldp_system_name
    $_nd_lldp_system_description
    $_nd_lldp_ttl
    $_nd_lldp_port_description
    $_nd_lldp_system_capabilities_string
    $_nd_lldp_enabled_capabilities_string
    $_nd_lldp_system_capabilities_bits
    $_nd_lldp_enabled_capabilities_bits
    $_nd_lldp_capabilities_bits
    $_nd_lldp_capabilities_bit_[0-31]

 

See https://supportforums.cisco.com/t5/network-infrastructure-documents/automatically-set-port-descriptions/ta-p/3119769/jump-to/first-unread-message for examples of how this is done with CDP.

Thank you Joe. Side note is there a good location to learn all the different variables or a book specifically for using EEM? Feel like I am finding all this stuff scattered around.

 

As for the script so adding onto what I had with that,

Would the next line be action 1.0 regexp "AV" $_nd_lldp_system_name  ? I want it to only look at the first two characters to make sure it is AV. Then I take it from the supporting link you gave to configure the correct interface it would be action 5.0 cli command "interface $_nd_local_intf_name" ?
So in an easier format to look at:

 

event manager applet LLDP-PHONE-EVENT
event neighbor-discovery interface regexp GigabitEthernet.* lldp add
action 1.0 regexp "AV" $_nd_lldp_system_name
action 2.0 if $_regexp_result eq 1
action 3.0 cli command "enable"
action 4.0 cli command "config t"
action 5.0 cli command "interface $_nd_local_intf_name"
Then whatever the configuration?

You can use EEM Built-in "Action" Variables | EEM Scripting | Cisco Support Community | 5941 | 102581  for the action variables and "show event manager detector DETECTOR detail" to get the built-in event detector variables.

To look at only the first two characters your regex needs to be:

regexp "^AV" $_nd_lldp_system_name

The rest looks good.  Your config would then come after you enter interface submode.