~guoqiao/charm-nrpe:LP1915106-skip-unfound-ifaces

Last commit made on 2021-02-22
Get this branch:
git clone -b LP1915106-skip-unfound-ifaces https://git.launchpad.net/~guoqiao/charm-nrpe
Only Joe Guo can upload to this branch. If you are Joe Guo please log in for upload directions.

Branch merges

Branch information

Name:
LP1915106-skip-unfound-ifaces
Repository:
lp:~guoqiao/charm-nrpe

Recent commits

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

2d96021... by Drew Freiberger

Workaround lp#1897261 resulting in VIP configured in nagios

bdaf268... by Alvaro Uria

Merge branch 'blacken-20.10'

Reviewed-on: https://code.launchpad.net/~aluria/charm-nrpe/+git/nrpe-charm/+merge/392305
Reviewed-by: Drew Freiberger <email address hidden>

28e9f56... by Alvaro Uria

Fix linting by running black

ccbc86d... by Paul Collins

use separate lock file for external-nagios

Reviewed-on: https://code.launchpad.net/~pjdc/charm-nrpe/+git/nrpe-charm/+merge/389052
Reviewed-by: Tom Haddon <email address hidden>
Reviewed-by: Haw Loeung <email address hidden>

4cda701... by Paul Collins

use separate lock file for external-nagios

This ensures that we won't compete with other modules for
connection slots, should "max connections" happen to be set.