Courseiva

CCNA Health Checking Questions

65 questions · Health Checking topic · All types, answers revealed

1
MCQmedium

A platform team runs a Consul 1.15 cluster where a legacy VM service registers its health check through the /v1/agent/check/register HTTP API rather than a service definition file. The check is a script check that takes about 40 seconds to finish on a busy host. Operators notice the check flaps to critical roughly every minute even though the script always exits 0 when run manually. The agent's check_update_interval is left at the default. Which change most directly resolves the flapping without altering the script itself?

A.Increase the agent's check_update_interval to a value larger than the check interval.
B.Set the check's status field to passing so the agent stops executing the script.
C.Raise the check's timeout value so it exceeds the script's worst-case runtime.
D.Change the check type from script to TTL and have the script call the TTL endpoint on success.
AnswerC

Consul kills a script check that does not return before its timeout and marks it critical, so a 40-second script under the default 10-second timeout will be terminated and reported as failing. Setting timeout to a value above the observed worst-case runtime lets the script finish and report its real status, stopping the flap without touching the script or the host.

Why this answer

Consul enforces the check's timeout when executing script checks; a script that runs longer than the timeout is terminated and the check reports critical. Because the observed runtime of roughly 40 seconds exceeds the default timeout, the check fails on schedule, producing the regular flapping. Increasing the timeout to exceed the worst-case runtime lets the script complete and report its genuine result.

Exam trap

The trap here is assuming the check interval controls how long a script may run, when it is actually the timeout that terminates a slow script check.

2
MCQmedium

A platform team runs a Consul 1.15 cluster where a critical payment service is registered with a TTL health check. The service owner wants Consul to mark the check as critical if the application fails to renew the TTL for more than one minute. Which configuration field should be set in the service definition to enforce this behavior?

A.ttl
B.deregister_critical_service_after
C.interval
D.timeout
AnswerA

For a TTL check, the ttl field specifies the duration after which the check becomes critical if no successful update is received. Setting it to 1m ensures that if the application does not renew the TTL within one minute, Consul marks the check critical, exactly matching the requirement.

Why this answer

TTL health checks are passive: the application must periodically renew the check via the HTTP API. The ttl field defines the maximum time allowed between renewals before Consul transitions the check to critical. Other fields like interval or timeout apply to active checks, and deregister_critical_service_after controls removal, not the critical transition.

Exam trap

The trap here is confusing passive TTL checks with active checks and assuming that interval or timeout governs TTL expiry.

3
MCQhard

You are monitoring service health using Consul and want to ensure that a service is automatically removed from the catalog if it remains in a 'critical' state for more than 24 hours. Which configuration key supports this?

A.cleanup_interval
B.critical_timeout
C.deregister_critical_service_after
D.remove_service_after
AnswerC

deregister_critical_service_after specifies the duration a service may remain critical before Consul automatically removes it from the catalog. Setting it to 24h satisfies the requirement, unlike checks or timeouts that only affect health status without deregistering the service.

Why this answer

The deregister_critical_service_after setting in a Consul service definition tells Consul to automatically deregister a service instance if its health check remains in the critical state for longer than the specified duration (e.g., '24h'). This is exactly the built-in mechanism for automatic removal of persistently unhealthy services.

Exam trap

The trap is choosing a plausible-sounding but non-existent key like critical_timeout or remove_service_after — candidates must recall the exact Consul key name deregister_critical_service_after.

How to eliminate wrong answers

Option A is wrong because cleanup_interval is a Consul agent configuration for how often the agent cleans up dead/expired entries (e.g., failed nodes, expired sessions), not a per-service critical-state timeout. Option B is wrong because critical_timeout is not a valid Consul service configuration key. Option D is wrong because remove_service_after is not a valid Consul key — the correct key is deregister_critical_service_after.

4
MCQmedium

An operator configures a TCP health check for a database service on port 5432, specifying tcp = "localhost:5432" and interval = "10s". The database process is running and accepting connections, but the check is reported as critical. What is the most likely explanation?

A.The check is being executed from a different network namespace than the database process.
B.The interval is too short; Consul requires a minimum interval of 30 seconds for TCP checks.
C.The Consul agent does not have network permissions or the database is bound only to a specific interface not matching localhost.
D.The TCP check requires an explicit timeout value, and without it the check immediately fails.
AnswerC

The TCP check attempts a connection to the specified address. If the database is bound only to a specific IP (e.g., 127.0.0.1 vs ::1) or the agent lacks permissions, the connection fails. The scenario says the database is accepting connections, but not necessarily on the exact address the check uses. This is the most likely cause.

Why this answer

A TCP health check succeeds only if the agent can establish a TCP connection to the specified address and port. Even if the database is running, it might be listening on a different interface (e.g., only on a specific IP, not localhost) or the agent might lack the necessary permissions. The configured address localhost:5432 must match where the database is actually listening.

Therefore, the most likely explanation is a mismatch in the listening address or a permission issue preventing the connection.

Exam trap

The trap here is assuming that a running service automatically means the TCP check will succeed, overlooking that the service must be listening on the exact address and port specified in the check.

5
MCQmedium

A platform team runs a service on a VM and wants Consul to automatically remove the service instance from the catalog if its health check remains critical for more than 10 minutes. The service is registered via the agent's configuration directory. Which check definition field accomplishes this?

A.ttl
B.critical_timeout
C.deregister_critical_service_after
D.deregister_after
AnswerC

The deregister_critical_service_after field specifies a duration after which a service in a critical state is automatically deregistered from the catalog. Setting it to 10m meets the requirement of removing the instance after 10 minutes of critical health. This is the exact field designed for this scenario and is valid in service check definitions.

Why this answer

Consul provides deregister_critical_service_after specifically to remove a service from the catalog after it has been critical for a configured duration. This prevents stale service instances from remaining discoverable. The other options are either invalid field names or serve unrelated purposes such as TTL check timing.

Exam trap

The trap here is selecting a plausible-sounding but nonexistent field like critical_timeout instead of the actual deregister_critical_service_after field.

6
MCQeasy

Which status indicates that a health check is successfully passing according to Consul?

A.passing
B.unknown
C.critical
D.warning
AnswerA

Consul's health check states are passing, warning, and critical. A passing status means the check's defined script, HTTP, or TCP probe returned success within its interval, confirming the service instance is healthy and should remain in the load-balancing rotation.

Why this answer

In Consul, a health check status of 'passing' means the check is succeeding — the service is healthy according to that check. This is the positive status that indicates the check's success condition is met, whether it's an HTTP 200, a script exit code 0, or a TTL being renewed.

Exam trap

Consul 1.15 often tests the four health check statuses and their meanings, with candidates confusing 'warning' (degraded but not failing) with 'critical' (failing) or 'unknown' (not yet reported).

How to eliminate wrong answers

Option B is wrong because 'unknown' indicates the check has not yet reported a status, often because the service or check was just registered or the agent cannot determine the state. Option C is wrong because 'critical' means the check is failing, indicating the service is unhealthy and should be removed from load balancing. Option D is wrong because 'warning' indicates the check is in a degraded state — it is not fully passing but not critical either, often used for non-fatal issues.

7
MCQmedium

A Consul operator defines a service check with the following HCL block: check { id = "web-api" name = "Web API HTTP" http = "http://localhost:8080/health" interval = "10s" timeout = "1s" }. The endpoint consistently responds in 1.4 seconds but returns HTTP 200. What status will Consul report for this check?

A.maintenance, because the check is temporarily unavailable
B.warning, because the response was slower than the check interval
C.passing, because the endpoint returned HTTP 200
D.critical, because the check exceeded its configured one-second timeout
AnswerD

Consul treats a check whose HTTP request does not complete within the timeout field as a failure and sets the status to critical. The endpoint answering slowly with HTTP 200 does not override the timeout; the request is abandoned and the check goes critical until a subsequent probe completes inside the timeout window.

Why this answer

The HTTP check fails when the request cannot complete within the configured timeout, even if the endpoint eventually returns a success code. Because the probe takes 1.4 seconds against a one-second timeout, Consul abandons the request and marks the check critical. The interval governs probe frequency, not latency evaluation, and HTTP 200 alone cannot keep the check passing when the timeout is breached.

Exam trap

The trap here is assuming that an HTTP 200 response always yields a passing check, ignoring the separate timeout that governs how long Consul waits for that response.

8
MCQhard

A platform team runs a gRPC service and wants Consul to use the standard gRPC health checking protocol rather than a custom script. The service listens on port 50051 and exposes the standard health service. Which check definition should they use?

A.check { name = "grpc-api" tcp = "127.0.0.1:50051" interval = "10s" }
B.check { name = "grpc-api" http = "127.0.0.1:50051" interval = "10s" }
C.check { name = "grpc-api" h2ping = "127.0.0.1:50051" interval = "10s" }
D.check { name = "grpc-api" grpc = "127.0.0.1:50051" interval = "10s" }
AnswerD

The grpc check type implements the standard gRPC health checking protocol against the given address. The agent calls the health service and treats a SERVING response as passing. This avoids writing custom probe logic and matches the requirement to use the protocol the service already exposes on port 50051.

Why this answer

Consul's grpc check type natively implements the standard gRPC health checking protocol, calling the health service and interpreting SERVING as passing. The http check cannot speak the gRPC wire format, h2ping only validates HTTP/2 connectivity without consulting the health service, and tcp merely opens a socket. Only the grpc check actually queries the service's reported health status.

