summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Makefile.am2
-rw-r--r--plugins/check_mrtgtraf.c18
-rw-r--r--plugins/check_mrtgtraf.d/config.h (renamed from plugins/check_mrtgraf.d/config.h)6
3 files changed, 13 insertions, 13 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 1e4789ff..305924bf 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -56,7 +56,7 @@ EXTRA_DIST = t \
56 check_dbi.d \ 56 check_dbi.d \
57 check_ssh.d \ 57 check_ssh.d \
58 check_dns.d \ 58 check_dns.d \
59 check_mrtgraf.d \ 59 check_mrtgtraf.d \
60 check_mysql_query.d \ 60 check_mysql_query.d \
61 check_mrtg.d \ 61 check_mrtg.d \
62 check_apt.d \ 62 check_apt.d \
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index c9e26099..8c7cf8aa 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -33,16 +33,16 @@ const char *progname = "check_mrtgtraf";
33const char *copyright = "1999-2024"; 33const char *copyright = "1999-2024";
34const char *email = "devel@monitoring-plugins.org"; 34const char *email = "devel@monitoring-plugins.org";
35 35
36#include "check_mrtgraf.d/config.h" 36#include "check_mrtgtraf.d/config.h"
37#include "common.h" 37#include "common.h"
38#include "utils.h" 38#include "utils.h"
39 39
40typedef struct { 40typedef struct {
41 int errorcode; 41 int errorcode;
42 check_mrtgraf_config config; 42 check_mrtgtraf_config config;
43} check_mrtgraf_config_wrapper; 43} check_mrtgtraf_config_wrapper;
44 44
45static check_mrtgraf_config_wrapper process_arguments(int /*argc*/, char ** /*argv*/); 45static check_mrtgtraf_config_wrapper process_arguments(int /*argc*/, char ** /*argv*/);
46static void print_help(void); 46static void print_help(void);
47void print_usage(void); 47void print_usage(void);
48 48
@@ -54,12 +54,12 @@ int main(int argc, char **argv) {
54 /* Parse extra opts if any */ 54 /* Parse extra opts if any */
55 argv = np_extra_opts(&argc, argv, progname); 55 argv = np_extra_opts(&argc, argv, progname);
56 56
57 check_mrtgraf_config_wrapper tmp_config = process_arguments(argc, argv); 57 check_mrtgtraf_config_wrapper tmp_config = process_arguments(argc, argv);
58 if (tmp_config.errorcode == ERROR) { 58 if (tmp_config.errorcode == ERROR) {
59 usage4(_("Could not parse arguments")); 59 usage4(_("Could not parse arguments"));
60 } 60 }
61 61
62 const check_mrtgraf_config config = tmp_config.config; 62 const check_mrtgtraf_config config = tmp_config.config;
63 63
64 /* open the MRTG log file for reading */ 64 /* open the MRTG log file for reading */
65 FILE *mrtg_log_file_ptr = fopen(config.log_file, "r"); 65 FILE *mrtg_log_file_ptr = fopen(config.log_file, "r");
@@ -200,7 +200,7 @@ int main(int argc, char **argv) {
200} 200}
201 201
202/* process command-line arguments */ 202/* process command-line arguments */
203check_mrtgraf_config_wrapper process_arguments(int argc, char **argv) { 203check_mrtgtraf_config_wrapper process_arguments(int argc, char **argv) {
204 static struct option longopts[] = {{"filename", required_argument, 0, 'F'}, 204 static struct option longopts[] = {{"filename", required_argument, 0, 'F'},
205 {"expires", required_argument, 0, 'e'}, 205 {"expires", required_argument, 0, 'e'},
206 {"aggregation", required_argument, 0, 'a'}, 206 {"aggregation", required_argument, 0, 'a'},
@@ -210,9 +210,9 @@ check_mrtgraf_config_wrapper process_arguments(int argc, char **argv) {
210 {"help", no_argument, 0, 'h'}, 210 {"help", no_argument, 0, 'h'},
211 {0, 0, 0, 0}}; 211 {0, 0, 0, 0}};
212 212
213 check_mrtgraf_config_wrapper result = { 213 check_mrtgtraf_config_wrapper result = {
214 .errorcode = OK, 214 .errorcode = OK,
215 .config = check_mrtgraf_config_init(), 215 .config = check_mrtgtraf_config_init(),
216 }; 216 };
217 if (argc < 2) { 217 if (argc < 2) {
218 result.errorcode = ERROR; 218 result.errorcode = ERROR;
diff --git a/plugins/check_mrtgraf.d/config.h b/plugins/check_mrtgtraf.d/config.h
index 6d949b50..94929ff7 100644
--- a/plugins/check_mrtgraf.d/config.h
+++ b/plugins/check_mrtgtraf.d/config.h
@@ -13,10 +13,10 @@ typedef struct {
13 unsigned long outgoing_warning_threshold; 13 unsigned long outgoing_warning_threshold;
14 unsigned long outgoing_critical_threshold; 14 unsigned long outgoing_critical_threshold;
15 15
16} check_mrtgraf_config; 16} check_mrtgtraf_config;
17 17
18check_mrtgraf_config check_mrtgraf_config_init() { 18check_mrtgtraf_config check_mrtgtraf_config_init() {
19 check_mrtgraf_config tmp = { 19 check_mrtgtraf_config tmp = {
20 .log_file = NULL, 20 .log_file = NULL,
21 .expire_minutes = -1, 21 .expire_minutes = -1,
22 .use_average = true, 22 .use_average = true,