By default, switches detect all kinds of errors. If it does, the port goes into an errdisabled state. You can turn this off or on globally. You bring the port back up by doing a shut/no shut.
Default is all causes. You can turn it off or specifically choose what goes into errdisable. Switch(config)# [no] errdisable detect cause {all | cause-name}
Switch(config)#errdisable recovery cause {all | cause-name}
Default is 300 seconds (5 Minutes)
Switch(config)#errdisable recovery interval {seconds}
We configured port security to trigger a port into an errdisabled state. The port connects to a switch with multiple devices. By default port security only allows one MAC address, so the port shuts down.
Switch(config-if)#switchport mode access
Switch(config-if)#switchport port-security
%PM-4-ERR_DISABLE: psecure-violation error detected on Fa0/4, putting Fa0/4 in err-disable state
Switch(config)#errdisable recovery cause psecure-violation
Switch(config)#errdisable recovery interval 30
%PM-4-ERR_RECOVER: Attempting to recover from psecure-violation err-disable state on Fa0/4
*Mar 1 01:42:22.591: %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to up
Switch#show interfaces status [err-disabled]
Switch#show errdisable recovery