Exam trap

The trap here is confusing h2ping, which only proves HTTP/2 connectivity, with the grpc check, which actually calls the standard health service and reads its status.

9
MCQhard

When configuring a Service-specific health check, what is the impact of setting the 'expose' field to true?

A.The service is automatically registered with a Load Balancer
B.The check is bypassed
C.The check status is exposed on the HTTP interface
D.The agent automatically upgrades the check to HTTP
AnswerC

Setting expose to true publishes the service-specific check's status through Consul's HTTP health endpoint, allowing external tooling to query it. Without it, the check runs but its result stays internal to the agent, so only the API interface reveals the state.

Why this answer

Setting 'expose' to true allows the service to expose its health checks via the local agent's HTTP interface, enabling external access to the health check status.

10
MCQmedium

What is the recommended approach for running health checks on a service that is part of a non-containerized, multi-process architecture?

A.Only check the parent process
B.Run one check per service definition
C.Use only TCP checks
D.Use a single script check that kills the service
AnswerB

In a non-containerised, multi-process architecture, each process runs independently, so Consul cannot infer health from a single aggregate check. Defining one check per service ensures each process is monitored separately, satisfying the requirement to detect individual process failures.

Why this answer

For a non-containerized, multi-process service, Consul's recommended approach is to define one health check per service definition so each process or component can be independently verified. This gives accurate per-process health visibility and avoids the false 'passing' state that a single coarse check can produce when one subprocess dies while another stays up.

Exam trap

The trap is thinking one check can cover a multi-process service — Consul expects per-process checks so a dead worker isn't hidden behind a healthy parent.

How to eliminate wrong answers

Option A is wrong because checking only the parent process can report healthy even when critical child workers have crashed, masking partial failures from service discovery. Option C is wrong because TCP checks only confirm that a port is open — they cannot verify application-level health, so a hung or degraded process still passes. Option D is wrong because a check script that kills the service is destructive and defeats the purpose of health monitoring; checks should observe, not terminate, the service.

11
MCQhard

A Consul 1.15 operator registers a service with an alias health check that points to another service's check. The aliased check is currently in a warning state. What status will the alias check report?

A.warning
B.maintenance
C.critical
D.passing
AnswerA

The alias check directly inherits the status of the aliased check. Since the aliased check is in a warning state, the alias check will also report warning. This allows services to depend on the health of other services without duplicating check logic. The alias check does not modify the status in any way.

Why this answer

An alias health check in Consul mirrors the status of another check. When the aliased check is in a warning state, the alias check will also report warning. This allows services to depend on the health of other services without reimplementing the same check logic.

The alias check does not alter the status; it simply reflects it.

Exam trap

The trap here is assuming that an alias check might escalate a warning to critical or that it has its own logic, but it strictly mirrors the aliased check's status.

12
MCQhard

If a service has multiple health checks associated with it, when is the service itself considered 'critical'?

A.When any check is critical
B.When a majority of checks are critical
C.When all checks are critical
D.Only if the primary check is critical
AnswerA

Consul aggregates all health checks attached to a service; if any single check reports critical, the service's overall status becomes critical. This aggregation means one failing check is sufficient to mark the whole service unhealthy, regardless of the other checks passing.

Why this answer

In Consul, a service is considered 'critical' if any of its associated health checks are in a critical state. This is because the service's overall health is an aggregation where the worst status among all checks determines the service status. Therefore, a single critical check makes the entire service critical.

Exam trap

The trap is thinking that all checks must fail for the service to be critical, but Consul uses the worst-case status, so any single critical check suffices.

How to eliminate wrong answers

Option B is wrong because Consul does not use a majority rule; it uses the most severe status. Option C is wrong because the service becomes critical as soon as one check fails, not only when all fail. Option D is wrong because there is no concept of a 'primary' check; all checks contribute equally to the service's health status.

13
MCQhard

An engineer registers an external service for a third-party payment gateway that cannot run a Consul agent. The registration uses an alias health check that points at a Consul node named 'edge-proxy-01' and a service named 'payment-gateway'. The external service stays healthy in the catalog as long as the proxy node and service are passing. A second engineer later adds a separate script check directly to the same external service definition. After a deployment, the payment gateway disappears from DNS even though the edge proxy node and its payment-gateway service both report passing. What is the most likely cause?

A.Alias checks cannot coexist with other checks on the same service, so Consul silently discards the alias result when a second check is added.
B.The external service node name collides with the alias target node, causing Consul to overwrite the alias check status with the external node's own health.
C.The added script check is failing on the node running the catalog registration, and any failing check on a service marks the whole service critical.
D.The alias check requires the target service to be registered on the same agent, so it failed once the deployment moved the proxy to another datacenter.
AnswerC

A service's aggregate health is the worst state among all its checks, so adding a script check that fails on the registering node drags the service to critical even though the alias check still passes. Because DNS only returns healthy instances by default, the gateway drops out of resolution. Removing or fixing the failing script check restores the service to passing.

Why this answer

Service health in Consul is the aggregate of every check attached to that service, and the worst state wins. Adding a script check that fails on the registering node therefore pushes the external payment gateway to critical even though the alias check still reflects a passing edge proxy. Since DNS queries filter to passing instances by default, the service vanishes from resolution until the failing check is corrected.

Exam trap

The trap here is focusing on the alias target's health and overlooking that a single failing check on the service overrides all passing checks.

14
MCQeasy

An operator registers a service with a script health check that runs a custom binary. The binary exits with status code 1. What status will Consul assign to the service's health check?

A.critical
B.maintenance
C.passing
D.warning
AnswerA

For script health checks, Consul interprets the exit code: 0 means passing, 1 means warning, and any other non-zero code means critical. However, in Consul 1.15, the behavior is that exit code 1 is actually treated as critical for script checks. This is because the script check does not differentiate between warning and critical; any non-zero exit code results in a critical status. Therefore, the service will be marked critical.

Why this answer

In Consul, script health checks use the exit code of the script to determine health status. An exit code of 0 indicates passing, while any non-zero exit code indicates a failure. Specifically, Consul treats exit code 1 as critical for script checks, not warning.

Therefore, when the custom binary exits with 1, the check status becomes critical, and the service is considered unhealthy.

Exam trap

The trap here is assuming that exit code 1 corresponds to a warning state, as it might in some other systems, but Consul script checks treat any non-zero exit as critical.

15
MCQmedium

A Consul service is registered with a TTL health check. The application owner wants the service to be marked unhealthy automatically if the application stops sending heartbeats, without requiring a separate check script or endpoint. The application can send heartbeats every 10 seconds. Which TTL check configuration should be used to mark the service unhealthy after no heartbeat is received for 30 seconds?

A.check { ttl = "30s", status = "passing" }
B.check { ttl = "10s" }
C.check { interval = "30s", timeout = "10s" }
D.check { ttl = "30s" }
AnswerD

A TTL check is marked critical when the TTL expires without an update. Setting ttl = "30s" means the service remains passing as long as the application sends a heartbeat at least every 30 seconds. This matches the requirement to mark the service unhealthy after 30 seconds without a heartbeat, and no external script or HTTP endpoint is needed.

Why this answer

A TTL check expires and becomes critical if no heartbeat is received within the configured ttl duration. Setting ttl to 30 seconds aligns with the requirement to mark the service unhealthy after 30 seconds without a heartbeat. The interval, timeout, and status fields do not replace the ttl field for heartbeat-based checks.

Exam trap

The trap here is confusing TTL checks with interval-based checks and assuming that interval or timeout controls heartbeat expiration.

16
MCQeasy

You are configuring a health check that should be considered passing as long as the HTTP response code is in the 2xx range. Which HTTP check configuration achieves this?

A.Set `status: "passing"` in the check definition.
B.Set `method: "GET"` and `header: { "Accept": ["application/json"] }`.
C.Use the default HTTP check without specifying any `status` codes.
D.Add `tls_skip_verify: true` to the check.
AnswerC

By default, an HTTP check in Consul considers any response code in the 2xx range as passing. If no explicit status codes are configured, the check uses this default behavior. Therefore, simply defining an HTTP check with a URL and interval will treat 2xx responses as healthy. This directly satisfies the requirement without additional configuration.

Why this answer

Consul's HTTP check by default treats any 2xx response code as passing. No additional configuration is needed to achieve this behavior; specifying a URL and interval is sufficient. Other options either set initial status, control request formatting, or manage TLS verification, none of which alter the default status code evaluation.

The correct choice is to rely on the default behavior.

Exam trap

The trap here is thinking that an explicit status code range must be configured to treat 2xx responses as passing, when that is already the default for HTTP checks.

17
MCQmedium

A platform team runs Consul agents in server mode on three dedicated hosts and client agents on each application node. They need a check that verifies the Consul servers themselves are reachable on the Serf LAN gossip port from the perspective of every client agent, so that a partitioned server is flagged even if it still answers HTTP requests on port 8500. Which check definition should they register on each client agent?

A.A TCP check with `tcp` set to the server's address on port 8301, registered as a check on each client agent.
B.An HTTP check against `http://<server>:8500/v1/status/leader` on each server, with `interval` set to 10s.
C.A UDP check with `udp` set to the server's address on port 8301, registered on each client agent.
D.A script check that runs `consul members -status=alive` and fails if any server is missing from the output.
AnswerA

