Categorygithub.com/myena/hcheck
modulepackage
0.0.0-20180601203420-ad9e63181cf8
Repository: https://github.com/myena/hcheck.git
Documentation: pkg.go.dev

# README

Mozilla Public License Go Report Card

hcheck

Summary

This repo povides a very simple tool called hcheck that will check the HTTP return code of a given URL and verify it matches your expected code. This tool is useful to ensure expected results when ran in parrallel with load testing activity. The tool can operate in a one-and-done mode or consistently polling in the foreground and logging any unexpected result.

In addition to checking the return code, we use nathanejohnson/intransport when fetching secure resources to automatically fetch intermediate certificates and do full chain verification including stapled OCSP responses.

Installing

Users with a proper Go environment (1.8+ required) ...

go get -u github.com/myENA/hcheck

Developers that wish to take advantage of vendoring and other options ...

git clone https://github.com/myENA/hcheck.git
cd hcheck
make

Usage

Summary

ahurt$ ./hcheck
Usage: hcheck [--version] [--help] <command> [<args>]

Available commands are:
    check    Validate host return code and exit.
    watch    Poll target host and validate return code.

Common Options

OptionDescriptionDefault
urlThe fully qualified URL to checkempty
codeThe expected return code200
timeoutTime to wait for a response5s
insecureSkip TLS validationfalse

Watch Specific Options

OptionDescriptionDefault
intervalWatch poll interval5s

Example

ahurt$ ./hcheck check -url www.google.com -code 400
2018/06/01 14:44:13 [Error] Check failed: expected 400, got 200
ahurt$ echo $?
1

# Packages

No description provided by the author