{"id":16696672,"url":"https://github.com/zenithalhourlyrate/gravity-pmacct","last_synced_at":"2025-06-21T07:07:08.625Z","repository":{"id":130587187,"uuid":"280433969","full_name":"ZenithalHourlyRate/gravity-pmacct","owner":"ZenithalHourlyRate","description":"pmacct config for gravity network","archived":false,"fork":false,"pushed_at":"2020-08-24T08:27:52.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T03:11:28.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZenithalHourlyRate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-07-17T13:40:27.000Z","updated_at":"2020-08-24T08:27:55.000Z","dependencies_parsed_at":"2023-05-18T00:32:19.687Z","dependency_job_id":null,"html_url":"https://github.com/ZenithalHourlyRate/gravity-pmacct","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZenithalHourlyRate/gravity-pmacct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fgravity-pmacct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fgravity-pmacct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fgravity-pmacct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fgravity-pmacct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZenithalHourlyRate","download_url":"https://codeload.github.com/ZenithalHourlyRate/gravity-pmacct/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZenithalHourlyRate%2Fgravity-pmacct/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261080621,"owners_count":23106601,"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":[],"created_at":"2024-10-12T17:44:31.992Z","updated_at":"2025-06-21T07:07:03.615Z","avatar_url":"https://github.com/ZenithalHourlyRate.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gravity pmacct configuration files\n\nIn this repo, several necessary configuration files are provided for those\nhosts in `entropy/gravity` to support monitoring and collecting of the flows\nin `entropy/gravity`.\n\nThese files are primarily configured for `gravity`, for instructions about\npmacct in entropy, please refer to `ZenithalHourlyRate/entropy-pmacct`\n\n## Install pmacct\n\nSince hosts in `entropy/gravity` are mainly debian boxes, we suggest one \ncommand to rule them all.\n\n```bash\n$ sudo apt install pmacct\n```\n\nFor Arch users, however, `pmacct` is not in the official repos, but only in\nAUR, hence we recommend\n\n```bash\n$ [AUR helper] -S pmacct\n```\n\nFor arch linux arm users, we can build the package from the PKGBUILD obtained\nfrom x86_64 machines with proper changes and manual dependency check, and\n`pmacct` can run smoothly.\n\nFor CentOS users, the commands are\n\n```\nyum install libpcap libpcap-devel mariadb-libs mariadb-devel\ngit clone https://github.com/pmacct/pmacct\ncd pmacct\n./autogen.sh\n./configure --enable-mysql\nmake\nsudo make install\n```\n\n## Proper placement of the files\n\nThe file `gravity.conf`, `gravity.network.lst` and `gravity.pretag.map`\nshould be placed in `/etc/pmacct/` since we have\n fixed the path to them in `gravity.conf`.\n\n## Necessary changes in the files\n\nFirst we need to determine `gravity.pretag.map`, which is a unique id for \nyou box in the final statistics.\n\nFor gravity hosts with the SendPort `5XXXX` where\n`XXXX` is your unique id, we fill the field as\n\n```\nset_tag = XXXX\n```\n\nNow consider the `[redacted]` field in `gravity.conf`, they can be accessed\nvia `i@zenithal.me` or `t.me/ZenithalH`, or you can hack into the database\nto obtain them.\n\nNote that the credential used for entropy and gravity are different!\n\n## Daemon on startup\n\nFirst of all, check that in `/etc/pmacct/gravity.conf`, `daemonize` is set \nto be `true`!\n\n### openrc\n\nFor `openrc` users, especially those with debian, first we need to disable\nthe default daemon when installing `pmacct` by\n\n```\nrc-update del pmacctd default\nrc-update del uacctd default\nrc-update del nfacctd default\nrc-update del sfacctd default\n```\n\nThen you should move `etc.init.d.pmacctd.gravity` to \n`/etc/init.d/pmacctd.gravity` and move `etc.default.pmacctd.gravity` to\n`/etc/default/pmacctd.gravity`. Remember to check that \n`/etc/init.d/pmacctd.gravity` is eXecutable, namely `+x`.\n\nThen by the following commands to start the\ndaemon (proper changes to the configuration file needed!)\n\n```\nrc-update add pmacctd.gravity default\nrc-service pmacctd.gravity start\n```\n\nWe use the following command to disable the service\n\n```\nrc-update del pmacctd.gravity default\n```\n\n### systemd\n\nFirst move `lib.systemd.system.pmacctd.gravity.service` to \n`/lib/systemd/system/pmacctd.gravity.service`, then move \n`etc.default.pmacctd.gravity` to `/etc/default/pmacctd.gravity`. We use the\nfollowing command to enable and start the service\n\n```\nsystemctl enable --now pmacctd.gravity.service\n```\n\nUse the following command to disable the service\n\n```\nsystemctl disable pmacctd.gravity.service\n```\n\n## Comment on gravity.network.lst\n\nThis list provides an ip-to-subnet mapping. \n\nNote that you can add `gravity.network.lst` and `entropy.network.lst` together.\n\nNow this file is generated by a script in this repo, but it \ncan not change automatically, which may cause inconsistency. The issue should\nbe resolved latter by `sync etc` effort of other participants.\n\n## Docker\n\nThanks to [this repo](github.com/DE-IBH/pmacct-docker), we get a prototype for \nthe dockerfile and docker-compose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenithalhourlyrate%2Fgravity-pmacct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenithalhourlyrate%2Fgravity-pmacct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenithalhourlyrate%2Fgravity-pmacct/lists"}