A TCP check opens a connection to the target host and port and reports success only if the socket is accepted. Pointing it at each server's Serf LAN port (8301) from the client agent directly tests the gossip path that matters, so a server that answers HTTP on 8500 but has a blocked or broken 8301 port is correctly marked critical.

Why this answer

Testing reachability of the Serf LAN port from each client agent requires a check that actually opens a connection to that port on the server host. A TCP check pointed at port 8301 does exactly that, and because it is registered on the client agent, the health status reflects the client's own network path rather than the server's self-assessment. HTTP or script checks that exercise the API can pass while gossip connectivity is broken.

Exam trap

The trap here is assuming that any check which contacts the server, such as an HTTP check on the API port, proves the server is reachable for cluster gossip traffic.

18
Multi-Selectmedium

A platform engineer is defining a TTL health check for a batch worker that cannot be polled by the Consul agent. The check must be considered healthy only when the worker actively reports in, and must become unhealthy if the worker stops reporting. Which two configuration elements are required to make this TTL check functional? (Choose two.)

Select 2 answers
A.A TTL value that defines the maximum interval between reports
B.A status field that maps HTTP response codes to states
C.The worker must periodically call the Consul HTTP API to update the check
D.A script or HTTP endpoint that the agent polls
E.A deregister_critical_service_after value
AnswersA, C

The ttl field is mandatory for a TTL check. It tells Consul how long to wait for the next report before marking the check critical. Without a TTL value, Consul cannot determine when the check has expired, so the check cannot function as intended for the batch worker.

Why this answer

A TTL check requires two things: a ttl value, which sets the expiry window, and periodic updates from the monitored process to the Consul HTTP API. The ttl tells Consul when to mark the check critical, and the API calls tell Consul the service is alive. Optional fields like deregister_critical_service_after and status mapping are not required for the check to function.

Exam trap

The trap here is assuming a TTL check needs a polled script or endpoint, when in fact the monitored process must push updates to Consul.

19
Multi-Selecteasy

What information does the Consul HTTP API return for a health check? (Select TWO)

Select 2 answers
A.Service CPU usage
B.Output
C.Service port
D.Check uptime
E.Status
AnswersB, E

The Consul health check HTTP API returns an Output field containing the textual result produced by the check script or HTTP probe. This satisfies the stem's requirement by surfacing diagnostic detail alongside status, letting operators see why a check reported passing, warning, or critical.

Why this answer

The Consul HTTP API health check response includes the Status field (E), which reports the check's current state as "passing", "warning", or "critical", and the Output field (B), which contains the human-readable message or command output produced by the check. These two fields are part of the standard check object returned by endpoints such as /v1/health/checks/<service> and /v1/agent/checks. Service CPU usage (A) is not reported by Consul health checks, as Consul does not collect resource metrics.

Service port (C) is part of the service definition, not the health check object returned by the health API. Check uptime (D) is not a field Consul tracks or returns for health checks.

Exam trap

Consul 1.15 often tests whether candidates confuse health check response fields with service definition fields, leading them to select port or CPU usage instead of Output and Status.

20
MCQeasy

A DevOps engineer runs a Consul 1.15 agent on a VM and registers a web service with a script health check that executes a local shell script. The script returns exit code 0 when the service is healthy and exit code 1 when unhealthy. After the script runs, Consul reports the check status as passing. Which statement best describes how Consul interprets the script's exit code for this check?

A.Exit code 0 indicates passing, exit code 1 indicates critical, and exit code 2 indicates warning.
B.Exit code 0 indicates passing, and exit code 1 indicates maintenance mode.
C.Exit code 0 indicates passing, and any non-zero exit code indicates critical.
D.Exit code 0 indicates passing, exit code 1 indicates warning, and any other code indicates critical.
AnswerC

For script health checks, Consul interprets exit code 0 as passing and any non-zero exit code as critical. This binary behavior is standard for script checks in Consul 1.15. The engineer's script returning 1 correctly results in a critical status when unhealthy.

Why this answer

Consul script checks map exit code 0 to passing and any non-zero exit code to critical. There is no intermediate warning state based on exit codes for script checks. The engineer's script returning 1 will correctly cause the check to be marked critical, which can then trigger alerts or service deregistration if configured.

Exam trap

The trap here is assuming that Consul uses multiple exit codes to represent warning and critical, similar to some other monitoring systems.

21
Multi-Selecteasy

What is true about Consul health checks? (Select TWO)

Select 2 answers
A.They run on the local agent
B.They can be associated with a service
C.They only support GET requests
D.They always run on the server
E.They cannot be disabled
AnswersA, B

Health checks execute on the Consul agent running on each node, not centrally on the servers. This satisfies the stem's requirement that checks are agent-local: the agent owns the check definition, performs the probe, and reports status to the servers via the catalog. Server-side execution would not scale to thousands of nodes.

Why this answer

They run locally on the agent and can be associated with specific services.

22
MCQhard

A Consul service check is configured with `deregister_critical_service_after: "10m"`. The service enters a critical state due to a failed check. What happens after 10 minutes if the check remains critical?

A.The service is marked as maintenance mode and removed from DNS.
B.The service is moved to a warning state and remains registered.
C.The check is disabled but the service remains registered.
D.The service is deregistered from the Consul catalog.
AnswerD

The `deregister_critical_service_after` field specifies a duration after which a service that remains in a critical state is automatically deregistered from the Consul catalog. After 10 minutes of continuous critical status, Consul will remove the service registration. This helps prevent stale entries for failed services. The service must be re-registered to become available again.

Why this answer

When a service check is critical for the duration specified in `deregister_critical_service_after`, Consul automatically deregisters the service from the catalog. This prevents dead services from lingering in service discovery. The service must be re-registered to reappear.

Other options describe different behaviors such as maintenance mode, check disabling, or status change, none of which are caused by this field.

Exam trap

The trap here is confusing automatic deregistration with maintenance mode or check disabling, when the field specifically removes the service from the catalog.

23
MCQhard

A service is registered with a check that has deregister_critical_service_after set to 30m. The service's check enters the critical state due to a transient network partition. The partition is resolved after 20 minutes, and the check returns to passing. What is the effect on the service registration?

A.The service remains registered because the check returned to passing before the 30-minute deregistration timer expired
B.The service is deregistered immediately when the check becomes critical
C.The service is deregistered after 30 minutes from the initial registration, regardless of check state
D.The service is deregistered because it was critical at any point
AnswerA

The deregister_critical_service_after timer is reset when the check leaves the critical state. Since the check returned to passing after 20 minutes, well before the 30-minute threshold, the service is not deregistered. The timer only triggers deregistration if the check stays critical continuously for the configured duration.

Why this answer

The deregister_critical_service_after field starts a timer when a check becomes critical and resets that timer if the check leaves the critical state. In this scenario, the check returned to passing after 20 minutes, before the 30-minute threshold, so the service remains registered. Deregistration only happens if the check stays critical continuously for the full configured duration.

Exam trap

The trap here is thinking that any period of critical status counts toward deregistration, when the timer actually resets on recovery.

24
MCQeasy

A Consul operator registers a web service on a node with a service-level health check that uses the HTTP type and points to http://127.0.0.1:8080/health. The check has been passing for weeks, but the team now wants to stop advertising the service in DNS and the service catalog when the /health endpoint returns HTTP 500. Which Consul check status will the service health be reported as when the endpoint returns 500?

A.warning
B.critical
C.passing
D.maintenance
AnswerB

For HTTP checks, Consul marks the check critical when the monitored endpoint returns any HTTP status other than 200, or when the connection fails or times out. A 500 response therefore immediately puts the check into the critical state, which removes the service from healthy DNS results and from the passing portion of the catalog.

Why this answer

HTTP health checks in Consul treat only HTTP 200 as passing. Any other response, including 500, connection refused, or timeout, is reported as critical. This is why the service will be removed from healthy DNS and catalog queries when the endpoint fails.

The warning state requires explicit configuration or a script exit code, and maintenance mode is operator-initiated.

Exam trap

The trap here is assuming that any HTTP response received from the endpoint, including a 500, proves the service is reachable and therefore passing.

25
MCQeasy

Which HTTP status code range does Consul interpret as a passing state for an HTTP health check?

A.3xx
B.Any code less than 500
C.1xx
D.2xx
AnswerD

Consul's HTTP health check treats any response in the 2xx range as passing, marking the service healthy. Other ranges (3xx redirects, 4xx client errors, 5xx server errors) are interpreted as failing or warning states, so 2xx is the only range that satisfies the passing-state requirement.

Why this answer

Consul's HTTP health check considers the check passing only when the endpoint returns an HTTP status code in the 2xx range (200-299). Any other status — including 3xx redirects — is treated as critical/failing. This strict interpretation ensures the monitored service is actually serving content, not redirecting or erroring.

Exam trap

Consul 1.15 often tests the misconception that any non-5xx response is passing, when in fact only 2xx is treated as passing and 3xx redirects fail the check.

How to eliminate wrong answers

Option A is wrong because 3xx redirects indicate the resource moved and Consul does not follow redirects by default; a 301/302 is treated as failing. Option B is wrong because 'any code less than 500' would incorrectly include 3xx and 4xx responses, which Consul marks as critical. Option C is wrong because 1xx informational responses are not final and are not treated as passing by Consul's HTTP check.

26
Multi-Selectmedium

When troubleshooting a failing health check, which tools are recommended? (Select TWO)

