diff options
author | Sven Nierlein <sven@nierlein.org> | 2019-02-19 20:42:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-19 20:42:02 (GMT) |
commit | 931ed78b5dc062fff33652d87406f1547da5ddbe (patch) | |
tree | 9caf8031a15d7f046e77693c4002bf750bfef3d3 /lib/utils_base.c | |
parent | 2813d08b92d08ba56ec22da00a23fff3a22ed74b (diff) | |
parent | 7cafb0e84550035fe671662c293122be975065ca (diff) | |
download | monitoring-plugins-931ed78b5dc062fff33652d87406f1547da5ddbe.tar.gz |
Merge pull request #1583 from sni/fix_check_by_ssh_timeout_child_leak
check_by_ssh: fix child process leak on timeouts
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r-- | lib/utils_base.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index 19a531f..fd7058d 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -37,6 +37,9 @@ | |||
37 | 37 | ||
38 | monitoring_plugin *this_monitoring_plugin=NULL; | 38 | monitoring_plugin *this_monitoring_plugin=NULL; |
39 | 39 | ||
40 | unsigned int timeout_state = STATE_CRITICAL; | ||
41 | unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT; | ||
42 | |||
40 | int _np_state_read_file(FILE *); | 43 | int _np_state_read_file(FILE *); |
41 | 44 | ||
42 | void np_init( char *plugin_name, int argc, char **argv ) { | 45 | void np_init( char *plugin_name, int argc, char **argv ) { |
@@ -359,6 +362,22 @@ char *np_extract_value(const char *varlist, const char *name, char sep) { | |||
359 | return value; | 362 | return value; |
360 | } | 363 | } |
361 | 364 | ||
365 | const char * | ||
366 | state_text (int result) | ||
367 | { | ||
368 | switch (result) { | ||
369 | case STATE_OK: | ||
370 | return "OK"; | ||
371 | case STATE_WARNING: | ||
372 | return "WARNING"; | ||
373 | case STATE_CRITICAL: | ||
374 | return "CRITICAL"; | ||
375 | case STATE_DEPENDENT: | ||
376 | return "DEPENDENT"; | ||
377 | default: | ||
378 | return "UNKNOWN"; | ||
379 | } | ||
380 | } | ||
362 | 381 | ||
363 | /* | 382 | /* |
364 | * Read a string representing a state (ok, warning... or numeric: 0, 1) and | 383 | * Read a string representing a state (ok, warning... or numeric: 0, 1) and |