summaryrefslogtreecommitdiffstats
path: root/plugins/check_pgsql.d
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2026-01-09 14:57:57 +0100
committerGitHub <noreply@github.com>2026-01-09 14:57:57 +0100
commitda4fb28fca51b180d50608b0c847b1c0927cd8c5 (patch)
treed20769e0a61ac2ba76920190050d3e0a3e7c85b7 /plugins/check_pgsql.d
parentb09a8b530df8a23610889d0b89b148f22db3568a (diff)
parentf694f4cd4dfead0da6feab04d92335d9bbe185b6 (diff)
downloadmonitoring-plugins-da4fb28fca51b180d50608b0c847b1c0927cd8c5.tar.gz
Merge branch 'master' into refactor/check_ide_smart
Diffstat (limited to 'plugins/check_pgsql.d')
-rw-r--r--plugins/check_pgsql.d/config.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/plugins/check_pgsql.d/config.h b/plugins/check_pgsql.d/config.h
index 2d4b8b89..7cf0637b 100644
--- a/plugins/check_pgsql.d/config.h
+++ b/plugins/check_pgsql.d/config.h
@@ -1,6 +1,8 @@
1#pragma once 1#pragma once
2 2
3#include "../../config.h" 3#include "../../config.h"
4#include "output.h"
5#include "perfdata.h"
4#include "thresholds.h" 6#include "thresholds.h"
5#include <stddef.h> 7#include <stddef.h>
6#include <pg_config_manual.h> 8#include <pg_config_manual.h>
@@ -24,11 +26,11 @@ typedef struct {
24 char *pgquery; 26 char *pgquery;
25 char *pgqueryname; 27 char *pgqueryname;
26 28
27 double twarn; 29 mp_thresholds time_thresholds;
28 double tcrit; 30 mp_thresholds qthresholds;
29 thresholds *qthresholds; 31
30 char *query_warning; 32 bool output_format_is_set;
31 char *query_critical; 33 mp_output_format output_format;
32} check_pgsql_config; 34} check_pgsql_config;
33 35
34/* begin, by setting the parameters for a backend connection if the 36/* begin, by setting the parameters for a backend connection if the
@@ -51,11 +53,18 @@ check_pgsql_config check_pgsql_config_init() {
51 .pgquery = NULL, 53 .pgquery = NULL,
52 .pgqueryname = NULL, 54 .pgqueryname = NULL,
53 55
54 .twarn = (double)DEFAULT_WARN, 56 .time_thresholds = mp_thresholds_init(),
55 .tcrit = (double)DEFAULT_CRIT, 57 .qthresholds = mp_thresholds_init(),
56 .qthresholds = NULL, 58
57 .query_warning = NULL, 59 .output_format_is_set = false,
58 .query_critical = NULL,
59 }; 60 };
61
62 mp_range tmp_range = mp_range_init();
63 tmp_range = mp_range_set_end(tmp_range, mp_create_pd_value(DEFAULT_WARN));
64 tmp.time_thresholds = mp_thresholds_set_warn(tmp.time_thresholds, tmp_range);
65
66 tmp_range = mp_range_set_end(tmp_range, mp_create_pd_value(DEFAULT_CRIT));
67 tmp.time_thresholds = mp_thresholds_set_crit(tmp.time_thresholds, tmp_range);
68
60 return tmp; 69 return tmp;
61} 70}