turbot/cloudflare
steampipe plugin install cloudflare

Table: cloudflare_load_balancer_monitor - Query Cloudflare Load Balancer Monitors using SQL

Cloudflare Load Balancer Monitors are a feature of Cloudflare's Load Balancing service. They provide continuous checks on your servers to determine their health and direct traffic accordingly. Monitors help in managing traffic distribution, reducing latency, and improving data delivery speed.

Table Usage Guide

The cloudflare_load_balancer_monitor table provides insights into the configuration and status of Load Balancer Monitors within Cloudflare. As a Network Administrator, explore monitor-specific details through this table, including type, method, path, and timeout settings. Utilize it to uncover information about monitors, such as their current status, frequency of health checks, and the expected codes for successful checks.

Examples

Basic info

Explore which Cloudflare load balancer monitors have certain configurations to optimize performance and reliability. This can help in identifying any monitors that may need adjustments for better load balancing and error handling.

select
id,
type,
path,
timeout,
retries,
interval,
port,
expected_codes
from
cloudflare_load_balancer_monitor;
select
id,
type,
path,
timeout,
retries,
interval,
port,
expected_codes
from
cloudflare_load_balancer_monitor;

Get information of monitors attached to pool

Explore which monitors are attached to specific load balancer pools in Cloudflare. This query is useful for gaining insights into the configuration and status of your load balancing setup, including details like pool ID, name, and notification email.

select
p.id as pool_id,
p.name as pool_name,
p.enabled as pool_enabled,
p.notification_email,
m.id as monitor_id,
m.description monitor_description
from
cloudflare_load_balancer_pool p,
cloudflare_load_balancer_monitor as m
where
p.monitor = m.id;
select
p.id as pool_id,
p.name as pool_name,
p.enabled as pool_enabled,
p.notification_email,
m.id as monitor_id,
m.description as monitor_description
from
cloudflare_load_balancer_pool p,
cloudflare_load_balancer_monitor m
where
p.monitor = m.id;

Schema for cloudflare_load_balancer_monitor

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
allow_insecurebooleanDo not validate the certificate when monitor use HTTPS. Only valid if type is "http" or "https".
created_ontimestamp with time zoneTimestamp when the load balancer monitor was created.
descriptiontextMonitor description.
expected_bodytextA case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. Only valid if type is "http" or "https". Default: "".
expected_codestextThe expected HTTP response code or code range of the health check. Eg 2xx. Only valid and required if type is "http" or "https".
follow_redirectsbooleanFollow redirects if returned by the origin. Only valid if type is "http" or "https".
headerjsonbThe HTTP request headers to send in the health check. It is recommended you set a Host header by default. The User-Agent header cannot be overridden. Fields documented below. Only valid if type is "http" or "https".
idtextLoad balancer monitor API item identifier.
intervalbigintThe interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations. Default: 60.
methodtextThe method to use for the health check. Valid values are any valid HTTP verb if type is "http" or "https", or connection_established if type is "tcp". Default: "GET" if type is "http" or "https", or "connection_established" if type is "tcp" .
modified_ontimestamp with time zoneTimestamp when the load balancer monitor was last modified.
pathtextThe endpoint path to health check against. Default: "/". Only valid if type is "http" or "https".
portbigintThe port number to use for the healthcheck, required when creating a TCP monitor. Valid values are in the range 0-65535
probe_zonetextAssign this monitor to emulate the specified zone while probing. Only valid if type is "http" or "https".
retriesbigintThe number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Default: 2.
timeoutbigintThe timeout (in seconds) before marking the health check as failed. Default: 5.
typetextThe protocol to use for the healthcheck. Currently supported protocols are "HTTP", "HTTPS" and "TCP". Default: "http".

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- cloudflare

You can pass the configuration to the command with the --config argument:

steampipe_export_cloudflare --config '<your_config>' cloudflare_load_balancer_monitor