Select 2 answers
A.Consul UI
B.Agent logs
C.DNS query
D.Consul key-value store
E.System metrics
AnswersA, B

The Consul UI displays each service's health check status, output and last-updated timestamp, letting you identify which check is failing and why. This directly satisfies the troubleshooting scenario by exposing the check's current state without command-line inspection.

Why this answer

The Consul UI (A) is recommended because it visually displays the current health status of each service and node, showing which checks are passing, warning, or critical, and it lets you drill into the specific check output to identify the failure. Agent logs (B) are recommended because the Consul agent records detailed health check execution results, errors, and state transitions, which reveal why a check is failing (e.g., script exit codes, timeouts, or connection errors). DNS query (C) is not appropriate here because DNS only resolves service names to addresses and does not expose health check diagnostics.

The Consul key-value store (D) holds arbitrary configuration data and is unrelated to health check troubleshooting. System metrics (E) provide resource usage data but do not show Consul health check status or failure reasons.

Exam trap

Consul 1.15 often tests whether candidates reach for tangential tools (DNS, KV, metrics) instead of the two authoritative sources — the UI for state and agent logs for the underlying error output.

27
MCQeasy

An engineer needs a service check that simply confirms a TCP port on the same host is accepting connections, without sending any application payload. Which Consul check configuration accomplishes this?

A.check { name = "db-port" script = "nc -z localhost 5432" interval = "10s" }
B.check { name = "db-port" ttl = "10s" }
C.check { name = "db-port" tcp = "localhost:5432" interval = "10s" }
D.check { name = "db-port" http = "localhost:5432" interval = "10s" }
AnswerC

The tcp check type opens a TCP connection to the specified address and port and considers the check passing if the connection is established. It sends no application-level data, which matches the requirement exactly. The interval schedules repeated connection attempts, and the check fails when the socket cannot be opened.

Why this answer

The tcp check type is designed for exactly this purpose: Consul dials the given host and port and marks the check passing when the connection succeeds. It requires no payload exchange and no helper binaries. HTTP checks expect an HTTP conversation, TTL checks rely on the service to push status, and script checks add an external process dependency that the native TCP probe avoids.

Exam trap

The trap here is reaching for a script check with a netcat command when Consul already provides a native check type that performs the TCP connection test directly.

28
MCQhard

A Consul 1.15 operator configures an HTTP health check for a service with the following settings: http = "https://api.example.com/health", tls_skip_verify = false, and method = "GET". The check is failing with a certificate error. Which configuration change should the operator make to allow the check to succeed while maintaining security?

A.Set tls_skip_verify to true.
B.Set the method to HEAD instead of GET.
C.Provide a valid CA certificate using the ca_file or ca_path option in the check configuration.
D.Change the check type to TCP on port 443.
AnswerC

By specifying a trusted CA certificate with ca_file or ca_path, Consul can verify the server's certificate against that CA. This resolves the certificate error while maintaining proper TLS verification. This is the secure and correct approach when the service uses a certificate signed by a private or internal CA.

Why this answer

When an HTTP health check fails due to a certificate error, it means Consul cannot verify the server's TLS certificate. To resolve this securely, the operator should provide the appropriate CA certificate using ca_file or ca_path. This allows Consul to trust the certificate while still performing verification, unlike disabling verification with tls_skip_verify.

Exam trap

The trap here is to disable TLS verification by setting tls_skip_verify to true, which would make the check succeed but at the cost of security and is not a proper fix.

29
MCQeasy

An operator registers a web service with a TTL health check and forgets to send periodic updates. After the TTL expires, the service appears as critical in the Consul UI. Which behavior explains why the check transitioned to critical automatically?

A.The service was deregistered because the TTL expired, and the missing service is shown as critical.
B.The Consul agent restarted and reset all check states to critical.
C.Consul requires TTL checks to be updated by an external monitoring system, and the absence of that system caused the critical state.
D.TTL checks automatically transition to critical when their TTL elapses without an update.
AnswerD

TTL health checks require the service to periodically report its status using the /v1/agent/check/pass endpoint or equivalent. If no update is received within the configured TTL, Consul marks the check critical automatically. This is the intended behavior to detect unresponsive services, and it explains the observed transition in the scenario.

Why this answer

TTL checks are passive: the service or an external process must periodically report health. When the TTL elapses without a report, Consul automatically marks the check critical. This design detects services that have stopped reporting, which is exactly what happened when the operator forgot to send updates.

Exam trap

The trap here is assuming that a TTL check stays in its last known state indefinitely or that deregistration is the default, when in fact an expired TTL always forces the check into critical.

30
MCQeasy

A team configures a script health check on a client agent with `interval` set to 30s and `timeout` set to 5s. The script normally finishes in under a second, but during a nightly batch job it occasionally blocks on a lock for over a minute. The team wants Consul to mark the service unhealthy when the script exceeds the timeout instead of waiting indefinitely. What does Consul do when the script has not exited by the timeout value?

A.The agent pauses the check and marks it as maintenance until the script returns.
B.The agent waits for the script to exit, then records the result with a warning status.
C.The agent marks the check critical and retries the script at the next configured interval.
D.The agent marks the check critical immediately and attempts to terminate the running process.
AnswerC

When a script check exceeds its `timeout`, the agent reports the check as critical and moves on, running the script again when the next `interval` elapses. This gives operators the unhealthy signal they asked for while keeping the check loop on schedule, though the still-running process from the previous attempt is not forcibly stopped.

Why this answer

A script check that outlives its configured `timeout` is failed: the agent records the check as critical without blocking the check loop, and the script runs again at the next interval. This is the mechanism that turns a hung batch job into a visible unhealthy status. The agent does not kill the stray process, so overlapping executions are possible if scripts routinely exceed the timeout.

Exam trap

The trap here is assuming the agent kills a script that exceeds its timeout, when in fact it only stops waiting and reports the check as failed.

31
MCQmedium

A service has a TTL check configured with a 30-second TTL. If the application crashes and stops sending heartbeats, when will the service status change to 'critical'?

A.After 60 seconds
B.Once the agent restarts
C.Immediately
D.After 30 seconds
AnswerD

A TTL check expects a heartbeat within its TTL window. Once 30 seconds elapse without one, Consul marks the check critical, so the service status changes immediately at that expiry rather than after a further grace period.

Why this answer

A TTL check in Consul marks the service as critical when the TTL interval elapses without a heartbeat update. Since the TTL is set to 30 seconds, the check will transition to critical exactly 30 seconds after the last successful heartbeat. The application crashing means no further heartbeats are sent, so the timer expires and Consul updates the service status to critical.

Exam trap

Consul 1.15 often tests the misconception that TTL checks expire immediately or after double the TTL, but the correct behavior is that the status changes to critical exactly after the TTL period elapses without a heartbeat.

How to eliminate wrong answers

Option A is wrong because 60 seconds would only be correct if the TTL were 60 seconds or if there were a doubling mechanism, which Consul does not have for TTL checks. Option B is wrong because the agent restarting is unrelated to TTL expiration; the check status is based on the last heartbeat time, and a restart would not delay the critical status if the TTL has already expired. Option C is wrong because Consul does not immediately mark a TTL check as critical upon missing a heartbeat; it waits for the full TTL duration to elapse before changing the status.

32
MCQeasy

When defining a TCP health check, what is the primary indicator that the check is 'passing'?

A.The port is listed in netstat
B.The service responds with a specific string
C.The service returns a 200 OK
D.The agent receives a successful TCP handshake
AnswerD

A successful TCP handshake confirms the target port is open and accepting connections, which is the sole pass criterion for Consul's TCP health check. Unlike HTTP checks, no status code or payload is evaluated, so the SYN-ACK response itself satisfies the check's passing condition.

Why this answer

For a TCP health check, Consul considers the check passing if it can successfully establish a TCP connection to the specified port. This is indicated by a successful TCP handshake (SYN, SYN-ACK, ACK). No application-level response is required.

Exam trap

The trap here is confusing TCP checks with HTTP checks, leading candidates to expect an HTTP status code or specific string, when TCP checks only verify connectivity.

How to eliminate wrong answers

Option A is wrong because the port being listed in netstat only shows that the service is listening, not that it is accepting connections; the port could be firewalled or the service unresponsive. Option B is wrong because expecting a specific string is typical of an HTTP or script check, not a TCP check. Option C is wrong because a 200 OK is an HTTP status code, not applicable to TCP checks.

33
MCQmedium

A service is registered with a health check that has the field deregister_critical_service_after set to "10m". The service's check has been in the critical state for 15 minutes. What will Consul do?

A.The check will be marked as warning.
B.The service will be deregistered from the catalog.
C.The service will be placed in maintenance mode.
D.The check will be restarted and re-evaluated.
AnswerB

The deregister_critical_service_after field specifies a duration after which a service in critical state is automatically deregistered. Since the check has been critical for 15 minutes, which exceeds the 10-minute threshold, Consul will remove the service from the catalog. This prevents stale unhealthy services from lingering.

Why this answer

When deregister_critical_service_after is set, Consul automatically deregisters a service if its check remains critical for longer than the specified duration. In this case, 15 minutes exceeds the 10-minute threshold, so the service is removed from the catalog. The check status does not change to warning, and maintenance mode is not involved.

Exam trap

The trap here is confusing automatic deregistration with maintenance mode or assuming the check transitions to warning after a timeout.

34
MCQhard

When a health check is failing, which Consul API endpoint would you call to investigate the specific error message provided by the check?

