diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-13 00:43:22 +0100 |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-03-13 00:43:22 +0100 |
commit | d5ed6a2d8f3f3f388e5d1f2f7a8fc3ee2c9b6007 (patch) | |
tree | a1e49d438fe891e3e78949d36c7cfacbb5128fe4 /plugins/check_tcp.d | |
parent | 554bf3e5256f5489aed0cd56f0c600bcb281a7f5 (diff) | |
download | monitoring-plugins-d5ed6a2d8f3f3f388e5d1f2f7a8fc3ee2c9b6007.tar.gz |
check_tcp: small improvement + output format picker
Diffstat (limited to 'plugins/check_tcp.d')
-rw-r--r-- | plugins/check_tcp.d/config.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/check_tcp.d/config.h b/plugins/check_tcp.d/config.h index 7ecf51a6..41db7224 100644 --- a/plugins/check_tcp.d/config.h +++ b/plugins/check_tcp.d/config.h | |||
@@ -1,10 +1,10 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #include "../common.h" | ||
4 | #include "../../lib/utils_tcp.h" | 3 | #include "../../lib/utils_tcp.h" |
4 | #include "output.h" | ||
5 | #include <netinet/in.h> | 5 | #include <netinet/in.h> |
6 | 6 | ||
7 | typedef struct check_tcp_config { | 7 | typedef struct { |
8 | char *server_address; | 8 | char *server_address; |
9 | bool host_specified; | 9 | bool host_specified; |
10 | int server_port; // TODO can this be a uint16? | 10 | int server_port; // TODO can this be a uint16? |
@@ -37,6 +37,9 @@ typedef struct check_tcp_config { | |||
37 | ssize_t maxbytes; | 37 | ssize_t maxbytes; |
38 | 38 | ||
39 | bool hide_output; | 39 | bool hide_output; |
40 | |||
41 | bool output_format_set; | ||
42 | mp_output_format output_format; | ||
40 | } check_tcp_config; | 43 | } check_tcp_config; |
41 | 44 | ||
42 | check_tcp_config check_tcp_config_init() { | 45 | check_tcp_config check_tcp_config_init() { |
@@ -73,6 +76,8 @@ check_tcp_config check_tcp_config_init() { | |||
73 | .maxbytes = 0, | 76 | .maxbytes = 0, |
74 | 77 | ||
75 | .hide_output = false, | 78 | .hide_output = false, |
79 | |||
80 | .output_format_set = false, | ||
76 | }; | 81 | }; |
77 | return result; | 82 | return result; |
78 | } | 83 | } |