You can use SNMP
First enable snmp on the switch then define snmp communities...
After all, you can use a program to control switches, like CNA, OpManager, or some network management programs like these...
Or you can write a program which triggers your script to disable the port...