The Event Monitor and Incident Response system (emir) is a flexible, general-purpose system for monitoring
and responding to all aspects of instrument, telescope, and general facility operations, and has been in use at the
Automated Planet Finder telescope for two years. Responses to problems can include both passive actions (e.g.
generating alerts) and active actions (e.g. modifying system settings). Emir includes a monitor-and-response
daemon, plus graphical user interfaces and text-based clients that automatically configure themselves from data
supplied at runtime by the daemon. The daemon is driven by a configuration file that describes each condition
to be monitored, the actions to take when the condition is triggered, and how the conditions are aggregated into
hierarchical groups of conditions. Emir has been implemented for the Keck Task Library (KTL) keyword-based
systems used at Keck and Lick Observatories, but can be readily adapted to many event-driven architectures.
This paper discusses the design and implementation of Emir , and the challenges in balancing the competing
demands for simplicity, flexibility, power, and extensibility.
Emir ’s design lends itself well to multiple purposes, and in addition to its core monitor and response functions,
it provides an effective framework for computing running statistics, aggregate values, and summary state values
from the primitive state data generated by other subsystems, and even for creating quick-and-dirty control loops
for simple systems.