Get docker-daemon-metrics Check working

Hi,

i need some help to get the docker-daemon-metrics Check working.
I executed it on the Agent Machine with http-get and it seems to provide valid output.

./http-get --timeout 10 --url “http127.0.0.1:9323/metrics”| head
# HELP builder_builds_failed_total Number of failed image builds
# TYPE builder_builds_failed_total counter
builder_builds_failed_total{reason=“build_canceled”} 0
builder_builds_failed_total{reason=“build_target_not_reachable_error”} 0
builder_builds_failed_total{reason=“command_not_supported_error”} 0
builder_builds_failed_total{reason=“dockerfile_empty_error”} 0
builder_builds_failed_total{reason=“dockerfile_syntax_error”} 0
builder_builds_failed_total{reason=“error_processing_commands_error”} 0
builder_builds_failed_total{reason=“missing_onbuild_arguments_error”} 0
builder_builds_failed_total{reason=“unknown_instruction_error”} 0

I checked the Logs of sensu-agent:

Nov 01 23:22:10 xxx.xxy.de sensu-agent[529187]: {“check”:“docker-daemon-metrics”,“component”:“agent”,“entity”:“xxx.xxy.de”,“event_uuid”:“f9007b05-3421-4793-90bd-38d5e300381e”,“level”:“info”,“metrics”:true,“msg”:“sending event to backend”,“time”:“2024-11-01T22:22:10Z”}

But i don’t get an Event on the Backend for this Check/Entity.

the Check Config:

sensuctl check info docker-daemon-metrics
=== docker-daemon-metrics
Name: docker-daemon-metrics
Interval: 30
Command: http-get --timeout 10 --url “http127.0.0.1:9323/metrics”
Cron:
Timeout: 0
TTL: 0
Subscriptions: docker, docker-daemon, docker-machine
Handlers:
Runtime Assets: sensu/http-checks:0.7.0
Hooks:
Publish?: true
Stdin?: false
Proxy Entity Name:
Namespace: default
Metric Format: prometheus_text
Metric Handlers:

Can someone please help?

Thanks!

EDIT:
I removed the http:// from localhost Connection, because the forum doesn’t allow me as new user to insert “Links”

I also played around with the VeselaHouba/sensu-plugins-docker. But its also not working.
I get the Error:

internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:148:in require': cannot load such file -- sensu-plugins-docker/client_helpers (LoadError) from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:148:in require’
from /var/cache/sensu/sensu-agent/0781867377a3cc24ee4502e2c2eebb6c46146d13a79a56b8cda06c2252b24a700939c8646ebaf8256a12478bbd95329b7ca581f5926ef364967376a6c4d92429/lib/ruby/2.4.0/bundler/gems/sensu-plugins-docker-5839b7ac2ee1/bin/check-docker-container.rb:40:in <top (required)>' from /var/cache/sensu/sensu-agent/0781867377a3cc24ee4502e2c2eebb6c46146d13a79a56b8cda06c2252b24a700939c8646ebaf8256a12478bbd95329b7ca581f5926ef364967376a6c4d92429/bin/check-docker-container.rb:14:in load’
from /var/cache/sensu/sensu-agent/0781867377a3cc24ee4502e2c2eebb6c46146d13a79a56b8cda06c2252b24a700939c8646ebaf8256a12478bbd95329b7ca581f5926ef364967376a6c4d92429/bin/check-docker-container.rb:14:in `’

Hey @mfiedler1985

Hi, I’m Dishi, part of the Sensu team at Sumo Logic. Thanks for reaching out with your query! I have a few suggestions and questions to help troubleshoot:

  1. Could you let me know your current Sensu backend and agent versions?
  2. Ensure the subscription applied to the check is also correctly applied to the entity.
  3. Verify there’s an active network connection between your backend and agent.
  4. Are you only missing HTTP check events, or are all events not showing up?
  5. Since no events are appearing on the backend, please review the backend logs to confirm it’s receiving and processing events correctly. Backend logs can often highlight network or configuration issues that might be blocking events. To get detailed information, I recommend setting the log level to debug and rerunning the check. Once you’ve captured the logs, remember to reset the log level to its previous state.

Let me know how it goes, and feel free to reach out with any further questions