{"id":21301728,"url":"https://github.com/funbox/dioxy","last_synced_at":"2025-07-20T05:33:29.488Z","repository":{"id":55478091,"uuid":"234549814","full_name":"funbox/dioxy","owner":"funbox","description":"Aggregating proxy for MQTT broker metrics in JSON format","archived":false,"fork":false,"pushed_at":"2020-12-28T10:36:13.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T18:45:28.238Z","etag":null,"topics":["monitoring","mqtt-service"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"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/funbox.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}},"created_at":"2020-01-17T13:03:25.000Z","updated_at":"2020-12-28T10:33:57.000Z","dependencies_parsed_at":"2022-08-15T01:10:59.943Z","dependency_job_id":null,"html_url":"https://github.com/funbox/dioxy","commit_stats":null,"previous_names":["gongled/dioxy"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/funbox/dioxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funbox%2Fdioxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funbox%2Fdioxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funbox%2Fdioxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funbox%2Fdioxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funbox","download_url":"https://codeload.github.com/funbox/dioxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funbox%2Fdioxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266071519,"owners_count":23871940,"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":["monitoring","mqtt-service"],"created_at":"2024-11-21T15:50:34.277Z","updated_at":"2025-07-20T05:33:29.469Z","avatar_url":"https://github.com/funbox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dioxy\n\n`dioxy` is simple aggregating proxy for MQTT broker metrics in JSON format. We develop and maintain this software \nmostly for collecting CO2, temperature and humidity metrics from MT8060 in pair with ESP8266 microcontroller. This project is a\npart of health measurement system for office workers.\n\n[How it works](#how-it-works) • [MQTT message format](#mqtt-message-format) • [Installation](#installation) • [Getting started](#getting-started) • [Restrictions](#restrictions) • [Usage](#usage) • [License](#license)\n\n## How it works\n\nWhen you run `dioxy`, it connects to the MQTT broker, collects messages from it\n(using the topic prefix) and stores them in memory. Each next-coming message replaces\nthe previous one and updates the time when it was received.\n\n`dioxy` also monitors orphaned metrics and periodically cleans up an obsolete\nmetrics that have not been updated for some time. You can also configure these\noptions as well.\n\n`dioxy` provides a simple HTTP server to let external systems grub these aggregated\nmetrics from the status page. Every time you request this page, application\nserializes Golang memory struct into JSON message and responses with 200 OK.\n\nOtherwise if something went wrong, the application returns\n500 Internal Server Error with empty reply.\n\n## MQTT message format\n\nMQTT message should be in following format:\n\n```\n/{topic_prefix}/{metrics} {value}\n```\n\nJSON representation is:\n\n```\n{\n  \"{topic_prefix}\": {\n    \"metrics\": \"{metrics}\",\n    \"value\": \"{value}\",\n    \"updated_at\": \"{updated_at}\"\n  }\n}\n```\n\n`topic_prefix` is the string that begins each MQTT message. `metrics` is the measurement name and `value` its value.\nEvery measurement also includes `updated_at` field - particular time when the last message received from.\n\n## Installation\n\n### From prebuilt package for RHEL7/CentOS7\n\nYou can find RPM packages attached to releases on [Release page](https://github.com/funbox/dioxy/releases).\n\nPlease, keep in mind that ESSENTIAL KAOS RHEL/CentOS 7 should be installed.\n\n```\n[sudo] yum install -y https://yum.kaos.st/kaos-repo-latest.el7.noarch.rpm\n```\n\n### From the source code\n\nFetch Go dependencies for compiling binary from the source code.\n\n```shell\nmake deps\n```\n\nBuild binary `dioxy`.\n\n```shell\nmake all\n```\n\nDone.\n\n## Getting started\n\nSet up `dioxy` configuration to aggregate MQTT metrics.\n\n```shell\n[mqtt]\n\n  # MQTT broker IP or FQDN\n  ip: mqtt.example.tld\n\n  # MQTT broker port\n  port: 1883 \n\n  # MQTT username (required)\n  user: username\n\n  # MQTT password (required)\n  password: keepinsecret\n\n  # MQTT topic prefix expression\n  topic: /devices/MT8060/#\n\n[store]\n\n  # Time in seconds to delete orphaned metrics (TTL)\n  ttl: 86400\n\n  # Time in seconds between looking for an orphaned metrics\n  clean-interval: 1500\n\n[http]\n\n  # HTTP server IP\n  ip:\n\n  # HTTP server port\n  port: 33407\n\n[log]\n\n  # Log file dir\n  dir: /var/log/dioxy/\n\n  # Path to log file\n  file: {log:dir}/dioxy.log\n\n  # Log permissions\n  perms: 600\n\n  # Default log level (debug/info/warn/error/crit)\n  level: info\n```\n\nLaunch systemd unit and make sure it will be launched after reboot.\n\n```shell\n[sudo] systemctl start dioxy.service\n[sudo] systemctl enable dioxy.service\n```\n\nCheck if metrics are collecting well.\n\n```\ncurl -sL http://127.0.0.1:33407/ | jq .\n```\n\nDone.\n\n## Restrictions\n\nWe do not provide any mechanism to assosiate metrics with aggregating function.\n`dioxy` replaces the last value every time we receive a next one. We rely that\nyour monitoring system is processing data on their own if needed.\n\n`dioxy` also does not support TLS encryption and anonymous access to MQTT\nbroker. We will improve this a bit later.\n\n## Usage\n\n```\nUsage: dioxy {options}\n\nOptions\n\n  --config, -c file .. Path to configuraion file\n  --no-color, -nc .... Disable colors in output\n  --help, -h ......... Show this help message\n  --version, -v ...... Show version\n```\n\n## License\n\nReleased under the MIT license (see [LICENSE](LICENSE))\n\n[![Sponsored by FunBox](https://funbox.ru/badges/sponsored_by_funbox_grayscale.svg)](https://funbox.ru)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunbox%2Fdioxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunbox%2Fdioxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunbox%2Fdioxy/lists"}