{"id":23944926,"url":"https://github.com/madnuttah/unbound-docker-stats","last_synced_at":"2025-04-12T17:13:58.635Z","repository":{"id":161967985,"uuid":"636547747","full_name":"madnuttah/unbound-docker-stats","owner":"madnuttah","description":"📊 Display Unbound statistics in Grafana using Zabbix without any additional tools.","archived":false,"fork":false,"pushed_at":"2024-06-15T08:33:42.000Z","size":1006,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T17:13:52.657Z","etag":null,"topics":["docker","grafana","homelab","log","logfile","logfile-analysis","monitoring","statistics","unbound","zabbix","zabbix-active-agent","zabbix-agent"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/madnuttah/unbound","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madnuttah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-05T05:17:56.000Z","updated_at":"2024-08-25T08:32:43.000Z","dependencies_parsed_at":"2024-03-22T18:45:22.760Z","dependency_job_id":null,"html_url":"https://github.com/madnuttah/unbound-docker-stats","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madnuttah%2Funbound-docker-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madnuttah%2Funbound-docker-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madnuttah%2Funbound-docker-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madnuttah%2Funbound-docker-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madnuttah","download_url":"https://codeload.github.com/madnuttah/unbound-docker-stats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602312,"owners_count":21131616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grafana","homelab","log","logfile","logfile-analysis","monitoring","statistics","unbound","zabbix","zabbix-active-agent","zabbix-agent"],"created_at":"2025-01-06T07:16:39.795Z","updated_at":"2025-04-12T17:13:58.606Z","avatar_url":"https://github.com/madnuttah.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unbound Statistics\n\nI wanted to have the statistics of Unbound in Grafana and since I didn't want to modify my [`Unbound Docker Image`](https://github.com/madnuttah/unbound-docker) to use any third party tools like `Zabbix sender`, I found a way to get them into the Zabbix database and ship the stats to Grafana. \n\nZabbix active agents can ingest files, so Unbound-Control creates a file with the statistics using a modified healthcheck script and an active Zabbix agent reads and processes the log and saves the values into the Zabbix database.\n\n[`Screenshot`](https://raw.githubusercontent.com/madnuttah/unbound-docker-stats/main/unbound-stats/screenshots/Screenshot.png)\n\n***\n\n### Instructions:\n\nAdapt the `unbound.conf` to enable extended statistics:\n\n```\nserver:\t\n  extended-statistics: yes\n  statistics-cumulative: no\n  statistics-interval: 0\t\n```\n\nDownload the modified [`healthcheck.sh`](https://github.com/madnuttah/unbound-docker-stats/blob/main/unbound-stats/healthcheck.sh) script and place it in your persistent Unbound volume.\n\nYou also need to modify your unbound `compose` and add the following lines to the `volumes` section. \n\n```yaml\n unbound:\n    container_name: unbound\n    image: madnuttah/unbound:latest\n    ...\n    volumes:\n    \n      ...\n      - ./unbound/healthcheck.sh:/usr/local/unbound/sbin/healthcheck.sh:rw\n      - ./unbound/log.d/unbound-stats.log:/usr/local/unbound/log.d/unbound-stats.log:rw\n      ...    \n    healthcheck:\n      test: /usr/local/unbound/sbin/healthcheck.sh\n      interval: 60s\n      retries: 5\n      start_period: 15s\n      timeout: 30s        \n```\n\nCreate an Active Zabbix agent on the docker host where Unbound runs on.\n\nMap the `unbound-stats.log` to the agent's volumes in it's `compose` like so:\n\n```yaml\n  zabbix-agent2:\n    image: zabbix/zabbix-agent2:alpine-6.4-latest\n    ...\n    volumes: \n      ...  \n      - ./unbound/log.d/unbound-stats.log:/var/log/unbound-stats.log:ro\n      - /var/run/docker.sock:/var/run/docker.sock:ro\t  \n```\n\nDownload my Zabbix [`template`](https://raw.githubusercontent.com/madnuttah/unbound-docker-stats/main/unbound-stats/Zabbix%20Template%20Unbound%20Statistics.json) and import it into your host in Zabbix.\n\nZabbix should display values in `Latest Data` after a little while and you can now begin to configure your Grafana panels or Zabbix graphs as you like.\n\nI guess there are many things to optimize or to make better, there are no graphs or such for Zabbix or completed panels for Grafana for example. If you like to contribute, you're most welcome.\n\n**This was tested only with Zabbix 6.4 using [`madnuttah/unbound-docker`](https://github.com/madnuttah/unbound-docker).**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadnuttah%2Funbound-docker-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadnuttah%2Funbound-docker-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadnuttah%2Funbound-docker-stats/lists"}