diff options
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 |