1. A method of managing a network device, the method comprising: receiving a user-created policy prepared at a user terminal; registering the policy on the network device; detecting an event occurring at the network device using at least one of a plurality of event detectors, wherein the event is identified by the policy; running the policy on the network device in response to the detected event; and performing an action specified by the policy in response to the detected event, wherein the action comprises executing a command-line interface (CLI) command specified by the policy.