A./v1/agent/services
B./v1/agent/self
C./v1/catalog/nodes
D./v1/health/checks/<service>
AnswerD

The /v1/health/checks/<service> endpoint returns each check's status plus its Output field, which carries the exact error text the check script produced. That message pinpoints why the check is failing, unlike the aggregated node or service health endpoints.

Why this answer

The /v1/health/checks/<service> endpoint returns the health checks for a given service, including the status and output of each check. This output often contains the specific error message from the check, making it the correct endpoint to investigate a failing health check.

Exam trap

Consul 1.15 often tests the distinction between agent-level and catalog-level endpoints, causing candidates to choose /v1/agent/services for health check details when it only lists services.

How to eliminate wrong answers

Option A is wrong because /v1/agent/services lists services registered with the agent but does not include health check details. Option B is wrong because /v1/agent/self returns the agent's configuration and status, not service health checks. Option C is wrong because /v1/catalog/nodes lists nodes in the catalog but does not provide health check error messages.

35
MCQeasy

A Consul 1.15 operator is defining a TTL-based health check for a batch job that only reports in when it completes a run. The job must be marked critical if it has not checked in within 30 minutes. The operator wants the check to start in the passing state so a freshly registered job is not immediately flagged. Which configuration block accomplishes this?

A.check = { id = "batch", ttl = "30m", status = "passing" }
B.check = { id = "batch", ttl = "30m", deregister_critical_service_after = "30m" }
C.check = { id = "batch", ttl = "30m", fail_fast = true }
D.check = { id = "batch", interval = "30m", status = "passing" }
AnswerA

A TTL check uses the ttl field to define how long Consul waits for a check-in before marking the check critical, and the status field seeds the initial state so the new registration begins as passing. This matches the requirement of a 30-minute window and a non-critical initial state for the batch job.

Why this answer

TTL checks are passive: the service must periodically call the pass, warn, or fail endpoints, and the ttl field sets the deadline after which Consul flips the check to critical. The status field is the documented way to seed the initial reported state, so a newly registered batch job can start as passing and only become critical if it misses its 30-minute check-in window.

Exam trap

The trap here is reaching for interval on a check that has no executable target, when a passive check-in deadline requires the ttl field.

36
Multi-Selecthard

A Consul operator is defining an HTTP health check for a service and wants to ensure the check request includes custom headers and that the check tolerates a slow endpoint. Which two check definition fields should be used to accomplish these goals? (Choose two.)

Select 2 answers
A.timeout
B.tls_skip_verify
C.interval
D.method
E.header
AnswersA, E

The timeout field defines how long Consul waits for the check to complete before considering it failed. Increasing the timeout allows the check to tolerate a slow endpoint by giving it more time to respond. This is the correct field to address the slow endpoint requirement in the scenario.

Why this answer

To add custom headers, the header field is used within the HTTP check definition. To tolerate a slow endpoint, the timeout field must be increased to allow more time for the response. Together these two fields satisfy the stated requirements, while method, interval, and tls_skip_verify address different aspects of check behavior.

Exam trap

The trap here is confusing interval with timeout, leading to the belief that running the check less frequently makes it tolerant of slow responses, when only timeout controls how long Consul waits.

37
MCQmedium

A Consul operator needs to register a health check that runs a custom binary located at /opt/checks/validate.sh every 15 seconds. The check should be considered passing only when the script exits with code 0. Which check definition correctly implements this?

A.{"check": {"id": "validate", "name": "validate", "args": ["/opt/checks/validate.sh"], "interval": "15s"}}
B.{"check": {"id": "validate", "name": "validate", "script": "/opt/checks/validate.sh", "interval": "15s"}}
C.{"check": {"id": "validate", "name": "validate", "tcp": "/opt/checks/validate.sh", "interval": "15s"}}
D.{"check": {"id": "validate", "name": "validate", "http": "http://localhost/opt/checks/validate.sh", "interval": "15s"}}
AnswerA

Consul 1.15 supports the args field for script checks, which accepts an array of the command and its arguments. Using args avoids shell interpretation and is the recommended approach. The interval of 15s sets the polling frequency, and a zero exit code from the script results in a passing status.

Why this answer

The args field is the correct way to define a script check in Consul 1.15. It takes an array containing the command and any arguments, and the check passes when the command exits with code 0. The script field is deprecated, and http and tcp fields define entirely different check types that cannot execute local binaries.

Using args also avoids shell interpretation, which is safer and more predictable.

Exam trap

The trap here is using the deprecated script field instead of the supported args array for executing local binaries.

38
MCQhard

An operations engineer wants a service registered in Consul to be deregistered automatically from the catalog when its health check has been critical for an extended period, without any external tooling. The service definition is written in HCL and loaded via the agent's config directory. Which combination of settings accomplishes this?

A.Set the check's status to "critical" at registration and rely on Consul's garbage collector
B.Set the service's tags to include "critical" and configure a prepared query to filter them
C.Enable enable_script_checks and add a script that calls the /v1/catalog/deregister endpoint
D.Set deregister_critical_service_after on the check and define the check inside the service block
AnswerD

The deregister_critical_service_after field on a check tells the local Consul agent to remove the associated service instance from the catalog once the check has stayed critical for the specified duration, such as "10m". Placing the check inside the service block ties the deregistration to that service, so no external watcher or script is needed.

Why this answer

Automatic removal of a service whose check stays critical is achieved with the check-level deregister_critical_service_after setting, which the local agent enforces. Defining the check inside the service block binds that behavior to the specific service instance. No external process is required, satisfying the requirement to avoid outside tooling.

The other choices either do nothing automatically or reintroduce external scripts and manual tagging.

Exam trap

The trap here is believing Consul has a built-in garbage collector that eventually purges unhealthy services without any explicit deregistration setting.

39
Multi-Selectmedium

A team is writing Consul 1.15 service definitions for a set of gRPC services that expose the standard gRPC health checking protocol on a dedicated port, and they want Consul to actively probe that protocol rather than a plain TCP connect. Which two settings must be present in each check block to make Consul perform a gRPC health check against the service? (Choose two.)

Select 2 answers
A.tcp = "127.0.0.1:50051"
B.interval = "10s"
C.grpc = "127.0.0.1:50051"
D.method = "grpc.health.v1.Health/Check"
E.grpc_use_tls = true
AnswersB, C

Every active check, including a gRPC health check, needs an interval to tell the agent how often to run the probe. Omitting it leaves the check without a schedule, so Consul cannot periodically invoke the gRPC health service, making this field required alongside the protocol-specific address.

Why this answer

A gRPC health check is selected by the grpc field, which carries the address Consul dials, and like any active check it needs an interval to define the probe cadence. Together those two settings make the agent invoke the standard gRPC health checking protocol against the service; TLS, a method name, and a TCP address are not required to enable that behavior.

Exam trap

The trap here is treating a plain TCP address as equivalent to a gRPC health probe, when only the grpc field selects the protocol-level check.

40
MCQhard

You observe a 'warning' status for a service. What is the most common reason for this?

A.The agent is restarting
B.The network is down
C.The service is operating but with performance issues
D.The service crashed
AnswerC

A warning status means the service's health check is passing but a configured threshold, such as a degraded check or failing node, is breached. The service remains registered and serving traffic, yet its performance or partial availability falls short of the passing criteria.

Why this answer

In Consul, a 'warning' status means the check is returning a warning result — typically the service is up and responding but is degraded or experiencing performance issues. This is distinct from 'critical', which indicates failure. The most common cause of warning is a service that is operational but not fully healthy.

Exam trap

Consul 1.15 often tests the confusion between 'warning' and 'critical' — candidates must remember that warning means degraded but operational, while critical means failed or unreachable.

How to eliminate wrong answers

Option A is wrong because an agent restarting would cause checks to be in 'critical' or unknown state, not warning. Option B is wrong because a network outage would cause checks to fail and go 'critical', not warning. Option D is wrong because a crashed service would return a critical status, not warning.

41
MCQmedium

You are deploying a legacy Java application that cannot expose an HTTP endpoint, but it does listen on TCP port 8443. You need Consul to verify the port is accepting connections and mark the service unhealthy if it is not. Which health check definition should you use?

A.A TTL check that the application updates via the `/v1/agent/check/pass/<check_id>` endpoint.
B.An HTTP check with `http: "https://127.0.0.1:8443/health"` and TLS skip verify.
C.A TCP check with `tcp: "127.0.0.1:8443"` and an appropriate interval.
D.A script check that runs `nc -z 127.0.0.1 8443` every 10 seconds.
AnswerC

The TCP check type is purpose-built for verifying that a TCP port is open and accepting connections. It requires only the address and port, plus an interval, and does not depend on external binaries or HTTP endpoints. This directly satisfies the requirement for the legacy Java application that listens on 8443 but cannot expose HTTP.

Why this answer

The TCP check type is the correct choice because it directly tests whether a TCP port is open and accepting connections without requiring the application to expose HTTP or run external scripts. It uses only the address and port, making it ideal for legacy services that cannot be instrumented. Other check types either demand capabilities the application lacks or add unnecessary dependencies.

Exam trap

The trap here is assuming that any check that can detect a listening port is equally valid, when only the TCP check type is designed for raw port liveness without extra dependencies.

42
MCQmedium

A service team wants its check to be automatically deregistered along with the service when the service is deregistered, but they also want the check to survive a Consul agent restart without being manually recreated. Which configuration achieves both goals?

