I'll see what I can do here.
Monitor Templates
These are managed with the LocalLB.Monitor interface (or GlobalLB.Monitor for GTM). Monitor templates are basically just the configuration options for a monitor. The type (http, icmp, etc) along with the parameters for the specific type it is. A template doesn't "do" anything as it's not attached to any object. It just allows you to create the definition of a monitor that you can reuse in objects across the system.
Monitor Association
When you have created a template (or just want to use the default base templates), you'll need to assign it to your objects (LTM: NodeAddress, PoolMember, Pool; GTM: Link, PoolMember, Pool, Server, VirtualServer). This is done with the "set_monitor_association" method in the respective objects. This method si defined as follows for the LocalLB.Pool interface (it's similar for the others)
LocalLB.Pool.set_monitor_association(
LocalLB.Pool.MonitorAssociation [] monitor_associations
);
struct LocalLB.Pool.MonitorAssociation {
String pool_name;
MonitorRule monitor_rule;
};
struct MonitorRule {
MonitorRuleType type;
long quorum;
String [] monitor_templates;
};
enum MonitorRuleType {
MONITOR_RULE_TYPE_UNDEFINED = 0,
MONITOR_RULE_TYPE_NONE = 1,
MONITOR_RULE_TYPE_SINGLE = 2,
MONITOR_RULE_TYPE_AND_LIST = 3,
MONITOR_RULE_TYPE_M_OF_N = 4,
};
This should be familiar from the Pool properties page in the LTM GUI. Basically you are passing in the pool you would like to assign the monitors to, along with the list of templates and how you want them processed via the MonitorRuleType.
The "get_monitor_association" method is used to query this information and returns a MonitorAssociation structure for each requested pool.
Monitor Instance
All of the above objects are just configuration based. In other words, there is no status associated with them. The template is just the definition and the association is just how you associate the templates to a given object.
A monitor instance is an actual instance of a monitor attached to an object. This is a read-only property in that you can't create an instance. You create the association and the system assigns an instance based on that association. The "get_monitor_instance" method is used to query the state of the monitors for a given object. You can get the enabled state and the state for the instances. I won't copy the API reference for that method here as you can browse the wikis for the details which all should be pretty self-explanatory.
Relevant links
LocalLB.Pool.Monitor interface
http://devcentral.f5.com/wiki/default.aspx/iControl/LocalLB__Monitor.html
LocalLB.Pool interface
http://devcentral.f5.com/wiki/default.aspx/iControl/LocalLB__Pool.html
Hope this helps clear things up. Please post if you need more details...
-Joe