Martin Hauke 2024-11-14 17:08:15 +00:00 committed by Git OBS Bridge
commit 06a97fbf9b
16 changed files with 2259 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

29
nfacctd.conf Normal file
View File

@ -0,0 +1,29 @@
! nfacctd configuration
!
!
!
daemonize: true
pidfile: /var/run/nfacctd.pid
syslog: daemon
!
! interested in in and outbound traffic
aggregate: src_host,dst_host
! on this network
pcap_filter: net 127.0.0.0/8
! on this interface
interface: lo
!
! storage methods
!plugins: pgsql
!sql_host: localhost
!sql_passwd:
! refresh the db every minute
!sql_refresh_time: 60
! reduce the size of the insert/update clause
!sql_optimize_clauses: true
! accumulate values in each row for up to an hour
!sql_history: 1h
! create new rows on the minute, hour, day boundaries
!sql_history_roundoff: mhd
! in case of emergency, log to this file
!sql_recovery_logfile: /var/lib/pmacct/nfacctd_recovery_log

3
pmacct-1.7.8.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4df50a3c6c7bdace3345bbf3bd4f6fa7a6722ec1fb45dfd266ad956b327da98a
size 2175335

3
pmacct-1.7.9.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94185c33d659772035c63be0a82601bb9eb064fb4be1d68ba279b47204b2750a
size 2132268

121
pmacct.1 Normal file
View File

@ -0,0 +1,121 @@
.\" Initial compilation manufacture around midnight
.\" at the end of March 10th, 2011.
.TH "pmacct" "1" "March 2011" "0.12.1" "pmacct"
.SH NAME
pmacct \- frontend to pmacctd.
.SH SYNOPSIS
.B pmacct
\fIquery\fR
.SH DESCRIPTION
.B pmacct
is a frontend to
.BR pmacctd (8)
when used in volatile memory mode.
.PP
The type of query is specified using options.
At least one of the options
\fB\-C\fR, \fB\-c\fR, \fB\-e\fR, \fB\-s\fR, or \fB\-t\fR
is mandatory, but with \fB\-c\fR either of \fB\-M\fR or
\fB\-N\fR must be used for further specification.
.SH OPTIONS
For displaying data either of these options are used:
.TP
\fB\-s\fR
Show full statistics.
.TP
\fB\-c \fI aggregate\fR
Specify primitives in a match aggregation, in order to present
partial statistics. Either \fB\-M\fR or \fB\-N\fR must be used
to specify matching data for this option. Here \fI aggregate\fR
is a comma separated string constructed from the following
identifiers, in arbitrary order:
src_mac, dst_mac, vlan, src_host, dst_host, src_net, dst_net,
src_mask, dst_mask, src_port, dst_port, tos, proto, src_as,
dst_as, sum_mac, sum_host, sum_net, sum_as, sum_port, in_iface,
out_iface, tag, tag2, flows, class, std_comm, ext_comm, as_path,
peer_src_ip, peer_dst_ip, peer_src_as, peer_dst_as, src_as_path,
src_std_comm, src_med, src_ext_comm, src_local_pref, is_symmetric.
Only entries which match the aggregate are printed.
.PP
Management of the server daemon is offered by three options:
.TP
\fB\-e\fR
Clear all statistics. For a partial clear, see \fB\-r\fR.
.TP
\fB\-t\fR
Show memory table status.
.TP
\fB\-C\fR
Show a table of all active classifiers.
.SH MODIFIERS
The primary options above can be influenced by some secondary options:
.TP
\fB\-p \fR \fI file\fR
Unix socket location for client\-server communication. Default is
\fI/tmp/collect.pipe\fR.
.TP
\fB\-a\fR
Display all table fields, even currently unused fields.
.TP
\fB\-S\fR
Calculate a summed total of all counters, instead of returning
a counter for each individual match; applies to \fB\-N\fR.
.TP
\fB\-n\fR {bytes|packets|flows|all}
Select which counters to print. This applies only to \fB\-N\fR.
.TP
\fB\-T\fR {bytes|packets|flows}
Output statistics ordered by decreasing value of the indicated field.
This option applies to \fB\-M\fR and to \fB\-s\fR.
.TP
\fB\-r\fR
Reset counters in the present selection after printing their values.
The option applies only to \fB\-M\fR and to \fB\-N\fR.
.TP
\fB\-l\fR
Perform a locking on the table.
.TP
\fB\-M\fR {\fImatch_data\fR | file:\fIfilename\fR}
Print a formatted table for all entries matching the given data.
An aggregation must be specified using \fB\-c\fR, and the field
order given there must be observed when stating the data here.
The output can be influenced using \fB\-T\fR.
.IP
Here \fImatch_data\fR is a number of substrings separated by
semicolon, each substring being a comma separated list of acceptable
values in a match aggregation. A wildcard \'*\' can be used
to match any value in a specific field.
.IP
As an alternative, a location \fIfilename\fR of a file can be
specified. This file provides the substrings mentioned above
as separate lines. The prefix \'file:\' is a verbatim marker.
.TP
\fB\-N \fI {\fImatch_data\fR | file:\fIfilename\fT}
Print counters only, no text fields, header, or footer.
This presupposes \fB\-c\fR, and can be influenced by \fB\-n\fR
and \fB\-S\fR. The arguments are identical to those for \fB\-M\fR.
.SH EXAMPLES
The file
.I /usr/share/doc/pmacct/EXAMPLES.gz
contains suggestions prepared by the upstream author.
.PP
For suggestions, critisism, and bugs, get in contact with
Paolo Lucente <paolo@pmacct.net>.
.SH "SEE ALSO"
.BR pmacctd (8)
.SH AUTHOR
This text was originally compiled by Mats Erik Andersson
for the Debian project, but may be distributed for other
uses under the same licensing as the software itself.

