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

Cant configure start/stop_program at type host #64

Closed
gdeleon23 opened this issue Jan 10, 2023 · 4 comments
Closed

Cant configure start/stop_program at type host #64

gdeleon23 opened this issue Jan 10, 2023 · 4 comments

Comments

@gdeleon23
Copy link

gdeleon23 commented Jan 10, 2023

Hi!

Puppet7 and Ubuntu 22.

Why we can't configure start_program or stop_program with type "host"?

I get the next error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Monit::Check::Host[dockerd]: has no parameter named 'program_start' (file: /etc/puppetlabs/code/environments/testing/modules/monit/manifests/check.pp, line: 62) on node xxxxx

In your examples, in type "host" of HTTP_HEADERS, you put "action: restart", but what restart do?

I dont know if is another method to restart the service from Host TCP check, but if i put the next configuration, and one port is failling, monit dont execute the "start".

monit::check:
'dockerd':
type: 'process'
config:
pidfile: '/var/run/docker.pid'
program_start: '/etc/es-ops-puppet7-docker/monit_deploy_puppet.sh'
tests:
- type: 'connection'
host: 'localhost'
port: 8088
socket_type: 'tcp'
action: 'start'
- type: 'connection'
host: 'localhost'
port: 8140
socket_type: 'tcp'
action: 'start'

Only execute the action if the PID is loss. To do an action if host tcp check port is failling i do the next configuration manually and works.

CHECK HOST WITH ADDRESS 127.0.0.1
START PROGRAM = "/etc/es-ops-puppet7-docker/monit_deploy_puppet.sh"
GROUP dockerd
IF FAILED HOST localhost PORT 8088 TYPE TCP
THEN START
IF FAILED HOST localhost PORT 8140 TYPE TCP
THEN START

how can i do this configuration with the puppet module? Thank you!! Sorry if i am doing some mistake.

@jonhattan
Copy link
Member

Sorry, the http_headers example is wrong.

In order to restart something you want a CHECK PROCESS test.


On your alternative example, I'll try action restart or exec /path/to/that.sh

@gdeleon23
Copy link
Author

gdeleon23 commented Jan 11, 2023

Hi @jonhattan, thank you for your comments.

I have not been able to make it work with the module.

I have reused the soli-monit module, cloned it and adapted it to work with Ubuntu 20.04 and Ubuntu 22.04.

I recommend adding options to put your own "content" in the monit configurations to avoid this errors Thank you very much anyway!

@jonhattan
Copy link
Member

I'm curious about the changes you made to the module

@gdeleon23
Copy link
Author

sorry, was a mistake, i cloned soli-monit, not your module. :(

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

No branches or pull requests

2 participants