Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed interactive mrpe run #731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vafhornung
Copy link

General information

If you run an interactive mrpe check the while loop running the mrpe execution stops right after the interactive command called as the interactive part "eats up" the stdin of the while loop.

Bug reports

Create an mrpe file like:

# cat /etc/check_mk/mrpe.cfg
Hello_World_1                   docker run hello-world
Hello_World_2                   docker run -i hello-world
Hello_World_3                   docker run -i hello-world

and run check_mk_agent:

<<<mrpe>>>
(docker) Hello_World_1 0 Hello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.    (amd64) 3. The Docker daemon created a new container from that image which runs the    executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it    to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit: https://docs.docker.com/get-started/
<<<mrpe>>>
(docker) Hello_World_2 0 Hello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.    (amd64) 3. The Docker daemon created a new container from that image which runs the    executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it    to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit: https://docs.docker.com/get-started/

with the PR all 3 Hello_World gets executed as the stdin for each run is cutted of from the while loop and therefore the while loop can finish.

Testet on Debian Linux but should work also on all other distros.

And you are right calling docker without -i is the 100% percent correct solution but support guys like me doing stupid stuff ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants