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

Check datadog agent info for warnings & errors, failing the play if any are found #73

Closed
bgerstle opened this issue Jul 6, 2017 · 2 comments

Comments

@bgerstle
Copy link

bgerstle commented Jul 6, 2017

As a user, I expect an attempt to configure the datadog-agent improperly would result in a play failure. Instead, it fails silently and I don't realize monitoring is broken until after the fact.

It seems this could be accomplished with something along these lines:

- name: Get datadog-agent status
  command: /etc/init.d/datadog-agent info
  register: agent_info

- fail: "Something seems wrong with your configuration, please check the docs"
  when: 'WARNING' in agent_info or 'ERROR' in agent-info
@jeffwidman
Copy link
Contributor

👍 for this idea, although it may need some tweaking.

For example, we run a custom proxy between our agents and Datadog, so the agents always throw a warning for us: DataDog/dd-agent#3346 (comment)

Not sure if the when statement only matches on casing/exact word or partial words...

@bkabrda
Copy link
Contributor

bkabrda commented Sep 21, 2021

Hi, so right now, the restart datadog-agent handler will fail if the agent fails to start - I just tested with a malformed config and the whole play failed because of the handler failing. The general problem with things like this is how long do you want to wait to see errors/warnings? The agent may fail 1 second after we check, so we can never get this 100 % right, even if we waited for a long time (which would make the play very long).

I believe the current state of the role is sufficient in this sense - if you have an example of misconfiguration that made the agent fail while the play finished fine, feel free to open another issue with more specifics, maybe there's a different way to solve that case.

Thanks!

@bkabrda bkabrda closed this as completed Sep 21, 2021
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

3 participants