A.Define the check in the service block with an explicit check ID that differs from the service ID.
B.Define the check inside the service block with a name but no explicit check ID, and register the service through the agent configuration directory.
C.Register the check separately through the HTTP API with a standalone check ID and no service association.
D.Register the service and check via the HTTP API and rely on the agent's in-memory state to persist across restarts.
AnswerB

When a check is nested in a service block and has no explicit ID, Consul generates an ID tied to the service. The check is removed when the service is deregistered, and because it is declared in the agent's configuration directory, it is re-registered automatically whenever the agent starts, satisfying both requirements.

Why this answer

Nesting a check inside a service block without an explicit check ID causes Consul to generate an ID linked to the service, so deregistering the service also removes the check. Declaring that service in the agent configuration directory means the agent re-registers it on every startup, providing restart persistence. API-only registration and in-memory reliance fail both the automatic removal and the restart-survival requirements.

Exam trap

The trap here is assuming that any check registered near a service is automatically tied to it, when only checks nested in the service block without a separate explicit ID inherit that lifecycle linkage.

43
MCQmedium

A platform team runs a fleet of Consul 1.15 server agents behind a strict network policy that blocks all outbound DNS traffic from the server hosts. The team wants the servers to periodically verify that each registered catalog node's DNS name resolves, without installing any extra binaries. Which check definition should they use, and what must they configure so the check can run?

A.A script check that invokes getent hosts, because Consul has no built-in DNS resolution check type.
B.An alias check that aliases the node's own Consul DNS name, because alias checks resolve names locally.
C.An http check targeting https://127.0.0.1:8500/v1/catalog/nodes, because the HTTP API exposes node health.
D.A dns check with a name or address field, pointed at a resolver the hosts are still permitted to reach.
AnswerD

The dns check type is built into the Consul agent and resolves the supplied name (or the service name if omitted) using the host's resolver or an explicit address. Because the check runs inside the agent process, no extra binary is needed. The team must still supply a reachable resolver, since the check cannot succeed if every DNS destination is blocked.

Why this answer

The dns check type runs inside the Consul agent and resolves a hostname through the system resolver or an address supplied in the check definition, which satisfies the no-extra-binaries requirement. The network policy still matters: the check needs a resolver it can actually reach, so the team must point the check at a permitted DNS server or lift the block for that destination.

Exam trap

The trap here is assuming that a DNS-based check needs an external tool or that alias checks resolve names, when the native dns check type already performs resolution in-process.

44
MCQhard

What is the primary difference between a 'script' check and an 'http' check in terms of how they are processed by the Consul agent?

A.Script checks require executing a local process
B.HTTP checks are more secure
C.Only HTTP checks support intervals
D.Script checks are faster
AnswerA

Script checks run an executable or script as a local process on the Consul agent host, whereas HTTP checks issue network requests to a specified URL. The processing distinction is local process execution versus remote HTTP request handling.

Why this answer

Script checks execute a local command or script on the Consul agent's host, while HTTP checks make an HTTP request to a specified URL. The key processing difference is that script checks spawn a subprocess, which can be resource-intensive and requires the script to be present on the node. HTTP checks are handled internally by the agent's HTTP client without executing external code.

Exam trap

Consul 1.15 often tests the confusion that HTTP checks are more secure or that only HTTP checks support intervals, when in fact both support intervals and security depends on configuration.

How to eliminate wrong answers

Option B is wrong because HTTP checks are not inherently more secure; both can be secured with TLS and authentication, and script checks can run in isolated environments. Option C is wrong because both script and HTTP checks support intervals; the 'interval' field is common to all check types. Option D is wrong because script checks are generally slower due to process execution overhead, not faster.

45
MCQmedium

An operations team runs a legacy application that cannot expose an HTTP endpoint but does listen on TCP port 5432. They define a TCP health check in the service registration. During an incident, the port remains open but the application process is hung and no longer accepts new connections. What will Consul report for this check?

A.warning, because the TCP handshake is slow
B.critical, because the application is hung
C.maintenance, because the process is not accepting connections
D.passing, because the TCP port is open
AnswerD

A TCP check only attempts to open a connection to the configured host and port. If the TCP handshake succeeds, the check is passing regardless of whether the application accepts or processes data on that connection. In this scenario the port is still open, so Consul reports passing even though the process is hung.

Why this answer

A TCP health check validates only that a connection to the specified host and port can be established. It does not perform any application-level handshake or data exchange. Because the port remains open in this scenario, the check stays passing even though the application is unresponsive.

This is a common limitation when using TCP checks for services that can hang while keeping their socket open.

Exam trap

The trap here is believing that a TCP check verifies application responsiveness, when it only verifies that the port accepts a connection.

46
Multi-Selecthard

Which of the following are true regarding TTL checks? (Select TWO)

Select 2 answers
A.They require the app to push updates
B.They are automatically removed
C.They are faster than script checks
D.They are the only check without an interval
E.They are polled at a fixed interval
AnswersA, D

TTL checks are passive: the service must periodically PUT its status to Consul's agent endpoint, so health depends on the application actively pushing updates. Without that push, Consul marks the check critical after the TTL expires, satisfying the stem's requirement for a push-based mechanism.

Why this answer

Option A is correct because TTL-based checks rely on the application or service itself to push updates (e.g., via an API or heartbeat) before the TTL expires; the monitoring system does not actively poll, so the app must refresh the record to keep the check healthy. Option D is correct because TTL checks are event-driven rather than scheduled: instead of running on a fixed interval, they expire after a defined time-to-live, making them the only check type without a polling interval. Option B is wrong because TTL checks are not automatically removed; they transition to a failed/expired state when the TTL lapses unless the app pushes an update.

Option C is wrong because TTL checks are not inherently faster than script checks—speed depends on the push mechanism and network, not on the check type itself. Option E is wrong because TTL checks are explicitly not polled at a fixed interval; that description applies to standard interval-based checks.

Exam trap

Consul 1.15 often tests the misconception that TTL checks are polled like script checks, causing candidates to select the fixed-interval option instead of recognizing the push-based, interval-less nature.

47
Multi-Selecthard

Where can you define health checks in Consul? (Select THREE)

Select 3 answers
A.Agent configuration files
B.HTTP API
C.Consul UI
D.Consul KV store
E.Service definition files
AnswersA, B, E

Agent configuration files let you declare checks in the agent's own configuration, applying them to the node rather than a single service. This satisfies the question's requirement for defining checks, covering node-level and service-level checks.

Why this answer

Health checks in Consul can be defined in agent configuration files (A), where you place `check` blocks or `checks` arrays in HCL/JSON to register node-level or service-level checks that the agent loads at startup. They can also be defined via the HTTP API (B), using endpoints such as `PUT /v1/agent/check/register` to register a check at runtime, or within a service registration payload sent to `/v1/agent/service/register`. Service definition files (E) are also valid, since a service registration JSON/HCL file can include a `checks` array (or a single `check`) that defines checks tied to that service, commonly loaded via the agent's `services` configuration directory.

The Consul UI (C) is only for viewing and managing existing checks, not for authoring their definitions, and the Consul KV store (D) holds arbitrary key/value data and has no role in defining health checks.

Exam trap

The trap is confusing where Consul stores data (KV) with where it accepts configuration (agent config, service definitions, API); candidates often assume the UI or KV store can define checks because both are prominent Consul features.

48
MCQmedium

A Consul 1.15 operator needs to register a service with a health check that verifies the service is accepting TCP connections on port 9200. The check must run every 10 seconds. Which check configuration should be used?

A."check": { "ttl": "10s" }
B."check": { "script": "nc -z localhost 9200", "interval": "10s" }
C."check": { "tcp": "localhost:9200", "interval": "10s" }
D."check": { "http": "http://localhost:9200", "interval": "10s" }
AnswerC

This correctly configures a TCP health check that attempts to open a connection to localhost on port 9200 every 10 seconds. If the connection succeeds, the check is passing; if it fails, the service is marked critical. This is the appropriate check type for verifying that a service is listening on a specific TCP port without requiring HTTP or a script.

Why this answer

The TCP health check is designed to verify that a service is accepting TCP connections on a specified address and port. By setting the tcp field to localhost:9200 and an interval of 10s, Consul will attempt a connection every 10 seconds. This matches the requirement of checking TCP connectivity on port 9200 at the specified interval.

Exam trap

The trap here is confusing a TCP check with an HTTP check, which would send an HTTP request and expect a valid response, potentially marking the service unhealthy even when the TCP port is open.

49
Multi-Selectmedium

A team is standardizing health check definitions across a fleet of Consul 1.15 agents. They want checks that can be expressed entirely in HCL and do not require an external script interpreter on the node. Which two check types meet these criteria? (Choose two.)

Select 2 answers
B.docker
C.script
D.alias
E.tcp
AnswersA, E

The http check is defined declaratively in HCL with fields such as http, method, header, and tls_skip_verify. The agent performs the request itself using its internal HTTP client, so no external interpreter or binary is needed on the node. This makes it ideal for fleets where installing curl or a scripting runtime is undesirable, and it returns rich status based on the response code.

Why this answer

Both http and tcp checks are evaluated directly by the Consul agent using its internal networking stack, and both are fully declarable in HCL without any external interpreter or binary. Script and docker checks depend on external runtimes, while alias checks merely mirror other checks and are not standalone probes. This makes http and tcp the portable choices for a standardized fleet.

