Giter Site home page Giter Site logo

dehnli / nfsen-ng Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mbolli/nfsen-ng

0.0 0.0 0.0 1.09 MB

Responsive NetFlow visualizer built on top of nfdump tools.

License: Apache License 2.0

JavaScript 31.20% PHP 44.40% CSS 6.19% HTML 18.20%

nfsen-ng's Introduction

nfsen-ng

GitHub license GitHub issues Donate a beer

nfsen-ng is an in-place replacement for the ageing nfsen.

Used components

TOC

Installation

We try to support a decent range of Linux distributions. Additional installation instructions are available in INSTALL.md. Pull requests for additional distributions are welcome.

Ubuntu 22.04 LTS:

# run following commands as root
# install packages
apt install apache2 git nfdump pkg-config php8.1 php8.1-dev libapache2-mod-php8.1 rrdtool librrd-dev
# enable apache modules
a2enmod rewrite deflate headers expires
# install rrd library for php
pecl install rrd
# create rrd library mod entry for php
echo "extension=rrd.so" > /etc/php/8.1/mods-available/rrd.ini
# enable php mod
phpenmod rrd
# configure virtual host to read .htaccess files
vi /etc/apache2/apache2.conf # set AllowOverride All for /var/www
# restart apache web server
systemctl restart apache2
# install nfsen-ng
cd /var/www/html # or wherever
git clone https://github.com/mbolli/nfsen-ng
chown -R www-data:www-data .
chmod +x nfsen-ng/backend/cli.php
# next step: configuration

Configuration

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.

The 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:

  • general
    • 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...
    • sources: (array('source1', ...)) The sources to scan.
    • db: (RRD) The name of the datasource class (case-sensitive).
  • frontend
    • reload_interval: Interval in seconds between graph reloads.
  • nfdump
    • binary: (/usr/bin/nfdump) The location of your nfdump executable
    • profiles-data: (/var/nfdump/profiles_data) The location of your nfcapd files
    • profile: (live) The profile folder to use
    • 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 > 1 if you want nfsen-ng to be usable while running another query.
  • db If the used data source needs additional configuration, you can specify it here, e.g. host and port.
  • log

CLI

The command line interface is used to initially scan existing nfcapd.* files, or to administer the daemon.

Usage:

./cli.php [ options ] import

or for the daemon

./cli.php start|stop|status

  • Options:

    • -v Show verbose output
    • -p Import ports data as well Note: Using RRD this will take quite a bit longer, depending on the number of your defined ports.
    • -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.
    • -f Force overwriting database and start fresh
  • Commands:

    • import Import existing nfdump data to nfsen-ng. Note: If you have existing nfcapd files, better do this overnight.
    • start Start the daemon for continuous reading of new data
    • stop Stop the daemon
    • status Get the daemon's status
  • Examples:

    • ./cli.php -f import Imports fresh data for sources

    • ./cli.php -f -p -ps import Imports all data

    • ./cli.php start Starts the daemon

API

The API is used by the frontend to retrieve data. The API endpoints are documented in API_ENDPOINTS.md.

nfsen-ng's People

Contributors

mbolli avatar dona21 avatar nrensen avatar jp-asdf avatar luizgb avatar dehnli avatar dominiquefournier avatar panaceya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.