https://github.com/zenithalhourlyrate/gravity-pmacct
pmacct config for gravity network
https://github.com/zenithalhourlyrate/gravity-pmacct
Last synced: about 1 year ago
JSON representation
pmacct config for gravity network
- Host: GitHub
- URL: https://github.com/zenithalhourlyrate/gravity-pmacct
- Owner: ZenithalHourlyRate
- Created: 2020-07-17T13:40:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-24T08:27:52.000Z (almost 6 years ago)
- Last Synced: 2025-03-14T03:11:28.511Z (over 1 year ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gravity pmacct configuration files
In this repo, several necessary configuration files are provided for those
hosts in `entropy/gravity` to support monitoring and collecting of the flows
in `entropy/gravity`.
These files are primarily configured for `gravity`, for instructions about
pmacct in entropy, please refer to `ZenithalHourlyRate/entropy-pmacct`
## Install pmacct
Since hosts in `entropy/gravity` are mainly debian boxes, we suggest one
command to rule them all.
```bash
$ sudo apt install pmacct
```
For Arch users, however, `pmacct` is not in the official repos, but only in
AUR, hence we recommend
```bash
$ [AUR helper] -S pmacct
```
For arch linux arm users, we can build the package from the PKGBUILD obtained
from x86_64 machines with proper changes and manual dependency check, and
`pmacct` can run smoothly.
For CentOS users, the commands are
```
yum install libpcap libpcap-devel mariadb-libs mariadb-devel
git clone https://github.com/pmacct/pmacct
cd pmacct
./autogen.sh
./configure --enable-mysql
make
sudo make install
```
## Proper placement of the files
The file `gravity.conf`, `gravity.network.lst` and `gravity.pretag.map`
should be placed in `/etc/pmacct/` since we have
fixed the path to them in `gravity.conf`.
## Necessary changes in the files
First we need to determine `gravity.pretag.map`, which is a unique id for
you box in the final statistics.
For gravity hosts with the SendPort `5XXXX` where
`XXXX` is your unique id, we fill the field as
```
set_tag = XXXX
```
Now consider the `[redacted]` field in `gravity.conf`, they can be accessed
via `i@zenithal.me` or `t.me/ZenithalH`, or you can hack into the database
to obtain them.
Note that the credential used for entropy and gravity are different!
## Daemon on startup
First of all, check that in `/etc/pmacct/gravity.conf`, `daemonize` is set
to be `true`!
### openrc
For `openrc` users, especially those with debian, first we need to disable
the default daemon when installing `pmacct` by
```
rc-update del pmacctd default
rc-update del uacctd default
rc-update del nfacctd default
rc-update del sfacctd default
```
Then you should move `etc.init.d.pmacctd.gravity` to
`/etc/init.d/pmacctd.gravity` and move `etc.default.pmacctd.gravity` to
`/etc/default/pmacctd.gravity`. Remember to check that
`/etc/init.d/pmacctd.gravity` is eXecutable, namely `+x`.
Then by the following commands to start the
daemon (proper changes to the configuration file needed!)
```
rc-update add pmacctd.gravity default
rc-service pmacctd.gravity start
```
We use the following command to disable the service
```
rc-update del pmacctd.gravity default
```
### systemd
First move `lib.systemd.system.pmacctd.gravity.service` to
`/lib/systemd/system/pmacctd.gravity.service`, then move
`etc.default.pmacctd.gravity` to `/etc/default/pmacctd.gravity`. We use the
following command to enable and start the service
```
systemctl enable --now pmacctd.gravity.service
```
Use the following command to disable the service
```
systemctl disable pmacctd.gravity.service
```
## Comment on gravity.network.lst
This list provides an ip-to-subnet mapping.
Note that you can add `gravity.network.lst` and `entropy.network.lst` together.
Now this file is generated by a script in this repo, but it
can not change automatically, which may cause inconsistency. The issue should
be resolved latter by `sync etc` effort of other participants.
## Docker
Thanks to [this repo](github.com/DE-IBH/pmacct-docker), we get a prototype for
the dockerfile and docker-compose