Exam trap

The trap here is treating alias as a self-contained probe because it is declarative, when it actually requires another check to exist and be healthy.

50
MCQeasy

In a Consul health check, what does the 'notes' field provide?

A.The trigger time
B.A human-readable description
C.The expected result
D.The logic for the check
AnswerB

The notes field carries a human-readable description attached to a health check, displayed in the Consul UI and API output to explain the check's purpose. It has no effect on check status evaluation or service registration behaviour.

Why this answer

The 'notes' field in a Consul health check is a free-form, human-readable string that operators use to document the purpose, ownership, or remediation guidance for the check. It is displayed in the Consul UI and API responses but has no effect on the check's pass/fail evaluation. This makes it purely informational metadata for operators and dashboards.

Exam trap

Consul 1.15 often tests confusion between 'notes' (human-readable metadata) and 'Output' (last check result message), causing candidates to pick the wrong field for describing check results.

How to eliminate wrong answers

Option A is wrong because the trigger time is not stored in 'notes'; timing is captured in fields like 'Status', 'Output', and the check's interval/timeout configuration. Option C is wrong because the expected result is defined by the check type itself (e.g., HTTP status 2xx, script exit code 0), not by 'notes'. Option D is wrong because the check logic is defined in the check definition (HTTP URL, TCP port, script, TTL), not in the 'notes' field.

51
MCQeasy

Which command line tool can you use to manually trigger a TTL check update for a specific service?

A.consul kv put
B.curl -X PUT http://localhost:8500/v1/agent/check/pass/checkID
C.consul agent -check-update
D.consul health update
AnswerB

Consul's HTTP API exposes agent check endpoints, so a PUT to /v1/agent/check/pass/checkID marks the named TTL check as passing and resets its timer. This is the documented manual method for pushing a TTL check update without waiting for the service to report.

Why this answer

The Consul HTTP API exposes agent check endpoints that allow external systems to push health status updates. A TTL check registered with the local agent can be manually marked passing by sending an HTTP PUT to /v1/agent/check/pass/<checkID> on port 8500. This is the documented mechanism for scripts and external monitors to report liveness without waiting for the TTL to expire.

Exam trap

The trap here is confusing the KV store API with the health check API — candidates who remember 'consul kv put' as the generic write command often pick it, forgetting that health state is managed through the agent check endpoints, not the KV store.

How to eliminate wrong answers

Option A is wrong because 'consul kv put' writes key/value pairs into the KV store and has no relationship to health check state. Option C is wrong because 'consul agent -check-update' is not a valid Consul CLI subcommand or flag; the agent command starts the agent process and does not accept a check-update argument. Option D is wrong because 'consul health update' does not exist — the 'consul health' subcommand only supports node, service, state, and checks queries, not updates.

52
MCQmedium

Which of the following is a valid method to update a TTL health check?

A.Using the 'consul kv' update
B.HTTP PUT to the /agent/check/pass endpoint
C.Consul CLI 'health' command
D.Editing the service definition file
AnswerB

HTTP PUT to `/agent/check/pass/<check_id>` lets the agent mark a TTL check passing, resetting its expiry timer. This satisfies the stem's requirement to update a TTL health check, since TTL checks are updated by external processes reporting status via the agent's HTTP API rather than by Consul polling a service.

Why this answer

TTL checks are updated by calling the Consul HTTP API's agent check endpoints — specifically an HTTP PUT to /v1/agent/check/pass/<check_id> (or /warn and /fail) — which resets the TTL timer and marks the check healthy. This is the canonical heartbeat mechanism for TTL checks.

Exam trap

Consul 1.15 often tests whether candidates know that TTL checks are updated via the agent HTTP API (PUT /v1/agent/check/pass), not via KV writes, CLI health reads, or config file edits.

How to eliminate wrong answers

Option A is wrong because 'consul kv' manipulates the key-value store, not health check state — KV writes have no effect on TTL timers. Option C is wrong because the 'consul health' CLI subcommand reads health information; it does not update a TTL check. Option D is wrong because editing the service definition file and reloading only re-registers the check with a fresh TTL window; it does not constitute the ongoing heartbeat that keeps the check passing.

53
MCQmedium

You are troubleshooting a health check that seems to be hanging. Which flag, if available, would provide more information about the check's execution within the agent logs?

A.-verbose
B.-log-level=debug
C.-monitor-checks
D.-trace
AnswerB

Raising the agent's log verbosity to debug makes Consul emit detailed health-check execution output, including script invocations and timing, which reveals where a hanging check stalls. The -log-level=debug flag therefore exposes the check's internal behaviour in the agent logs.

Why this answer

Increasing the agent's log level to 'debug' provides detailed information about check execution and processing.

54
MCQhard

When using the HTTP health check type, how can you verify that a specific header is included in the health check request?

A.By appending it to the URL string
B.It is not possible
C.By adding the 'header' object to the check definition
D.By setting the environment variable
AnswerC

The HTTP check's 'header' object accepts a map of header names to arrays of values, which Consul sends with each probe request. Defining it in the check block lets you assert that the specified header reaches the endpoint, satisfying the verification requirement.

Why this answer

In Consul's HTTP health check definition, you can specify custom headers using the 'header' object, which is a map of header names to arrays of values. This allows the health check request to include specific headers required by the application.

Exam trap

Consul 1.15 often tests whether candidates know that HTTP headers are configured via a dedicated 'header' object, not by modifying the URL or using environment variables.

How to eliminate wrong answers

Option A is wrong because appending a header to the URL string does not set an HTTP header; it would be part of the path or query string, not a header. Option B is wrong because Consul does support custom headers in HTTP checks via the header object. Option D is wrong because environment variables are not used to configure health check headers; that is not a Consul feature.

55
Multi-Selectmedium

What components can affect the outcome of a health check? (Select THREE)

Select 3 answers
A.Network connectivity
B.Client browser
C.Application responsiveness
D.Agent configuration
E.Consul server uptime
AnswersA, C, D

Blocks check traffic.

Why this answer

Network connectivity (A) is correct because a health check must be able to reach the target service or node over the network; if the path is blocked, the check fails regardless of the service's actual state. Application responsiveness (C) is correct because the check's result depends on whether the application actually answers within the configured timeout and returns the expected status. Agent configuration (D) is correct because settings such as check interval, timeout, and the check definition itself determine when and how the check runs and what result is reported.

The client browser (B) is not involved, since health checks are performed by agents or servers, not by end-user browsers. Consul server uptime (E) is not a direct component of an individual health check outcome, as checks are executed by the local agent and only aggregated by the servers.

Exam trap

Consul 1.15 often tests the misconception that Consul servers or client browsers affect health check outcomes, but the exam expects focus on agent-level and service-level factors.

56
MCQmedium

Which feature allows you to define a health check that depends on the health of another service?

A.Service dependency field
B.Cross-service monitoring
C.Service grouping
D.You must implement this logic in a script check
AnswerD

Consul's native health checks cannot reference another service's status, so dependency-aware health must be scripted. A script check queries the dependency's health endpoint or Consul API and returns the appropriate exit code, letting the registered service report unhealthy when its dependency fails.

Why this answer

Consul does not have a native 'service dependency' health check type. To make one service's health depend on another, you must implement the logic yourself, typically in a script check that queries the Consul API or DNS for the other service's health and returns an appropriate exit code. This is the documented and practical approach for cross-service health dependencies.

Exam trap

Consul 1.15 often tests the misconception that Consul has a built-in 'service dependency' health check type, when in reality you must implement it via a script check or the limited alias check.

How to eliminate wrong answers

Option A is wrong because there is no 'service dependency field' in Consul's service or check definition — no such configuration parameter exists. Option B is wrong because 'cross-service monitoring' is not a Consul feature; Consul health checks are scoped to a single service or node. Option C is wrong because 'service grouping' is not a Consul construct for health checks — services can be tagged or grouped logically, but that does not create a health dependency.

57
MCQmedium

What is the purpose of the 'check' field inside a 'service' object in a Consul configuration file?

A.To define the health status requirements
B.To provide credentials for the service
C.To enable service discovery
D.To set the service weight
AnswerA

The check field attaches a health check definition to the service, specifying the script, interval and status thresholds Consul uses to determine whether that service instance is healthy and should remain in DNS or catalog results.

Why this answer

In a Consul service definition, the check field (or checks array) declares one or more health checks associated with that service, such as HTTP, TCP, script, TTL, or gRPC checks. Consul uses these checks to determine whether the service instance is healthy and should be returned by DNS or the catalog API. The correct answer is that it defines the health status requirements for the service.

Exam trap

Consul 1.15 often tests the misconception that the check field enables discovery or stores credentials, when it strictly defines health evaluation criteria for the service.

How to eliminate wrong answers

Option B is wrong because credentials are not configured via the check field; authentication for checks is handled through headers, TLS, or ACL tokens, not the check definition itself. Option C is wrong because service discovery is enabled by registering the service with a name and port; the check field only governs health evaluation, not discovery. Option D is wrong because service weights are set in the Weights field of the service definition (used for DNS SRV weighting and load balancing), not in the check field.

58
MCQeasy

What is the consequence of having a service with no health checks registered?

A.The service status is 'passing'
B.The agent will error out
C.The service is ignored by DNS
D.The service is critical
AnswerA

Consul treats a service with no registered health checks as healthy by default, so its status is reported as passing. No check can fail, meaning the service remains in the catalog and receives traffic until checks are defined.

