Juniper / contrail-charms

Juju charms for Contrail services.
Apache License 2.0
13 stars 22 forks source link

NRPE check fails because nagios user is not part of the docker group #153

Closed gmeszaros closed 4 years ago

gmeszaros commented 4 years ago

File that fails: files/plugins/check_contrail_status_controller.py at: output = subprocess.check_output("export CONTRAIL_STATUS_CONTAINER_NAME=contrail-status-controller-nrpe ; sudo -E contrail-status", shell=True).decode('UTF-8')

sudo -E tries to preserve the environment, but that is not allowed.

way around: usermod -aG docker nagios

gmeszaros commented 4 years ago
sudo -u nagios /usr/local/lib/nagios/plugins/check_contrail_status_controller.py 5.1
sudo: sorry, you are not allowed to preserve the environment
CRITICAL: Could not get contrail-status. return code: 1 cmd: export CONTRAIL_STATUS_CONTAINER_NAME=contrail-status-controller-nrpe ; sudo -E contrail-status output: b''
gmeszaros commented 4 years ago

Duplicate of #138