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_codesfrom cloudflare_load_balancer_monitor;
select id, type, path, timeout, retries, interval, port, expected_codesfrom 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_descriptionfrom cloudflare_load_balancer_pool p, cloudflare_load_balancer_monitor as mwhere 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_descriptionfrom cloudflare_load_balancer_pool p, cloudflare_load_balancer_monitor mwhere p.monitor = m.id;
Schema for cloudflare_load_balancer_monitor
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
allow_insecure | boolean | Do not validate the certificate when monitor use HTTPS. Only valid if type is "http" or "https". | |
created_on | timestamp with time zone | Timestamp when the load balancer monitor was created. | |
description | text | Monitor description. | |
expected_body | text | A 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_codes | text | The expected HTTP response code or code range of the health check. Eg 2xx. Only valid and required if type is "http" or "https". | |
follow_redirects | boolean | Follow redirects if returned by the origin. Only valid if type is "http" or "https". | |
header | jsonb | The 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". | |
id | text | Load balancer monitor API item identifier. | |
interval | bigint | The 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. | |
method | text | The 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_on | timestamp with time zone | Timestamp when the load balancer monitor was last modified. | |
path | text | The endpoint path to health check against. Default: "/". Only valid if type is "http" or "https". | |
port | bigint | The port number to use for the healthcheck, required when creating a TCP monitor. Valid values are in the range 0-65535 | |
probe_zone | text | Assign this monitor to emulate the specified zone while probing. Only valid if type is "http" or "https". | |
retries | bigint | The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately. Default: 2. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
timeout | bigint | The timeout (in seconds) before marking the health check as failed. Default: 5. | |
type | text | The protocol to use for the healthcheck. Currently supported protocols are "HTTP", "HTTPS" and "TCP". Default: "http". | |
user_id | text | =, !=, ~~, ~~*, !~~, !~~* | ID of the current user. |
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