Merge ~mirespace/ubuntu/+source/monitoring-plugins:1940916-1827159-jammy-synthetics-fs into ubuntu/+source/monitoring-plugins:ubuntu/jammy-devel

Proposed by Miriam España Acebal
Status: Merged
Merged at revision: c49549297ba971b191d57b6b7a5b595e1a885c6b
Proposed branch: ~mirespace/ubuntu/+source/monitoring-plugins:1940916-1827159-jammy-synthetics-fs
Merge into: ubuntu/+source/monitoring-plugins:ubuntu/jammy-devel
Diff against target: 89 lines (+47/-13)
2 files modified
debian/changelog (+9/-0)
debian/patches/exclude-tmpfs-squashfs-tracefs.patch (+38/-13)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server Pending
Review via email: mp+414956@code.launchpad.net

Description of the change

This is a clone of [MP 414725](https://code.launchpad.net/~mirespace/ubuntu/+source/monitoring-plugins/+git/monitoring-plugins/+merge/414725), except for the version and the lintian report:

---
Hello team,

PPA with the package (monitoring-plugins - 2.3.1-1ubuntu4) is here:

https://launchpad.net/~mirespace/+archive/ubuntu/sru-focal-monitoring-plugins-1940916-1827159-check-disks

sudo add-apt-repository ppa:mirespace/sru-focal-monitoring-plugins-1940916-1827159-check-disks
sudo apt-get update

This bug is a side-effect of bug 1827159, where the synthetic filesystems (tmp, squash, trace) were excluded by default to avoid false positives: if the user wants to explicitly check for this kind of filesystem (including them on command line) or to check a mount point based on some of them, the result was DISK UNKNOWN (as it was excluded by default).

The approach here has been excluding this kind of filesystem only if it's not included via path (-p option) nor by including (-N option).

The code also can be expanded later for another similar kind of filesystems if needed in the future.

The package has no test.

These are the lintian warnings present:
❯ lintian --pedantic
W: monitoring-plugins source: debian-rules-should-not-set-CFLAGS-from-noopt
W: monitoring-plugins source: newer-standards-version 4.5.1 (current is 4.5.0)
P: monitoring-plugins source: no-dep5-copyright
P: monitoring-plugins source: package-uses-old-debhelper-compat-version 10
P: monitoring-plugins source: rules-requires-root-missing

SRU template was filed in the bug with the steps for reproducing, bad and good cases.

Thanks in advance for your time in reviewing this.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Verified this includes the same changes as the focal branch, and builds properly. There are no autopkgtests but verified invoking autopkgtest does not fail.

Looks good, uploading:

$ dput ubuntu ../*source.changes
D: Setting host argument.
Checking signature on .changes
gpg: ../monitoring-plugins_2.3.1-1ubuntu4_source.changes: Valid signature from E603B2578FB8F0FB
Checking signature on .dsc
gpg: ../monitoring-plugins_2.3.1-1ubuntu4.dsc: Valid signature from E603B2578FB8F0FB
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading monitoring-plugins_2.3.1-1ubuntu4.dsc: done.
  Uploading monitoring-plugins_2.3.1-1ubuntu4.debian.tar.xz: done.
  Uploading monitoring-plugins_2.3.1-1ubuntu4_source.buildinfo: done.
  Uploading monitoring-plugins_2.3.1-1ubuntu4_source.changes: done.
Successfully uploaded packages.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 2b7bf15..6159c83 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+monitoring-plugins (2.3.1-1ubuntu4) jammy; urgency=medium
7+
8+ * d/p/exclude-tmpfs-squashfs-tracefs.patch: Adding synthetic filesystems
9+ for exclusion only if they have not been included and no mount point
10+ has been provided in command line. Re-implementing solution for
11+ LP bug 1827159. (LP: #1940916).
12+
13+ -- Miriam España Acebal <miriam.espana@canonical.com> Wed, 02 Feb 2022 13:35:26 +0100
14+
15 monitoring-plugins (2.3.1-1ubuntu3) jammy; urgency=medium
16
17 * No-change rebuild against libssl3
18diff --git a/debian/patches/exclude-tmpfs-squashfs-tracefs.patch b/debian/patches/exclude-tmpfs-squashfs-tracefs.patch
19index b29d75c..e9200dc 100644
20--- a/debian/patches/exclude-tmpfs-squashfs-tracefs.patch
21+++ b/debian/patches/exclude-tmpfs-squashfs-tracefs.patch
22@@ -2,29 +2,54 @@ Description: Exclude tmpfs, squashfs, and tracefs.
23 These synthetic filesystems always report 100% disk usage by design, so
24 can generate false-positive "disk full" alerts. While it is possible to
25 exclude these via command line arguments, it is more convenient to
26- ignore them directly by the tool.
27+ ignore them directly by the tool taking into account if they have been
28+ included by options or not and if a mount point has been provided in
29+ the args.
30 Author: Bryce Harrington <bryce@canonical.com>
31+ Miriam España Acebal <miriam.espana@canonical.com>
32 Bug-Ubuntu: https://bugs.launchpad.net/nagios-charm/+bug/1827159
33-Forwarded: yes, https://github.com/monitoring-plugins/monitoring-plugins/pull/1609
34+ https://bugs.launchpad.net/ubuntu/+source/monitoring-plugins/+bug/1940916
35+Forwarded: yes, https://github.com/monitoring-plugins/monitoring-plugins/pull/1749
36 Last-Update: 2019-11-07
37 ---
38 plugins/check_disk.c | 3 +++
39 1 file changed, 3 insertions(+)
40
41-diff --git a/plugins/check_disk.c b/plugins/check_disk.c
42-index e73a008..ec5d663 100644
43 --- a/plugins/check_disk.c
44 +++ b/plugins/check_disk.c
45-@@ -471,6 +471,9 @@ process_arguments (int argc, char **argv)
46- return ERROR;
47+@@ -417,7 +417,7 @@
48+ int
49+ process_arguments (int argc, char **argv)
50+ {
51+- int c, err;
52++ int c, err, i;
53+ struct parameter_list *se;
54+ struct parameter_list *temp_list = NULL, *previous = NULL;
55+ struct mount_entry *me;
56+@@ -467,11 +467,11 @@
57+ {0, 0, 0, 0}
58+ };
59
60- np_add_name(&fs_exclude_list, "iso9660");
61-+ np_add_name(&fs_exclude_list, "squashfs");
62-+ np_add_name(&fs_exclude_list, "tmpfs");
63-+ np_add_name(&fs_exclude_list, "tracefs");
64++ char filesystems[3][10] = { "tmpfs", "squashfs", "tracefs" };
65++
66+ if (argc < 2)
67+ return ERROR;
68
69+- np_add_name(&fs_exclude_list, "iso9660");
70+-
71 for (c = 1; c < argc; c++)
72 if (strcmp ("-to", argv[c]) == 0)
73---
74-2.17.1
75-
76+ strcpy (argv[c], "-t");
77+@@ -785,6 +785,12 @@
78+ mult = (uintmax_t)1024 * 1024;
79+ }
80+
81++ for (i = 0; i < 3; i++)
82++ if (!np_find_name (fs_include_list, filesystems[i]) && (path_selected == FALSE))
83++ np_add_name(&fs_exclude_list, filesystems[i]);
84++
85++ np_add_name(&fs_exclude_list, "iso9660");
86++
87+ return TRUE;
88+ }
89+

Subscribers

People subscribed via source and target branches