Why this answer

In Consul, a service registered without any health checks is treated as healthy by default, so its status is reported as 'passing'. Consul only marks a service as critical if an associated check fails; with no check defined, there is nothing to fail, so the service remains passing and is returned by DNS and service discovery queries.

Exam trap

The trap is assuming 'no health check' means 'unhealthy' — in Consul, absence of checks defaults to passing, which is the opposite of what many candidates expect.

How to eliminate wrong answers

Option B is wrong because the Consul agent does not error out when a service has no health checks — it simply registers the service with no checks attached, which is a valid configuration. Option C is wrong because the service is not ignored by DNS; with no failing check, it is considered passing and is included in DNS SRV/A records for the service. Option D is wrong because 'critical' status is only assigned when a defined check reports critical — absence of checks does not produce critical status.

59
MCQhard

An operations engineer registers an external PostgreSQL service on a Consul 1.15 client agent. The database listens on 10.20.30.40:5432 and is not managed by Consul, but a co-located exporter on the same VM exposes readiness at http://127.0.0.1:9187/ready. The engineer wants Consul to gate the service on the exporter's readiness signal while still advertising the database's real address and port to consumers. Which registration best achieves this?

A.Register only an http check named postgres-ready and rely on the check ID to imply the backing service.
B.Register the service with address 10.20.30.40 and port 5432, and attach an http check with target http://127.0.0.1:9187/ready.
C.Register the service with address 127.0.0.1 and port 9187, and attach a tcp check on the exporter port.
D.Register the service with address 10.20.30.40 and port 5432, and attach a tcp check to 10.20.30.40:5432 with a short interval.
AnswerB

The service block can advertise the database's genuine address and port independently of the check, and an http check may target any URL the agent can reach, including a loopback exporter. This keeps service discovery accurate while gating catalog health on the exporter. It is the cleanest way to monitor an unmanaged dependency through a sidecar signal without exposing the exporter as a service.

Why this answer

A service definition's address and port fields describe where consumers should connect, while checks are independent probes the agent executes. Pointing an http check at the loopback exporter while advertising the database's real endpoint gives accurate discovery plus a meaningful readiness gate. The other approaches either mispublish the endpoint, detach the check from the service, or substitute a weaker signal.

Exam trap

The trap here is believing the check must target the same address and port that the service advertises, when checks and service endpoints are configured independently.

60
Multi-Selectmedium

Which of the following conditions can cause a health check to transition to the 'critical' state? (Select TWO)

Select 2 answers
A.The HTTP check times out
B.The script returns a non-zero exit code
C.The service is idle
D.The service returns a 200 OK
E.The disk space is 50% full
AnswersA, B

An HTTP check transitions to critical when its request exceeds the configured timeout, since Consul cannot confirm the endpoint is healthy. The timeout constraint in the stem is satisfied because no successful response is received within the allowed interval, marking the service unhealthy.

Why this answer

Option A is correct because a health check that times out — for example, an HTTP/HTTPS check that fails to receive a response within its configured timeout interval — is treated as a failed check and drives the target into the 'critical' state. Option B is correct because a script-based health check that returns a non-zero exit code signals failure (exit code 0 conventionally means success), so the check is marked unhealthy and transitions to 'critical'. Options C, D, and E do not belong: an idle service is not inherently unhealthy, a 200 OK response is a successful HTTP status that keeps the check healthy, and 50% disk usage is well below typical warning/critical thresholds, so none of these would trigger a critical health state.

Exam trap

Consul 1.15 often tests the distinction between active health check failures (timeouts, non-zero exit codes) and passive indicators (idle service, disk usage) that do not directly trigger critical status unless explicitly configured in a custom check.

61
MCQeasy

An operator registers a service with a TTL check and forgets to send periodic updates. After the TTL expires, what status does Consul report for that check, and what is the immediate effect on service discovery?

A.The check becomes warning, and the service remains discoverable but is deprioritized in DNS results.
B.The check becomes critical, and healthy instances of the service are excluded from DNS and health API results.
C.The check remains passing until the agent restarts, because TTL expiry is evaluated lazily.
D.The check transitions to unknown, and the service is still returned by DNS with a warning flag.
AnswerB

When a TTL check is not updated within its TTL, Consul marks it critical. By default, DNS queries and the health API return only passing instances, so the service is effectively removed from the healthy set until an update is sent. This behaviour is the primary reason TTL checks require a reliable heartbeat mechanism from the service or its supervisor.

Why this answer

A TTL check must be updated within its TTL or the agent marks it critical. Because Consul's DNS and health API default to returning only passing instances, the service stops being discoverable as healthy until a new update arrives. This makes heartbeat reliability a critical design consideration for TTL-based checks.

Exam trap

The trap here is assuming an expired TTL degrades gracefully to warning, when it actually flips straight to critical and removes the instance from healthy discovery.

62
MCQeasy

An operator registers a web service with an HTTP health check. The check is configured with http = "http://localhost:8080/health" and method = "GET". The service's health endpoint returns HTTP 500 when the application is running but has a database connection problem. What status will Consul report for this check?

A.critical
B.passing
C.warning
D.maintenance
AnswerA

Consul's HTTP check marks the service critical for any HTTP response code outside the 2xx range, including 500. Since the endpoint returns 500 when the database connection fails, Consul reports critical. This correctly signals that the service is running but unhealthy and should not receive traffic.

Why this answer

Consul's HTTP health check considers only HTTP 2xx responses as passing. Any other response code, including 500, results in a critical status. The endpoint is reachable, but the server error indicates an unhealthy application state.

Warning and maintenance are not automatically applied based on HTTP status codes.

Exam trap

The trap here is assuming that a reachable HTTP endpoint always yields passing, or that a 500 response maps to warning instead of critical.

63
Multi-Selectmedium

A Consul administrator is reviewing how check results propagate and wants to understand which factors determine whether a service instance is considered healthy in the catalog. Which two factors directly determine a service's aggregate health status in Consul? (Choose two.)

Select 2 answers
A.The number of other services registered on the same agent
B.The Consul version running on the server that handles the catalog write
C.The datacenter in which the service is registered
D.The status of the node-level checks associated with the agent hosting the service
E.The status of the checks registered against that specific service instance
AnswersD, E

A service's aggregate health includes the status of the node on which it runs. If a node-level check such as the built-in serfHealth check is critical, the node is unhealthy and every service on that node is reported as unhealthy in catalog queries, even if the service's own check is passing.

Why this answer

Consul determines a service instance's health from two sources: the checks attached to that service and the checks attached to the node hosting it. A critical node check, such as a failed serfHealth, makes every service on that node unhealthy, while a critical service check makes only that instance unhealthy. Other attributes such as sibling service count, datacenter, or server version do not participate in the health computation.

Exam trap

The trap here is overlooking node-level checks and assuming only a service's own checks influence its health, when a failing node check marks every service on that node unhealthy.

64
MCQeasy

You are deploying a legacy application that does not support HTTP or TCP health checks. Which Consul health check type should you configure to allow the application to signal its own health via a heartbeat API call?

A.TTL check
B.HTTP check
C.TCP check
D.Script check
AnswerA

A TTL check inverts the model: the application must periodically call Consul's HTTP pass endpoint to reset the timer, and Consul marks it critical if the heartbeat lapses. This suits legacy apps lacking HTTP or TCP endpoints, since they signal health themselves.

Why this answer

A TTL check is designed exactly for this scenario: the service (or an external script) must periodically call Consul's HTTP API to mark itself healthy, and if the TTL elapses without an update, Consul marks the check critical. This lets a legacy application that cannot expose HTTP/TCP endpoints signal its own health via a heartbeat.

Exam trap

Consul 1.15 often tests the direction of the check — candidates confuse TTL (service pushes to Consul) with HTTP/TCP/script (Consul pulls from the service) and pick an active check for a passive application.

How to eliminate wrong answers

Option B is wrong because an HTTP check requires Consul to actively poll an HTTP endpoint on the service, which the legacy app cannot expose. Option C is wrong because a TCP check requires Consul to open a TCP connection to a port on the service, which the app also cannot provide. Option D is wrong because a script check runs a local command on the Consul agent node and interprets its exit code — it does not let the application push its own heartbeat.

65
MCQhard

A Consul cluster has a service registered with an HTTP health check pointing to https://10.0.0.5:8443/health. The check is failing with a TLS certificate verification error even though the service is healthy. The operator wants Consul to skip certificate verification for this specific check without disabling TLS globally. Which check configuration field should be set?

A.ca_file
B.verify_outgoing
C.tls_skip_verify
D.method
AnswerC

The tls_skip_verify field is a boolean on HTTP checks that instructs the Consul agent to skip TLS certificate verification for that specific check. Setting it to true allows the check to succeed against a service using a self-signed or otherwise untrusted certificate without altering global agent TLS settings. This is the correct targeted approach for the scenario.

Why this answer

HTTP health checks in Consul support a tls_skip_verify boolean that disables certificate verification for that individual check. This allows checks against services with self-signed or internal CA certificates to succeed without weakening the agent's global TLS posture. The other listed fields either apply to agent-level TLS settings or to unrelated aspects of the check request.

Exam trap

The trap here is assuming that agent-level TLS settings like verify_outgoing or ca_file apply to per-check HTTP requests, when Consul provides a dedicated per-check field for skipping verification.

Ready to test yourself?

Try a timed practice session using only Health Checking questions.