charm-nrpe:stable/21.04

Last commit made on 2021-04-20
Get this branch:
git clone -b stable/21.04 https://git.launchpad.net/charm-nrpe
Members of Llama (LMA) Charmers can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
stable/21.04
Repository:
lp:charm-nrpe

Recent commits

6acb397... by Xav Paice

Merge branch 'bug/1924960'

e998123... by Xav Paice

Update check_netns.sh when id is included

On systems where net namespaces have an ID associated, the output of
ip netns list includes that information. This change updates the means
to collect the list of namespaces to just include the names.

bf80fa1... by Xav Paice

Update check_status_file.py for py3

The Nagios plugin check_status_file.py was not compatible with Python 3,
changed what is needed to allow this to run with Python v3.

d7f8626... by Linda Guo

Ignore docker backend path in ro filesystem check

Added docker backend path /var/lib/docker to
default ro_filesystem_excludes

LP#1898920

016faeb... by Linda Guo

skip containerd overlay mounts

When a kubernetes pod has a readonly mount defined,
the mountpoint is alerted by nrpe check_ro_filesystem
mount, but is mounted as described by the deployment.

Ignore /run/containerd backend paths in
check_ro_filesystems by default

LP#1898920

9010e2f... by Joe Guo

add --skip-unfound-ifaces to check_netlinks.py

Add an new boolean option `netlinks_skip_unfound_ifaces` in config.yaml.
When True, add --skip-unfound-ifaces to check_netlinks.py.

LP: #1915106

Signed-off-by: Joe Guo <email address hidden>

4379294... by Joe Guo

nrpe_utils.py: ensure permission for /var/lib/nagios

This nrpe charm will install nagios-nrpe-server deb package.
In its preinst script[0], it will add nagios user and create `/var/lib/nagios` as home dir.

When other charm like hw-health relates to this charm, they will:

1) setup cronjob to run script
2) generate output file into /var/lib/nagios
3) read output file from /var/lib/nagios

Before, these are all done via root user, so no permission issue.
But recently, the cronjob user is switched from root to nagios, which caused following issues:

1) original output file was created by root, cronjob script by nagios user can not write to it.
2) In some situation, owner of `/var/lib/nagios/` is changed to root, cronjob script can not write file into this dir.

related bugs:

LP: #1906991
LP: #1904045
LP: #1866382

In this patch, we:

1) ensure `/var/lib/nagios` is owned by nagios user
2) setgid on dir group, to ensure any new created file in `/var/lib/nagios` has group `nagios`.

NOTE: this patch avoids to chown recursively, which implies, if there is a legacy output file
owned by root, we have to fix it manually, or fix it from the related charm side.

[0]: https://git.launchpad.net/ubuntu/+source/nagios-nrpe/tree/debian/nagios-nrpe-server.preinst#n28

Signed-off-by: Joe Guo <email address hidden>

4e25d56... by Haw Loeung

Add showing charm source version/commit in juju status output

ce7cc4e... by Joe Guo

check_status_file.py: fix python shebang

On focal, `/usr/bin/python` doesn't exist by default any more.
Change shebang: `/usr/bin/python` -> `/usr/bin/env python3`

Signed-off-by: Joe Guo <email address hidden>

8bbc270... by Celia Wang

Fix lint test