12-28
UserGuide for Cisco Digital Media Manager5.4.x
OL-15762-05
Chapter12 Registe r DMPs
Reference
return 0
fi
fi
if [[ $_nd_cdp_capabilities_bit_3 -eq YES ]]; then
DEVICE_TYPE=”Switch”
NEW_TRIGGER=CISCO_SWITCH_EVENT
fetch IS_SWITCH_DETECTION_ENABLED
/config/interface{$INTERFACE}/device_trigger{$SWITCH}/macro_auto_device_cntrl
if [[ $IS_SWITCH_DETECTION_ENABLED -eq NO ]]; then
return 0
fi
fi
if [[ $DEVICE_TYPE =~ “^((Default device)|Host)$” ]]; then
NEW_TRIGGER=CISCO_LAST_RESORT_EVENT
fetch IS_LASTRESORT_TRIGGER_ENABLED
/config/interface{$INTERFACE}/trigger_type{$LAST_RESORT}/macro_auto_trigger_cntrl
if [[ $IS_LASTRESORT_TRIGGER_ENABLED -eq NO ]]; then
return 0
fi
fi
# With config persistency the macro applied interface commands
# are not removed on linkdown. But when interface comes up and a
# new device has been detected the config should change.
# Checks for current_trigger, new_trigger and triggers being null
# are required so that the new trigger event is generated
# and configs applied without having changing configs when
# multiple devices are connected to the same interface.
# Configs for only the first device that is detected will be applied.
fetch SW_POE /oper/interface{$INTERFACE}/switch_poe_support
if [[ $NEW_TRIGGER -eq $CURRENT_TRIGGER ]]; then
if [[ $SW_POE -eq YES ]];then
if [[ $CURRENT_AP125X -eq $IS_AP125X ]]; then
set_oper /oper/interface{$INTERFACE}/macro_cfg_reset_pending_state NO
return 0;
else
set_oper /oper/interface{$INTERFACE}/macro_cfg_reset_pending_state YES
fi
else
set_oper /oper/interface{$INTERFACE}/macro_cfg_reset_pending_state NO
return 0;
fi
fi
DEF_TRIGGER=CISCO_CUSTOM_EVENT
# trigger $DEF_TRIGGER TRIGGER=$DEF_TRIGGER INTERFACE=$INTERFACE LINKUP=YES
AUTH_ENABLED=$IS_AUTH_ENABLED
# Apply the new trigger as there is none already applied on interface
if [[ $CURRENT_TRIGGER -eq ““ ]]; then
set_oper /oper/interface{$INTERFACE}/macro_cfg_reset_pending_state NO
fetch ACCESS_VLAN /config/trigger{$NEW_TRIGGER}/vlan_access
fetch VOICE_VLAN /config/trigger{$NEW_TRIGGER}/vlan_voice
fetch NATIVE_VLAN /config/trigger{$NEW_TRIGGER}/vlan_native
if [[ $NEW_TRIGGER -eq CISCO_WIRELESS_AP_EVENT ]]; then
trigger $NEW_TRIGGER TRIGGER=$NEW_TRIGGER INTERFACE=$INTERFACE LINKUP=YES
LIMIT=$LIMIT SW_POE=$SW_POE AP125X=$IS_AP125X NATIVE_VLAN=$NATIVE_VLAN
send log facility AUTOSMARTPORT severity 5 mnemonics INSERT Device $DEVICE_TYPE
detected on interface $INTERFACE, executed $NEW_TRIGGER
return 0;