Skip to content

Commit

Permalink
v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
danielb42 committed Oct 22, 2020
1 parent 2a6aedb commit 54fe5af
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
Binary file removed artifacts/sensu-webwhois_v2.0.0_linux_amd64.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion artifacts/sensu-webwhois_v2.0.0_sha512_checksums.txt

This file was deleted.

Binary file not shown.
1 change: 1 addition & 0 deletions artifacts/sensu-webwhois_v2.0.1_sha512_checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
90b3d3bc4cee2aed5544bc97722d497f192cf279ea0a4f71900b0feb34e1989e1e680909e1765f1c1f519a235bbd986c4700988befade34fe0290755cf439430 sensu-webwhois_v2.0.1_linux_amd64.tar.gz
Binary file modified bin/sensu-webwhois
Binary file not shown.
14 changes: 13 additions & 1 deletion cmd/sensu-webwhois/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ var (
stringToLookFor = "ist bereits registriert"
timeBegin = time.Now()
httpResp *http.Response
fails int
)

func main() {
run()
}

func run() {

var err error
log.SetOutput(os.Stderr)
Expand Down Expand Up @@ -46,7 +51,6 @@ func main() {
if err != nil {
printFailMetricsAndExit(err.Error())
}
defer httpResp.Body.Close()

webwhoisResponseTime := time.Since(timeBegin).Milliseconds()

Expand All @@ -66,10 +70,18 @@ func main() {
} else {
printFailMetricsAndExit("webwhois output did not contain", "'"+stringToLookFor+"'")
}

httpResp.Body.Close()
os.Exit(0)
}

func printFailMetricsAndExit(errors ...string) {

if fails < 3 {
fails++
run()
}

var statusCode int

if httpResp != nil {
Expand Down
4 changes: 2 additions & 2 deletions sensu/asset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ api_version: core/v2
metadata:
name: sensu-webwhois
spec:
sha512: bccfa992c122981f5613c8bbb64e1b391377ace4baf21e1f94b06c08b774c244b6c06347f70ced74a2af33d574a1889f8c0df64229fe19d06f038af2e2ce7a55
url: https://github.com/DENICeG/sensu-webwhois/releases/download/v2.0.0/sensu-webwhois_v2.0.0_linux_amd64.tar.gz
sha512: 90b3d3bc4cee2aed5544bc97722d497f192cf279ea0a4f71900b0feb34e1989e1e680909e1765f1c1f519a235bbd986c4700988befade34fe0290755cf439430
url: https://github.com/DENICeG/sensu-webwhois/releases/download/v2.0.1/sensu-webwhois_v2.0.1_linux_amd64.tar.gz

0 comments on commit 54fe5af

Please sign in to comment.