summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorVladimir Kobal <vlad@prokk.net>2020-08-12 15:36:58 +0300
committerGitHub <noreply@github.com>2020-08-12 15:36:58 +0300
commitdc1fa08a8835d008a180e33deae71604a060fa48 (patch)
tree298305140bb4e023e4f7de576e946669d9b23b30 /collectors
parent705af12fbef87b983b80223c2692996546b36c6c (diff)
Fix for ignored LXC containers (#9645)
Diffstat (limited to 'collectors')
-rwxr-xr-xcollectors/cgroups.plugin/cgroup-name.sh.in11
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.c3
2 files changed, 9 insertions, 5 deletions
diff --git a/collectors/cgroups.plugin/cgroup-name.sh.in b/collectors/cgroups.plugin/cgroup-name.sh.in
index ad0ab0b663..5d19014f41 100755
--- a/collectors/cgroups.plugin/cgroup-name.sh.in
+++ b/collectors/cgroups.plugin/cgroup-name.sh.in
@@ -101,10 +101,10 @@ function k8s_get_name() {
fi
if kubectl --kubeconfig=$KUBE_CONFIG get pod --all-namespaces >/dev/null 2>&1; then
#shellcheck disable=SC2086
- NAME="$(kubectl --kubeconfig=$KUBE_CONFIG get pod --all-namespaces --output='json' |
- jq -r '.items[] | "k8s_\(.metadata.namespace)_\(.metadata.name)_\(.metadata.uid)_" + (.status.containerStatuses[]? | "\(.name) \(.containerID)")' |
- grep "$id" |
- cut -d' ' -f1
+ NAME="$(kubectl --kubeconfig=$KUBE_CONFIG get pod --all-namespaces --output='json' |
+ jq -r '.items[] | "k8s_\(.metadata.namespace)_\(.metadata.name)_\(.metadata.uid)_" + (.status.containerStatuses[]? | "\(.name) \(.containerID)")' |
+ grep "$id" |
+ cut -d' ' -f1
)"
else
warning "kubectl cannot get pod list, check for configuration file in $KUBE_CONFIG, or set this path to env \$KUBE_CONFIG"
@@ -227,6 +227,9 @@ if [ -z "${NAME}" ]; then
else
error "proxmox config file missing ${FILENAME} or netdata does not have read access. Please ensure netdata is a member of www-data group."
fi
+ elif [[ ${CGROUP} =~ lxc.payload.* ]]; then
+ # LXC 4.0
+ NAME="$(echo "${CGROUP}" | sed 's/lxc\.payload\.\(.*\)/\1/g')"
fi
[ -z "${NAME}" ] && NAME="${CGROUP}"
diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.c b/collectors/cgroups.plugin/sys_fs_cgroup.c
index 007669456e..87f13e11e9 100644
--- a/collectors/cgroups.plugin/sys_fs_cgroup.c
+++ b/collectors/cgroups.plugin/sys_fs_cgroup.c
@@ -379,7 +379,7 @@ void read_cgroup_plugin_configuration() {
" !/libvirt "
" !/lxc "
" !/lxc/*/* " // #1397 #2649
- " !/lxc.monitor "
+ " !/lxc.monitor* "
" !/lxc.pivot "
" !/lxc.payload "
" !/machine "
@@ -403,6 +403,7 @@ void read_cgroup_plugin_configuration() {
" !/lxc/*/* " // #2161 #2649
" !/lxc.monitor "
" !/lxc.payload/*/* "
+ " !/lxc.payload.* "
" * "
), NULL, SIMPLE_PATTERN_EXACT);