diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/Makefile.am | 2 | ||||
| -rw-r--r-- | plugins/check_by_ssh.c | 17 | ||||
| -rw-r--r-- | plugins/check_snmp.c | 2 | ||||
| -rw-r--r-- | plugins/common.h | 2 |
4 files changed, 19 insertions, 4 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index a35f273e..2bea8fc0 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am | |||
| @@ -166,7 +166,7 @@ check_real_LDADD = $(NETLIBS) | |||
| 166 | check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c | 166 | check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c |
| 167 | check_snmp_LDADD = $(BASEOBJS) | 167 | check_snmp_LDADD = $(BASEOBJS) |
| 168 | check_snmp_LDFLAGS = $(AM_LDFLAGS) -lm `net-snmp-config --libs` | 168 | check_snmp_LDFLAGS = $(AM_LDFLAGS) -lm `net-snmp-config --libs` |
| 169 | check_snmp_CFLAGS = $(AM_CFLAGS) `net-snmp-config --cflags` | 169 | check_snmp_CFLAGS = $(AM_CFLAGS) `net-snmp-config --cflags | sed 's/-Werror=declaration-after-statement//'` |
| 170 | check_smtp_LDADD = $(SSLOBJS) | 170 | check_smtp_LDADD = $(SSLOBJS) |
| 171 | check_ssh_LDADD = $(NETLIBS) | 171 | check_ssh_LDADD = $(NETLIBS) |
| 172 | check_swap_SOURCES = check_swap.c check_swap.d/swap.c | 172 | check_swap_SOURCES = check_swap.c check_swap.d/swap.c |
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index 7ffa0ded..4d0c8e7d 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.c | |||
| @@ -41,6 +41,8 @@ const char *email = "devel@monitoring-plugins.org"; | |||
| 41 | # define NP_MAXARGS 1024 | 41 | # define NP_MAXARGS 1024 |
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | char *check_by_ssh_output_override(void *remote_output) { return ((char *)remote_output); } | ||
| 45 | |||
| 44 | typedef struct { | 46 | typedef struct { |
| 45 | int errorcode; | 47 | int errorcode; |
| 46 | check_by_ssh_config config; | 48 | check_by_ssh_config config; |
| @@ -155,10 +157,21 @@ int main(int argc, char **argv) { | |||
| 155 | xasprintf(&sc_active_check.output, "command stdout:"); | 157 | xasprintf(&sc_active_check.output, "command stdout:"); |
| 156 | 158 | ||
| 157 | if (child_result.out.lines > skip_stdout) { | 159 | if (child_result.out.lines > skip_stdout) { |
| 160 | |||
| 161 | char *remote_command_output = NULL; | ||
| 158 | for (size_t i = skip_stdout; i < child_result.out.lines; i++) { | 162 | for (size_t i = skip_stdout; i < child_result.out.lines; i++) { |
| 159 | xasprintf(&sc_active_check.output, "%s\n%s", sc_active_check.output, | 163 | if (i == skip_stdout) { |
| 160 | child_result.out.line[i]); | 164 | // first iteration |
| 165 | xasprintf(&remote_command_output, "%s", child_result.out.line[i]); | ||
| 166 | } else { | ||
| 167 | xasprintf(&remote_command_output, "%s\n%s", remote_command_output, | ||
| 168 | child_result.out.line[i]); | ||
| 169 | } | ||
| 161 | } | 170 | } |
| 171 | |||
| 172 | sc_active_check.output = remote_command_output; | ||
| 173 | overall.default_output_override_content = remote_command_output; | ||
| 174 | overall.default_output_override = check_by_ssh_output_override; | ||
| 162 | } else { | 175 | } else { |
| 163 | xasprintf(&sc_active_check.output, "remote command '%s' returned status %d", | 176 | xasprintf(&sc_active_check.output, "remote command '%s' returned status %d", |
| 164 | config.remotecmd, child_result.cmd_error_code); | 177 | config.remotecmd, child_result.cmd_error_code); |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index f470d222..1746fd79 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
| @@ -116,6 +116,7 @@ gen_state_string_type gen_state_string(check_snmp_state_entry *entries, size_t n | |||
| 116 | break; | 116 | break; |
| 117 | case ASN_FLOAT: | 117 | case ASN_FLOAT: |
| 118 | printf("Type FLOAT\n"); | 118 | printf("Type FLOAT\n"); |
| 119 | break; | ||
| 119 | case ASN_DOUBLE: | 120 | case ASN_DOUBLE: |
| 120 | printf("Type DOUBLE\n"); | 121 | printf("Type DOUBLE\n"); |
| 121 | break; | 122 | break; |
| @@ -217,6 +218,7 @@ recover_state_data_type recover_state_data(char *state_string, idx_t state_strin | |||
| 217 | break; | 218 | break; |
| 218 | case ASN_FLOAT: | 219 | case ASN_FLOAT: |
| 219 | printf("Type FLOAT\n"); | 220 | printf("Type FLOAT\n"); |
| 221 | break; | ||
| 220 | case ASN_DOUBLE: | 222 | case ASN_DOUBLE: |
| 221 | printf("Type DOUBLE\n"); | 223 | printf("Type DOUBLE\n"); |
| 222 | break; | 224 | break; |
diff --git a/plugins/common.h b/plugins/common.h index ef888d08..b3053486 100644 --- a/plugins/common.h +++ b/plugins/common.h | |||
| @@ -193,7 +193,7 @@ enum { | |||
| 193 | */ | 193 | */ |
| 194 | #include "../gl/gettext.h" | 194 | #include "../gl/gettext.h" |
| 195 | #define _(String) gettext(String) | 195 | #define _(String) gettext(String) |
| 196 | #if !ENABLE_NLS | 196 | #if !defined(ENABLE_NLS) || !ENABLE_NLS |
| 197 | # undef textdomain | 197 | # undef textdomain |
| 198 | # define textdomain(Domainname) /* empty */ | 198 | # define textdomain(Domainname) /* empty */ |
| 199 | # undef bindtextdomain | 199 | # undef bindtextdomain |
