summaryrefslogtreecommitdiffstats
path: root/plugins/check_apt.d
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-10 21:07:55 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-10 21:07:55 +0100
commit3420d88a9c7436965f22a52790ffb8c793e2990f (patch)
tree6c65af59151e64282f9f5925be69162adad994d6 /plugins/check_apt.d
parent5cf53de34fa410702ca59437cdf3f304366c3c55 (diff)
parentf930f1745b350903efa42933c04f8a2362d66d74 (diff)
downloadmonitoring-plugins-3420d88a9c7436965f22a52790ffb8c793e2990f.tar.gz
Merge branch 'master' into refactor/check_smtp
Diffstat (limited to 'plugins/check_apt.d')
-rw-r--r--plugins/check_apt.d/config.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/check_apt.d/config.h b/plugins/check_apt.d/config.h
new file mode 100644
index 00000000..981f4f42
--- /dev/null
+++ b/plugins/check_apt.d/config.h
@@ -0,0 +1,41 @@
1#pragma once
2
3#include "../../config.h"
4#include <stddef.h>
5
6/* some constants */
7typedef enum {
8 UPGRADE,
9 DIST_UPGRADE,
10 NO_UPGRADE
11} upgrade_type;
12
13typedef struct {
14 bool do_update; /* whether to call apt-get update */
15 upgrade_type upgrade; /* which type of upgrade to do */
16 bool only_critical; /* whether to warn about non-critical updates */
17 bool list; /* list packages available for upgrade */
18 /* number of packages available for upgrade to return WARNING status */
19 int packages_warning;
20
21 char *upgrade_opts; /* options to override defaults for upgrade */
22 char *update_opts; /* options to override defaults for update */
23 char *do_include; /* regexp to only include certain packages */
24 char *do_exclude; /* regexp to only exclude certain packages */
25 char *do_critical; /* regexp specifying critical packages */
26 char *input_filename; /* input filename for testing */
27} check_apt_config;
28
29check_apt_config check_apt_config_init() {
30 check_apt_config tmp = {.do_update = false,
31 .upgrade = UPGRADE,
32 .only_critical = false,
33 .list = false,
34 .packages_warning = 1,
35 .update_opts = NULL,
36 .do_include = NULL,
37 .do_exclude = NULL,
38 .do_critical = NULL,
39 .input_filename = NULL};
40 return tmp;
41}