Starting from July 2018 TKU release model of current product has been drastically changed. This may impact your CMDB. Please find more information on mentioned updates here.
Consul has multiple components, but as a whole, it is a tool for discovering and configuring services in target infrastructure. It provides several key features:
Service Discovery
Health Checking
KV Store
Multi Datacenter
Architecture
Known Versions
- 0.1
- 0.2
- 0.3
- 0.4
- 0.5
- 0.6
- 0.7
- 0.8
- 0.9
- 1.0
- 1.1
- 1.2
| Product component | OS type | Versioning | Pattern Depth |
|---|---|---|---|
| Consul Agent | Windows, UNIX | Active | Instance-based |
| ConsulCluster | Windows, UNIX | _____ | Instance-based |
All mentioned Consul components can be discovered on both Unix/Linux and Microsoft Windows platforms.
Software Instance Triggers
| Pattern | Trigger Node | Attribute | Condition | Argument |
|---|---|---|---|---|
| ConsulServer | DiscoveredProcess | cmd | matches | regex '(?i)consul(?:\.exe)?$' |
and | ||||
args | match | regex "(?i)agent" | ||
| ConsulCluster | SoftwareInstance | cluster_id | ||
| and | ||||
| cluster_id | matches | regex "." | ||
| and | ||||
| leader | exists | |||
| and | ||||
leader | = | "true" | ||
| and | ||||
type | matches | "HashiCorp Consul Agent" | ||
This section describes attributes and Consul commands which provide data for these attributes assignment.
| Attribute | Command | Node Type | Pattern |
|---|---|---|---|
| cluster_id |
| HashiCorp Consul Agent SI | ConsulServer |
role, bootstrap, leader |
| HashiCorp Consul Agent SI | ConsulServer |
| version |
| HashiCorp Consul Agent SI | ConsulServer |
name, ipv4_addrs, state |
| ClusterMember | ConsulCluster |
name, ipv4_addrs |
| ClusterService | ConsulCluster |
cluster_id attribute is modeled by means of merging cluster members IPs together. Currently this is only available approach as HashiCorp Consul product doesn't have its own unique cluster identifier.
The following components/processes are identified using the simple identity mappings which map products known processes:
| Name | Condition |
|---|---|
| HashiCorp Consul Agent | regex '(?i)consul(?:\.exe)?$', regex '(?i)-agent' |
ConsulServer pattern will try to run one of two commands in order to obtain version:
$consul version$consul infoConsulCluster pattern will trigger on HashiCorp Consul Agent SI which should be a leader and have cluster_id attribute.
It will then search all the members of the related cluster which have identical cluster_id attribute.
ConsulCluster pattern models Cluster Node which will contain related ClusterMember and ClusterService Nodes.
Subject Matter Expert input will be welcome on any other potential approaches not discussed.The patterns have been tested against the live installations on Windows, UNIX platforms.More information about this product can be found here.
There are no known open issues with this pattern.