1. A wireless sensor network, comprising: a first node configured to receive at least one script defining a new behavior for the network, the first node configured to wirelessly transmit the at least one script via the network; and a sensor node configured to store event data and to receive the at least one script transmitted by the first node, the sensor node having a sensor for detecting an operational parameter of a device, wherein the sensor node via execution of the at least one script is configured to update the event data to indicate that the at least one script is to be invoked if the operational parameter exceeds a threshold, the sensor node further configured to compare the operational parameter to the threshold and to invoke the at least one script based on the event data when the threshold is exceeded by the operational parameter.