summaryrefslogtreecommitdiffstats
path: root/plugins/check_mrtgtraf.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_mrtgtraf.c')
-rw-r--r--plugins/check_mrtgtraf.c18
1 files changed, 9 insertions, 9 deletions
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;