1759
pmacct.changes Normal file

File diff suppressed because it is too large Load Diff

22
pmacct.nfacctd.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=netflow accounting daemon
After=network.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
Type=forking
EnvironmentFile=-/etc/sysconfig/nfacctd
ExecStart=/usr/sbin/nfacctd -f ${NFACCTD_CONF} $DAEMON_OPTS
[Install]
WantedBy=multi-user.target

7
pmacct.nfacctd.sysconfig Normal file
View File

@ -0,0 +1,7 @@
# Defaults for nfacct initscript and systemd service
# Location of the configuration file
NFACCTD_CONF=/etc/pmacct/nfacctd.conf
# Additional options that are passed to nfacctd
DAEMON_OPTS=""

22
pmacct.pmacctd.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=promiscuous mode accounting daemon
After=network.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
Type=forking
EnvironmentFile=-/etc/sysconfig/pmacctd
ExecStart=/usr/sbin/pmacctd -f ${PMACCTD_CONF} $DAEMON_OPTS
[Install]
WantedBy=multi-user.target

10
pmacct.pmacctd.sysconfig Normal file
View File

@ -0,0 +1,10 @@
# Defaults for pmacct initscript and systemd service
# IMPORTANT DURING UPGRADES:
# SUPPORT FOR INTERFACES="" WAS REMOVED FROM THE INIT SCRIPT.
# Location of the configuration file
PMACCTD_CONF=/etc/pmacct/pmacctd.conf
# Additional options that are passed to pmacctd
DAEMON_OPTS=""

22
pmacct.sfacctd.service Normal file
View File

@ -0,0 +1,22 @@
[Unit]
Description=sflow accounting daemon
After=network.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
ProtectHostname=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
Type=forking
EnvironmentFile=-/etc/sysconfig/sfacctd
ExecStart=/usr/sbin/sfacctd -f ${SFACCTD_CONF} $DAEMON_OPTS
[Install]
WantedBy=multi-user.target

7
pmacct.sfacctd.sysconfig Normal file
View File

@ -0,0 +1,7 @@
# Defaults for sfacct initscript and systemd service
# Location of the configuration file
SFACCTD_CONF=/etc/pmacct/sfacctd.conf
# Additional options that are passed to sfacctd
DAEMON_OPTS=""

172
pmacct.spec Normal file
View File

@ -0,0 +1,172 @@
#
# spec file for package pmacct
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%bcond_with ndpi
Name: pmacct
Version: 1.7.9
Release: 0
Summary: Accounting and aggregation toolsuite for IPv4 and IPv6
License: GPL-2.0-only
Group: Productivity/Networking/Diagnostic
URL: http://www.pmacct.net/
Source: http://www.pmacct.net/pmacct-%{version}.tar.gz
Source4: pmacct.nfacctd.service
Source5: pmacct.pmacctd.service
Source6: pmacct.sfacctd.service
Source7: pmacct.nfacctd.sysconfig
Source8: pmacct.pmacctd.sysconfig
Source9: pmacct.sfacctd.sysconfig
Source10: nfacctd.conf
Source11: pmacctd.conf
Source12: sfacctd.conf
Source20: pmacct.1
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: libmysqlclient-devel
BuildRequires: libpcap-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: postgresql-devel
BuildRequires: sqlite-devel >= 3.0.0
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(jansson)
BuildRequires: pkgconfig(libmaxminddb)
BuildRequires: pkgconfig(libzmq)
BuildRequires: pkgconfig(numa)
%if %{with ndpi}
BuildRequires: pkgconfig(libndpi)
%endif
%if 0%{?is_opensuse} == 1
BuildRequires: libnetfilter_log-devel
%endif
%description
pmacct is a set of passive network monitoring tools to measure, account,
classify and aggregate IPv4 and IPv6 traffic; a pluggable
architecture allows to store the collected traffic data into memory tables or
SQL (MySQL, SQLite, PostgreSQL) databases. pmacct supports customizable
historical data breakdown, flow sampling, filtering and tagging, recovery
actions, and triggers. Libpcap, sFlow v2/v4/v5 and NetFlow v1/v5/v7/v8/v9 are
supported, both unicast and multicast. A client program can export
export data to tools like RRDtool, GNUPlot, Net-SNMP, MRTG, and Cacti.
%prep
%setup -q -n %{name}-%{version}
# fix permissions
chmod -x sql/pmacct-*
%build
autoreconf -fiv
export CFLAGS="%{optflags} -Wno-return-type -fcommon"
%configure \
--sysconfdir=%{_sysconfdir}/%{name} \
--docdir="%{_docdir}/%{name}" \
--enable-mmap \
--enable-l2 \
--enable-mysql \
--enable-pgsql \
--enable-sqlite3 \
%if %{with ndpi}
--enable-ndpi \
%endif
--enable-geoipv2 \
%if 0%{?suse_version} >= 1310 && 0%{?is_opensuse} == 1
--enable-jansson \
%endif
--enable-64bit \
%if 0%{?is_opensuse} == 1
--enable-nflog \
%endif
--enable-threads
make %{?_smp_mflags}
%install
%make_install
install -d %{buildroot}%{_fillupdir}
install -m 0644 %{SOURCE7} %{buildroot}%{_fillupdir}/sysconfig.nfacctd
install -m 0644 %{SOURCE8} %{buildroot}%{_fillupdir}/sysconfig.pmacctd
install -m 0644 %{SOURCE9} %{buildroot}%{_fillupdir}/sysconfig.sfacctd
install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/nfacctd.service
install -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}/pmacctd.service
install -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/sfacctd.service
# examples
install -d %{buildroot}%{_sysconfdir}/pmacct/
install -m 0600 %{SOURCE10} %{buildroot}/%{_sysconfdir}/pmacct/nfacctd.conf
install -m 0600 %{SOURCE11} %{buildroot}/%{_sysconfdir}/pmacct/pmacctd.conf
install -m 0600 %{SOURCE12} %{buildroot}/%{_sysconfdir}/pmacct/sfacctd.conf
# manpage
install -d %{buildroot}%{_mandir}/man1
install -m 0644 %{SOURCE20} %{buildroot}%{_mandir}/man1
# remove unneeded files
rm -rf %{buildroot}/%{_datadir}/pmacct/examples/lg
rm -rf %{buildroot}/%{_libdir}/pmacct/examples/lg
rm -rf %{buildroot}/%{_libdir}/pmacct/examples/custom/libcustom.la
rm -rf %{buildroot}/%{_datadir}/pmacct/{CONFIG-KEYS,FAQS,QUICKSTART,UPGRADE,docs}
%pre
%service_add_pre nfacctd.service pmacctd.service sfacctd.service
%post
%service_add_post nfacctd.service pmacctd.service sfacctd.service
%{fillup_only -n nfacctd}
%{fillup_only -n pmacctd}
%{fillup_only -n sfacctd}
%preun
%service_del_preun nfacctd.service pmacctd.service sfacctd.service
%postun
%service_del_postun nfacctd.service pmacctd.service sfacctd.service
%files
%license COPYING
%doc AUTHORS ChangeLog CONFIG-KEYS FAQS QUICKSTART UPGRADE
%{_mandir}/man1/pmacct.1%{?ext_man}
%{_bindir}/pmacct
%{_sbindir}/nfacctd
%{_sbindir}/pmacctd
%{_sbindir}/sfacctd
%{_sbindir}/uacctd
%{_sbindir}/pmtelemetryd
%{_sbindir}/pmbgpd
%{_sbindir}/pmbmpd
%{_datadir}/pmacct
%{_unitdir}/*.service
%dir %{_sysconfdir}/pmacct
%config(noreplace) %{_sysconfdir}/pmacct/nfacctd.conf
%config(noreplace) %{_sysconfdir}/pmacct/pmacctd.conf
%config(noreplace) %{_sysconfdir}/pmacct/sfacctd.conf
%{_fillupdir}/sysconfig.*
%changelog

29
pmacctd.conf Normal file
View File

@ -0,0 +1,29 @@
! pmacctd configuration
!
!
!
daemonize: true
pidfile: /var/run/pmacctd.pid
syslog: daemon
!
! interested in in and outbound traffic
aggregate: src_host,dst_host
! on this network
pcap_filter: net 127.0.0.0/8
! on this interface
interface: lo
!
! storage methods
!plugins: pgsql
!sql_host: localhost
!sql_passwd:
! refresh the db every minute
!sql_refresh_time: 60
! reduce the size of the insert/update clause
!sql_optimize_clauses: true
! accumulate values in each row for up to an hour
!sql_history: 1h
! create new rows on the minute, hour, day boundaries
!sql_history_roundoff: mhd
! in case of emergency, log to this file
!sql_recovery_logfile: /var/lib/pmacct/pmacctd_recovery_log

29
sfacctd.conf Normal file
View File

@ -0,0 +1,29 @@
! sfacctd configuration
!
!
!
daemonize: true
pidfile: /var/run/sfacctd.pid
syslog: daemon
!
! interested in in and outbound traffic
aggregate: src_host,dst_host
! on this network
pcap_filter: net 127.0.0.0/8
! on this interface
interface: lo
!
! storage methods
!plugins: pgsql
!sql_host: localhost
!sql_passwd:
! refresh the db every minute
!sql_refresh_time: 60
! reduce the size of the insert/update clause
!sql_optimize_clauses: true
! accumulate values in each row for up to an hour
!sql_history: 1h
! create new rows on the minute, hour, day boundaries
!sql_history_roundoff: mhd
! in case of emergency, log to this file
!sql_recovery_logfile: /var/lib/pmacct/sfacctd_recovery_log