Repository navigation
feat: add HTTP/HTTPS forward proxy support with HTTP CONNECT tunneling - #21
Merged
Merged
Conversation
sni
reviewed
Nov 20, 2026
| check_snclient is a REST client for the NSClient++/SNClient webserver for querying | ||
| and receiving check information over HTTP(S). | ||
| Version: |
Author
There was a problem hiding this comment.
gpineda@thinkpad-e15g2:~/Documents/gpineda-dev/check_snclient$ ./check_snclient --help
Usage:
check_snclient [options] [query parameters]
Description:
check_snclient is a REST client for the NSClient++/SNClient webserver for querying
and receiving check information over HTTP(S).
Version:
check_snclient v0.7.6
It was an initiative to realign the cli usage described in the readme with the actual output.
By copying the output directly in the documentation (maybe a to lazy approach to include the new proxy options.
Feel free to remove it since this depends on the compiled version.
|
that's a lot of text... Looks good in general, only a small question about the version in the readme. |
|
thanks for your contribution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
First, thank you for SNClient and
check_snclient-- it's a fantastic monitoring ecosystem that we rely on daily.Also, it is truly great and reassuring to see the recent momentum around OMD-Labs (website revamp, renewed commit activity)! This direction is very exciting, especially as it paves the way for modern hybrid monitoring architectures bridging Naemon with Prometheus (
check_prometheus), VictoriaMetrics, and Nagflux (eg. long term metrics vs metric lake).Context & Motivation
In our monitoring setup with Naemon / OMD-Labs, we regularly need to monitor isolated servers located in private subnets or DMZs that cannot be contacted directly from the monitoring core.
While SNClient allows configuring cascaded checks (e.g.
Naemon -> SNClient on Gateway A -> check_snclient to Server B), we found that routing checks through a standard L4 Forward Proxy (HTTP CONNECT) brings major architectural, security, and operational benefits:HTTP CONNECTcreates a raw Layer-4 TCP tunnel. The proxy does not terminate or decrypt TLS; certificate validation and mTLS happen directly between Naemon and the target agent.access.logrecords (source IP, target IP:port, HTTP CONNECT status, bytes transferred) suitable for SIEM auditing, and proxy ACLs can restrict traffic strictly to port 8443.parents): Gateway A is configured as the nativeparentshost for Server B. If the gateway goes down, Naemon marks Server B asUNREACHABLEinstead ofDOWN, naturally preventing alert storms.snclient.iniconfigs or wrapped command definitions on intermediate gateways; all monitoring logic remains centralized in Naemon.Implementation: Pure Go Standard Library
I wanted to keep this change as minimal, non-intrusive, and robust as possible.
No external dependencies were added. We simply leveraged Go's native
net/httpandcrypto/tlstransport capabilities:-proxyis omitted,check_snclientconnects directly without reading ambient environment variables, ensuring existing checks are never affected ifHTTP_PROXYis set on the system.-proxy <url>supportshttp://,https://, andsocks5://(with auto-prepending ofhttp://if omitted), as well as Basic Authentication (http://user:pass@proxy:port).-proxy env(orCHECK_SNCLIENT_PROXY=env) explicitly activates Go's standardhttp.ProxyFromEnvironment(HTTP_PROXY,HTTPS_PROXY,NO_PROXY).-proxy noneor-proxy directforces direct connections even if proxy environment variables exist.Verification: E2E Testbed Built with Gemini Flash 3.8
Beyond Go unit tests (
go test ./...), I have been seeking for real-world guarantees thatHTTP CONNECTtunneling and407 Proxy Authentication Requiredchallenges work seamlessly against real daemons (not synthetic in-memory mocks).To achieve reproducible black-box testing, I designed an E2E test forge pair-programming with Gemini Flash 3.8. It orchestrates a live SNClient daemon and Tinyproxy forward proxy via Ansible playbooks, running Testinfra assertions with live command tracing:
Looking forward to your feedback and thoughts!