https://github.com/netways/go-check-network
go-check-network is a collection of modules for the development of monitoring plugins that use network protocols
https://github.com/netways/go-check-network
golang icinga monitoring
Last synced: 9 months ago
JSON representation
go-check-network is a collection of modules for the development of monitoring plugins that use network protocols
- Host: GitHub
- URL: https://github.com/netways/go-check-network
- Owner: NETWAYS
- License: gpl-2.0
- Created: 2023-09-27T09:24:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-03T06:24:10.000Z (over 1 year ago)
- Last Synced: 2025-02-05T06:44:25.284Z (10 months ago)
- Topics: golang, icinga, monitoring
- Language: Go
- Homepage:
- Size: 40 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# go-check-network
go-check-network is a collection of modules for the development of monitoring plugins using network protocols.
See also:
* https://github.com/NETWAYS/go-check
We decided to create a dedicated collection for this code to keep the `go-check` module small and focused. Multiple modules within this repository help to reduce dependencies for downstream projects.
## http
The `checkhttp` module provides packages for the HTTP protocol.
### config
The go-check-network/http/config package provides helpers to configure HTTP connections (e.g. RoundTrippers, TLSConfig, etc.)
Examples:
```
import "github.com/NETWAYS/go-check-network/http/config"
// Example for TLSConfig from files
tlsConfig, err := checkhttp.NewTLSConfig(&checkhttpconfig.TLSConfig{
InsecureSkipVerify: false,
CAFile: myCAFile,
KeyFile: myKeyFile,
CertFile: myCertFile,
})
// Some sane defaults
var rt http.RoundTripper = &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext,
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: tlsConfig,
}
// Example for Token Auth Roundtripper
rt = checkhttpconfig.NewAuthorizationCredentialsRoundTripper("Bearer", "secret-bearer-token", rt)
// Example for Basic Auth Roundtripper
rt = checkhttpconfig.NewBasicAuthRoundTripper("my-user", "password123", rt)
```
### mock
The go-check-network/http/config package provides additions to the jarcoal/httpmock module.
# License
Copyright (c) 2023 [NETWAYS GmbH](https://www.netways.de/)
This library is distributed under the GPL-2.0 or newer license found in the [COPYING](./COPYING)
file.