diff --git a/docs/checks/plugins/check_dns.md b/docs/checks/plugins/check_dns.md index ff065ae..f00e000 100644 --- a/docs/checks/plugins/check_dns.md +++ b/docs/checks/plugins/check_dns.md @@ -57,7 +57,9 @@ Application Options: -p, --port= Port number you want to use (default: 53) -q, --querytype= DNS record query type (default: A) --norec Set not recursive mode - -e, --expected-string= IP-ADDRESS string you expect the DNS server to return. If multiple IP-ADDRESS are returned at once, you have to specify whole string + -e, --expected-string= IP-ADDRESS string you expect the DNS server to return. + If multiple IP-ADDRESS are returned at once, you have + to specify whole string Help Options: -h, --help Show this help message diff --git a/docs/checks/plugins/check_http.md b/docs/checks/plugins/check_http.md index 893a90f..5c5460b 100644 --- a/docs/checks/plugins/check_http.md +++ b/docs/checks/plugins/check_http.md @@ -58,10 +58,14 @@ Naemon Config Application Options: --timeout= Timeout to wait for connection (default: 10s) - --max-buffer-size= Max buffer size to read response body (default: 1MB) - --no-discard raise error when the response body is larger then max-buffer-size - --consecutive= number of consecutive successful requests required (default: 1) - --interim= interval time after successful request for consecutive mode (default: 1s) + --max-buffer-size= Max buffer size to read response body + (default: 1MB) + --no-discard raise error when the response body is larger + then max-buffer-size + --consecutive= number of consecutive successful requests + required (default: 1) + --interim= interval time after successful request for + consecutive mode (default: 1s) --wait-for retry until successful when enabled --wait-for-interval= retry interval (default: 2s) --wait-for-max= time to wait for success @@ -70,11 +74,13 @@ Application Options: -p, --port= Port number -j, --method= Set HTTP Method (default: GET) -u, --uri= URI to request (default: /) - -e, --expect= Comma-delimited list of expected HTTP response status + -e, --expect= Comma-delimited list of expected HTTP + response status -s, --string= String to expect in the content --base64-string= Base64 Encoded string to expect the content -A, --useragent= UserAgent to be sent (default: check_http) - -a, --authorization= username:password on sites with basic authentication + -a, --authorization= username:password on sites with basic + authentication -S, --ssl use https --sni enable SNI --tls-max=[1.0|1.1|1.2|1.3] maximum supported TLS version diff --git a/docs/checks/plugins/check_tcp.md b/docs/checks/plugins/check_tcp.md index aeb2d07..4894f98 100644 --- a/docs/checks/plugins/check_tcp.md +++ b/docs/checks/plugins/check_tcp.md @@ -62,18 +62,31 @@ Application Options: -p, --port= Port number -s, --send= String to send to the server -e, --expect-pattern= Regexp pattern to expect in server response - -q, --quit= String to send server to initiate a clean close of the connection + -q, --quit= String to send server to initiate a clean close + of the connection -S, --ssl Use SSL for the connection. -U, --unix-sock= Unix Domain Socket --no-check-certificate Do not check certificate -t, --timeout= Seconds before connection times out (default: 10) - -m, --maxbytes= Close connection once more than this number of bytes are received - -d, --delay= Seconds to wait between sending string and polling for response - -w, --warning= Response time to result in warning status (seconds) - -c, --critical= Response time to result in critical status (seconds) - -E, --escape Can use \n, \r, \t or \ in send or quit string. Must come before send or quit option. By default, nothing added to send, \r\n added to end of quit - -W, --error-warning Set the error level to warning when exiting with unexpected error (default: critical). In the case of request succeeded, evaluation result of -c option eval takes priority. - -C, --expect-closed Verify that the port/unixsock is closed. If the port/unixsock is closed, OK; if open, follow the ErrWarning flag. This option only verifies the connection. + -m, --maxbytes= Close connection once more than this number of + bytes are received + -d, --delay= Seconds to wait between sending string and + polling for response + -w, --warning= Response time to result in warning status + (seconds) + -c, --critical= Response time to result in critical status + (seconds) + -E, --escape Can use \n, \r, \t or \ in send or quit string. + Must come before send or quit option. By default, + nothing added to send, \r\n added to end of quit + -W, --error-warning Set the error level to warning when exiting with + unexpected error (default: critical). In the case + of request succeeded, evaluation result of -c + option eval takes priority. + -C, --expect-closed Verify that the port/unixsock is closed. If the + port/unixsock is closed, OK; if open, follow the + ErrWarning flag. This option only verifies the + connection. Help Options: -h, --help Show this help message diff --git a/pkg/snclient/builtin_check.go b/pkg/snclient/builtin_check.go index c56c060..f77846d 100644 --- a/pkg/snclient/builtin_check.go +++ b/pkg/snclient/builtin_check.go @@ -5,6 +5,7 @@ import ( "context" "fmt" "io" + "os" "regexp" "strings" ) @@ -72,6 +73,9 @@ func (l *CheckBuiltin) Check(ctx context.Context, snc *Agent, check *CheckData, } func (l *CheckBuiltin) Help(ctx context.Context, snc *Agent, check *CheckData, format ShowHelp) (out string) { + // use fixed size when printing help pages + os.Setenv("COLS", "80") + check.rawArgs = []string{"--help"} res, _ := l.Check(ctx, snc, check, []Argument{})