summaryrefslogtreecommitdiffstats
path: root/plugins/check_snmp.d/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_snmp.d/config.h')
-rw-r--r--plugins/check_snmp.d/config.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/plugins/check_snmp.d/config.h b/plugins/check_snmp.d/config.h
index e68986e2..a5d5aa52 100644
--- a/plugins/check_snmp.d/config.h
+++ b/plugins/check_snmp.d/config.h
@@ -1,7 +1,7 @@
1#pragma once 1#pragma once
2 2
3#include "thresholds.h" 3#include "../../lib/thresholds.h"
4#include "states.h" 4#include "../../lib/states.h"
5#include <stdlib.h> 5#include <stdlib.h>
6#include <stdbool.h> 6#include <stdbool.h>
7#include <regex.h> 7#include <regex.h>
@@ -18,7 +18,7 @@
18#include <net-snmp/library/snmp.h> 18#include <net-snmp/library/snmp.h>
19#include <net-snmp/session_api.h> 19#include <net-snmp/session_api.h>
20 20
21#define DEFAULT_PORT "161" 21#define DEFAULT_PORT "161"
22#define DEFAULT_RETRIES 5 22#define DEFAULT_RETRIES 5
23 23
24typedef struct eval_method { 24typedef struct eval_method {
@@ -34,10 +34,8 @@ typedef struct check_snmp_test_unit {
34 mp_thresholds threshold; 34 mp_thresholds threshold;
35} check_snmp_test_unit; 35} check_snmp_test_unit;
36 36
37typedef struct check_snmp_config { 37typedef struct {
38 // SNMP session to use
39 struct snmp_session snmp_session; 38 struct snmp_session snmp_session;
40
41 // use getnet instead of get 39 // use getnet instead of get
42 bool use_getnext; 40 bool use_getnext;
43 41
@@ -47,7 +45,9 @@ typedef struct check_snmp_config {
47 45
48 check_snmp_test_unit *test_units; 46 check_snmp_test_unit *test_units;
49 size_t num_of_test_units; 47 size_t num_of_test_units;
48} check_snmp_config_snmp_parameters;
50 49
50typedef struct {
51 // State if an empty value is encountered 51 // State if an empty value is encountered
52 mp_state_enum nulloid_result; 52 mp_state_enum nulloid_result;
53 53
@@ -63,7 +63,18 @@ typedef struct check_snmp_config {
63 bool offset_set; 63 bool offset_set;
64 64
65 // Modify output 65 // Modify output
66 bool use_perf_data_labels_from_input; 66 bool use_oid_as_perf_data_label;
67
68 // activate rate calucation
69 bool calculate_rate;
70 unsigned int rate_multiplier;
71} check_snmp_evaluation_parameters;
72
73typedef struct check_snmp_config {
74 // SNMP session to use
75 check_snmp_config_snmp_parameters snmp_params;
76
77 check_snmp_evaluation_parameters evaluation_params;
67 78
68 mp_output_format output_format; 79 mp_output_format output_format;
69 bool output_format_is_set; 80 bool output_format_is_set;