{"id":13584729,"url":"https://github.com/mbolli/nfsen-ng","last_synced_at":"2026-03-17T12:27:23.444Z","repository":{"id":21835968,"uuid":"87514235","full_name":"mbolli/nfsen-ng","owner":"mbolli","description":"Responsive NetFlow visualizer built on top of nfdump tools.","archived":false,"fork":false,"pushed_at":"2024-03-15T07:22:19.000Z","size":1104,"stargazers_count":229,"open_issues_count":17,"forks_count":43,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-08-02T15:55:53.559Z","etag":null,"topics":["netflow","network","network-analysis","nfdump","nfsen","nfsen-ng","visualization"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbolli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"mbolli","custom":"https://paypal.me/bolli"}},"created_at":"2017-04-07T06:47:37.000Z","updated_at":"2024-08-01T11:02:09.000Z","dependencies_parsed_at":"2024-02-28T19:56:33.636Z","dependency_job_id":"b21fa4ee-02ab-4581-9094-d37fe4638d7c","html_url":"https://github.com/mbolli/nfsen-ng","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbolli%2Fnfsen-ng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbolli%2Fnfsen-ng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbolli%2Fnfsen-ng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbolli%2Fnfsen-ng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbolli","download_url":"https://codeload.github.com/mbolli/nfsen-ng/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223272916,"owners_count":17117708,"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":["netflow","network","network-analysis","nfdump","nfsen","nfsen-ng","visualization"],"created_at":"2024-08-01T15:04:28.869Z","updated_at":"2026-03-17T12:27:23.438Z","avatar_url":"https://github.com/mbolli.png","language":"PHP","funding_links":["https://github.com/sponsors/mbolli","https://paypal.me/bolli"],"categories":["PHP"],"sub_categories":[],"readme":"# nfsen-ng\n\n[![GitHub license](https://img.shields.io/github/license/mbolli/nfsen-ng.svg?style=flat-square)](https://github.com/mbolli/nfsen-ng/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/mbolli/nfsen-ng.svg?style=flat-square)](https://github.com/mbolli/nfsen-ng/issues)\n[![Donate a beer](https://img.shields.io/badge/paypal-donate-yellow.svg?style=flat-square)](https://paypal.me/bolli)\n\nnfsen-ng is an in-place replacement for the ageing nfsen.\n\n![nfsen-ng dashboard overview](https://github.com/mbolli/nfsen-ng/assets/722725/c3df942e-3d3c-4ef9-86ad-4e5780c7b6d8)\n\n## Used components\n\n* Front end: [jQuery](https://jquery.com), [dygraphs](http://dygraphs.com), [FooTable](http://fooplugins.github.io/FooTable/), [ion.rangeSlider](http://ionden.com/a/plugins/ion.rangeSlider/en.html)\n* Back end: [RRDtool](http://oss.oetiker.ch/rrdtool/), [nfdump tools](https://github.com/phaag/nfdump)\n\n## TOC\n\n* [nfsen-ng](#nfsen-ng)\n  * [Installation](#installation)\n  * [Configuration](#configuration)\n    * [Nfdump](#nfdump)\n  * [CLI/Daemon](#cli--daemon)\n    * [Daemon as a systemd service](#daemon-as-a-systemd-service)\n  * [Logs](#logs)\n  * [API](#api)\n\n## Installation\n\nDetailed installation instructions are available in [INSTALL.md](./INSTALL.md). Pull requests for additional distributions are welcome.\n\nSoftware packages required:\n\n* nfdump\n* rrdtool\n* git\n* composer\n* apache2\n* php \u003e= 8.1\n\nApache modules required:\n\n* mod_rewrite\n* mod_deflate\n* mod_headers\n* mod_expires\n\nPHP modules required:\n\n* mbstring\n* rrd\n\n## Configuration\n\n\u003e *Note:* nfsen-ng expects the `profiles_data` folder structure to be `PROFILES_DATA_PATH/PROFILE/SOURCE/YYYY/MM/DD/nfcapd.YYYYMMDDHHII`, e.g. `/var/nfdump/profiles_data/live/source1/2018/12/01/nfcapd.201812010225`.\n\nThe default settings file is `backend/settings/settings.php.dist`. Copy it to `backend/settings/settings.php` and start modifying it. Example values are in *italic*:\n\n* **general**\n  * **ports:** (*array(80, 23, 22, ...)*) The ports to examine. *Note:* If you use RRD as datasource and want to import existing data, you might keep the number of ports to a minimum, or the import time will be measured in moon cycles...\n    * **sources:** (*array('source1', ...)*) The sources to scan.\n    * **db:** (*RRD*) The name of the datasource class (case-sensitive).\n  * **frontend**\n    * **reload_interval:** Interval in seconds between graph reloads.\n  * **nfdump**\n    * **binary:** (*/usr/bin/nfdump*) The location of your nfdump executable\n    * **profiles-data:** (*/var/nfdump/profiles_data*) The location of your nfcapd files\n    * **profile:** (*live*) The profile folder to use\n    * **max-processes:** (*1*) The maximum number of concurrently running nfdump processes. *Note:* Statistics and aggregations can use lots of system resources, even to aggregate one week of data might take more than 15 minutes. Put this value to \u003e 1 if you want nfsen-ng to be usable while running another query.\n  * **db** If the used data source needs additional configuration, you can specify it here, e.g. host and port.\n  * **log**\n    * **priority:** (*LOG_INFO*) see other possible values at [http://php.net/manual/en/function.syslog.php]\n\n### Nfdump\n\nNfsen-ng uses nfdump to read the nfcapd files. You can specify the location of the nfdump binary in `backend/settings/settings.php`. The default location is `/usr/bin/nfdump`.\n\nYou should also have a look at the nfdump configuration file `/etc/nfdump.conf` and make sure that the `nfcapd` files are written to the correct location. The default location is `/var/nfdump/profiles_data`.\n\nHhere is an example of an nfdump configuration:\n\n```ini\noptions='-z -S 1 -T all -l /var/nfdump/profiles_data/live/\u003csource\u003e -p \u003cport\u003e'\n```\n\nwhere\n\n* `-z` is used to compress the nfcapd files\n* `-S 1` is used to specify the nfcapd directory structure\n* `-T all` is used to specify the extension of the nfcapd files\n* `-l` is used to specify the destination location of the nfcapd files\n* `-p` is used to specify the port of the nfcapd files.\n\n#### Nfcapd x Sfcapd\n\nTo use sfcapd instead of nfcapd, you have to change the `nfdump` configuration file `/lib/systemd/system/nfdump@.service` to use `sfcapd` instead of `nfcapd`:\n\n```ini\n[Unit]\nDescription=netflow capture daemon, %I instance\nDocumentation=man:sfcapd(1)\nAfter=network.target auditd.service\nPartOf=nfdump.service\n\n[Service]\nType=forking\nEnvironmentFile=/etc/nfdump/%I.conf\nExecStart=/usr/bin/sfcapd -D -P /run/sfcapd.%I.pid $options\nPIDFile=/run/sfcapd.%I.pid\nKillMode=process\nRestart=no\n\n[Install]\nWantedBy=multi-user.target\n```\n\n## CLI + Daemon\n\nThe command line interface is used to initially scan existing nfcapd.* files, or to administer the daemon.\n\nUsage:\n\n  `./cli.php [ options ] import`\n\nor for the daemon\n\n  `./cli.php start|stop|status`\n\n* **Options:**\n  * **-v**  Show verbose output\n  * **-p**  Import ports data as well *Note:* Using RRD this will take quite a bit longer, depending on the number of your defined ports.\n  * **-ps**  Import ports per source as well *Note:* Using RRD this will take quite a bit longer, depending on the number of your defined ports.\n  * **-f**  Force overwriting database and start fresh\n\n  * **Commands:**\n    * **import** Import existing nfdump data to nfsen-ng. *Note:* If you have existing nfcapd files, better do this overnight or over a week-end.\n    * **start** Start the daemon for continuous reading of new data\n    * **stop** Stop the daemon\n    * **status** Get the daemon's status\n\n  * **Examples:**\n    * `./cli.php -f import`\n        Imports fresh data for sources\n\n    * `./cli.php -f -p -ps import`\n        Imports all data\n\n    * `./cli.php start`\n        Starts the daemon\n\n### Daemon as a systemd service\n\nYou can use the daemon as a service. To do so, you can use the provided systemd service file below. You can copy it to `/etc/systemd/system/nfsen-ng.service` and then start it with `systemctl start nfsen-ng`.\n\n```ini\n[Unit]\nDescription=nfsen-ng\nAfter=network-online.target\n\n[Service]\nType=simple\nRemainAfterExit=yes\nrestart=always\nstartLimitIntervalSec=0\nrestartSec=2\nExecStart=su - www-data --shell=/bin/bash -c '/var/www/html/nfsen-ng/backend/cli.php start'\nExecStop=su - www-data --shell=/bin/bash -c '/var/www/html/nfsen-ng/backend/cli.php stop'\n\n[Install]\nWantedBy=multi-user.target\n```\n\nNow, you should reload and enable the service to start on boot with `systemctl daemon-reload` and `systemctl enable nfsen-ng`.\n\n## Logs\n\nNfsen-ng logs to syslog. You can find the logs in `/var/log/syslog` or `/var/log/messages` depending on your system. Some distributions might register it in `journalctl`. To access the logs, you can use `tail -f /var/log/syslog` or `journalctl -u nfsen-ng`\n\nYou can change the log priority in `backend/settings/settings.php`.\n\n## API\n\nThe API is used by the frontend to retrieve data. The API endpoints are documented in [API_ENDPOINTS.md](./API_ENDPOINTS.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbolli%2Fnfsen-ng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbolli%2Fnfsen-ng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbolli%2Fnfsen-ng/lists"}