Skip to content

Commit

Permalink
add option to set timeout return state (default is unknown)
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Mar 13, 2024
1 parent 0626dff commit d9a1407
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ linters-settings:
- performance
- style
- experimental
gocyclo:
min-complexity: 35
funlen:
lines: 140
lines: 160
statements: 85
gomoddirectives:
replace-local: true
Expand Down
2 changes: 1 addition & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This file documents the revision history for check_nsc_web

next:
- replace deprecated flag parser
- add option to set timeout return state (default is critical)
- add option to set timeout return state (default is unknown)

0.6.3 Wed Feb 28 12:50:51 2024 +0100
- minimum go version is now 1.21
Expand Down
4 changes: 2 additions & 2 deletions pkg/checknscweb/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Example:
Options:
-u <url> SNClient/NSCLient++ URL, for example https://10.1.2.3:8443
-t <seconds>[:<STATE>] Connection timeout in seconds. Optional set timeout state.
(0-3 or OK, WARNING, CRITICAL, UNKNOWN) Default: 10:CRITICAL
(0-3 or OK, WARNING, CRITICAL, UNKNOWN) Default: 10:UNKNOWN
-a <api version> API version of SNClient/NSClient++ (legacy or 1) Default: legacy
-l <username> REST webserver login. Default: admin
-p <password> REST webserver password
Expand Down Expand Up @@ -464,7 +464,7 @@ func parseFlags(osArgs []string, output io.Writer) (flags *flagSet, args []strin
flagSet.StringVar(&flags.Login, "l", "admin", "SNClient webserver login")
flagSet.StringVar(&flags.Password, "p", "", "SNClient webserver password")
flagSet.StringVar(&flags.APIVersion, "a", "legacy", "API version of SNClient (legacy or 1)")
flagSet.StringVar(&flags.Timeout, "t", "10:CRITICAL", "Connection timeout in seconds")
flagSet.StringVar(&flags.Timeout, "t", "10:UNKNOWN", "Connection timeout in seconds")
flagSet.BoolVar(&flags.Verbose, "v", false, "Enable verbose output")
flagSet.BoolVar(&flags.VeryVerbose, "vv", false, "Enable very verbose output (and log directly to stdout)")
flagSet.BoolVar(&flags.JSON, "j", false, "Print out JSON response body")
Expand Down

0 comments on commit d9a1407

Please sign in to comment.