Skip to content

feat(http): new plugin for HTTP/HTTPS availability (replaces upstream check_http and check_curl) #1100

@markuslf

Description

@markuslf

Context

The plugin set has no native HTTP availability check. Admins fall back to
upstream Nagios check_http (deprecated) or check_curl (libcurl-based
successor). Both are wide-scope monolithic checks. CONTRIBUTING's
"one tool, one task" rule asks for narrow, single-threshold checks. This issue
migrates the HTTP availability subset to a Python plugin in our repo, leaving
certificate, TLS-compliance, security-header and freshness concerns to
dedicated siblings.

Scope

Plugin http. Single threshold axis: response time. All other behaviours are
pass/fail switches.

Parameters (named long form only, alphabetical):

  • --always-ok, --insecure, --no-proxy, --timeout
  • --url, --method, --data, --data-file, --content-type,
    --header (append), --user-agent
  • --auth-user, --auth-pass. Proxy configuration is read from the
    standard environment variables (http_proxy, https_proxy, no_proxy),
    including user:pass@ for proxy authentication. --no-proxy disables
    proxy use, in line with the project-wide convention.
  • --http-version 1.1|2|3, --tls-min 1.2|1.3
  • --resolve host:port:addr (curl-style; replaces upstream -I)
  • --use-ipv4, --use-ipv6
  • --expect-status (CSV; default 200..399)
  • --expect-body, --expect-body-regex,
    --expect-body-regex-flags i,s,
    --invert-expect-body-regex,
    --expect-body-state warning|critical
  • --expect-header (append; format Name: regex)
  • --page-size-min, --page-size-max
  • --on-redirect ok|warning|critical|follow|sticky|stickyport,
    --max-redirs
  • --no-body, --show-body, --cookie-jar, --accept-encoding
  • --lengthy
  • --warning, --critical: Nagios ranges over response time in seconds.
    Values accept compound human-duration syntax (e.g. 5s, 30s, 1m30s),
    parsed via lib.human.humanrange2seconds.

Out of scope (delegated to siblings)

  • Certificate days remaining, hostname match, chain verification: cert.
  • TLS protocol and cipher compliance: tls-compliance.
  • Security headers (HSTS, CSP, ...): security-headers.
  • Document freshness via Last-Modified: http-last-modified.

Perfdata: time, dns_time, connect_time, tls_time, ttfb,
transfer_time, size, status_code.

Dependencies

  • Linuxfabrik/lib#137.

Reference

  • Upstream check_curl.c for parameter coverage.
  • example plugin for structure, DESCRIPTION, README, unit tests.

Upstream lessons (from Nagios monitoring-plugins issues)

Test scenarios derived from upstream bugs

Classification

New plugin. Enhancement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions