packages/net/nlbwmon/Makefile
Jo-Philipp Wich e32168f9b7 nlbwmon: add package
This commit introduces nlbwmon, the lightweight NetLink BandWidth Montor.

The nlbwmon daemon gathers per-host traffic statistics by querying netlink
accounting data. Due to this approach, the executable is very small and does
not rely on libpcap and CPU intensive raw sockets to monitor traffic.

Besides raw per-host traffic counters, nlbwmon also support rudimentary
traffic classification by observing IP protocols and used port numbers.

Gathered accounting data is stored into a series of database files which
are regularily committed to persistent storage.

Refresh, commit and accounting intervals are freely configurable as well
as the layer7 protocol mapping rules and observed source subnets.

This package also bundles a cli client which can be used to dump the
gathered traffic data as JSON, CSV or plaintext data. A pull request to
add a graphical LuCI frontend for nlbwmon is pending.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-07-28 15:30:06 +02:00

42 lines
1.2 KiB
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=nlbwmon
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jow-/nlbwmon.git
PKG_SOURCE_DATE:=2017-07-28
PKG_SOURCE_VERSION:=76487b5ec06cdeed097bd91c0216ab61861bcf07
PKG_MIRROR_HASH:=981c70a7cb1811bbf45261e64a18c5c0fca3fb3a93ac299ce614c08c153ac7e0
CMAKE_INSTALL:=1
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
define Package/nlbwmon
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libubox +libnl-tiny +zlib +kmod-nf-conntrack-netlink
TITLE:=LEDE Traffic Usage Monitor
endef
define Package/nlbwmon/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nlbwmon $(1)/usr/sbin/nlbwmon
$(LN) nlbwmon $(1)/usr/sbin/nlbw
$(INSTALL_DIR) $(1)/usr/share/nlbwmon
$(INSTALL_DATA) $(PKG_BUILD_DIR)/protocols.txt $(1)/usr/share/nlbwmon/protocols
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/nlbwmon.init $(1)/etc/init.d/nlbwmon
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/nlbwmon.config $(1)/etc/config/nlbwmon
endef
$(eval $(call BuildPackage,nlbwmon))