webmon

command module
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 21 Imported by: 0

README

webmon

GitHub tag (latest by date) Codecov Build Go Report Card GitHub

Monitors website update, latency & certificate expiry.

Running

Command line arguments
usage: webmon [<flags>] [<hosts>...]

webmon

Flags:
-h, --help            Show context-sensitive help (also try --help-long and --help-man).
-v, --version         Show application version.
--port=8080           Metrics listener port
--debug               Log debug messages
--interval=1m         Measurement interval
--watch               Watch k8s CRDs for target hosts
--watch.namespace=""  Namespace to watch for CRDs (default: all namespaces
--watch.kubeconfig=WATCH.KUBECONFIG  
~/.kube/config

Args:
[<hosts>]  hosts to ping
Kubernetes

When running in a Kubernetes cluster, sites to monitor can be provisioned through custom resources. To install these, apply the crd.yml file in this repo. When RBAC is enabled in your cluster, you will also need to apply rbac.yml.

Once the CRD is installed, add any site to monitor by created the following custom resource:

apiVersion: webmon.clambin.private/v1
kind: Target
metadata:
  name: <name>
  namespace: <namespace>
spec:
  url: https://your.url.here

Metrics

Webmon exposes the following metrics to Prometheus:

* webmon_site_up: Set to 1 if the site is up
* webmon_site_latency_seconds: Time to check the site, in seconds
* webmon_certificate_expiry: Number of days before the HTTPS certificate expires

Acknowledgements

  • Martin Helmich's excellent article on accessing Kubernetes CRDs in Go.

Author

  • Christophe Lambin

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
crds
targets/api/types/v1
Package v1 data structures and supporting functions for the Target CRD V1 layout is as follows: apiVersion: webmon.clambin.private/v1 kind: Target metadata: name: <name> namespace: <namespace> spec: url: https://example.com
Package v1 data structures and supporting functions for the Target CRD V1 layout is as follows: apiVersion: webmon.clambin.private/v1 kind: Target metadata: name: <name> namespace: <namespace> spec: url: https://example.com
targets/clientset/v1
Package v1 Client for Target CRD
Package v1 Client for Target CRD

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL