summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.org>2019-02-19 20:42:02 (GMT)
committerGitHub <noreply@github.com>2019-02-19 20:42:02 (GMT)
commit931ed78b5dc062fff33652d87406f1547da5ddbe (patch)
tree9caf8031a15d7f046e77693c4002bf750bfef3d3 /lib/utils_base.c
parent2813d08b92d08ba56ec22da00a23fff3a22ed74b (diff)
parent7cafb0e84550035fe671662c293122be975065ca (diff)
downloadmonitoring-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.c19
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
38monitoring_plugin *this_monitoring_plugin=NULL; 38monitoring_plugin *this_monitoring_plugin=NULL;
39 39
40unsigned int timeout_state = STATE_CRITICAL;
41unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
42
40int _np_state_read_file(FILE *); 43int _np_state_read_file(FILE *);
41 44
42void np_init( char *plugin_name, int argc, char **argv ) { 45void 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
365const char *
366state_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