/
Monitoring Service Check: check_consul

Welcome to the VSHN Knowledge Base

Monitoring Service Check: check_consul

Overview

Checks if the configured consul agent is reachable via http check. Under the hood it's just a normal Monitoring Service Check: http.

The check is only configured if managed_monitoring is set to true.

    profile_icinga2::resources::check { 'check-consul-agent':
      check_command    => 'http',
      display_name     => 'Consul service check',
      notes            => 'Checks if the consul service is running',
      notes_url        => 'check_consul',
      production_level => $monitoring_production_level,
      vars             => {
        'http_address' => 'localhost',
        'http_port'    => 8500,
        'http_uri'     => "/v1/health/node/${::hostname}",
        'http_string'  => '"Name":"Serf Health Status","Status":"passing"',
      },
    }

Technical Details

Implementation

Global base checkno
Puppet profiles using this checkprofile_consul

Check plugins

Namehttp
Packagessee documentation for Monitoring Service Check: http
CheckCommand namesee documentation for Monitoring Service Check: http
Upstream source linksee documentation for Monitoring Service Check: http
Documentation linksee documentation for Monitoring Service Check: http

List of variables

List of Variables

The standard check uses the following variables. See documentation link above for a list of all variables.

Icinga2 variableConfigured inDescription
http_addressset to localhost
localhost since it checks the consul agent locally
http_portset to consul agent port 8500the port of consul agent on localhost

http_uri

defined in the profile, depending on requirements, in profile_consul this is fix set parameterthe URI that is queried, defaulting to / in most profiles
http_stringset to "Name":"Serf Health Status","Status":"passing"

Troubleshooting/Known issues

Solution


Related content