diff options
| author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-04-04 13:09:15 +0200 |
|---|---|---|
| committer | Andreas Baumann <mail@andreasbaumann.cc> | 2019-04-04 13:09:15 +0200 |
| commit | 2f4d6764d78cf085601b34ac92486405bd11095d (patch) | |
| tree | 550601dc79e74fd4c184dc96a95687d1d1238b43 /lib/utils_base.c | |
| parent | faea5899ba3264581bf75649e4b399d0b69bd125 (diff) | |
| parent | 5f16ba81c4af1a05e67806ca989a1dd46248a5fd (diff) | |
| download | monitoring-plugins-2f4d6764d78cf085601b34ac92486405bd11095d.tar.gz | |
Merge branch 'master' into feature_check_curl
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 19a531f5..fd7058da 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 |
