Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Commit 20c2653

Browse files
author
Michael Kraus
committed
add idelconn timeout, handle http 403 and fix extratext
1 parent 46ed427 commit 20c2653

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

check_nsc_web.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
// - strip trailing / from url
2222
// - what about value being int64 in legacy api in PerfLine struct?
2323

24-
const AppVersion = "0.5.1"
24+
const AppVersion = "0.5.2"
2525

2626
var usage = `
2727
check_nsc_web is a REST client for the NSClient++ webserver for querying
@@ -222,6 +222,7 @@ func main() {
222222
}).Dial,
223223
ResponseHeaderTimeout: timeout,
224224
TLSHandshakeTimeout: timeout,
225+
IdleConnTimeout: timeout,
225226
}
226227
var hClient = &http.Client{
227228
Timeout: timeout,
@@ -336,9 +337,9 @@ func main() {
336337
}
337338

338339
if nagiosPerfdata.Len() == 0 {
339-
fmt.Println(nagiosMessage)
340+
fmt.Println(nagiosMessage + " " + flagExtratext)
340341
} else {
341-
fmt.Println(nagiosMessage + "|" + strings.TrimSpace(nagiosPerfdata.String()))
342+
fmt.Println(nagiosMessage + " " + flagExtratext + "|" + strings.TrimSpace(nagiosPerfdata.String()))
342343
}
343344
os.Exit(queryResult.Result)
344345
}

0 commit comments

Comments
 (0)