sw-collector: Moved to its own directory and added man page

This commit is contained in:
Andreas Steffen 2017-07-16 09:52:52 +02:00
parent 34cade8b84
commit 964bf73237
18 changed files with 133 additions and 22 deletions

View File

@ -1956,6 +1956,7 @@ AC_CONFIG_FILES([
src/checksum/Makefile
src/conftest/Makefile
src/pt-tls-client/Makefile
src/sw-collector/Makefile
src/swanctl/Makefile
scripts/Makefile
testing/Makefile
@ -1988,6 +1989,8 @@ AC_CONFIG_FILES([
src/swanctl/swanctl.8
src/swanctl/swanctl.conf.5.head
src/swanctl/swanctl.conf.5.tail
src/pt-tls-client/pt-tls-client.1
src/sw-collector/sw-collector.8
])
AC_OUTPUT

View File

@ -135,3 +135,7 @@ endif
if USE_AIKGEN
SUBDIRS += aikgen
endif
if USE_IMC_SWIMA
SUBDIRS += sw-collector
endif

View File

@ -19,8 +19,7 @@ $(swid_tag) : $(regid)__strongSwan.swidtag.in
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libtncif \
-I$(top_srcdir)/src/libimcv \
-DPLUGINS=\""random openssl sqlite curl"\"
-I$(top_srcdir)/src/libimcv
AM_CFLAGS = \
$(PLUGIN_CFLAGS) $(json_CFLAGS)
@ -32,23 +31,3 @@ imc_swima_la_LIBADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la
imc_swima_la_SOURCES = imc_swima.c imc_swima_state.h imc_swima_state.c
imc_swima_la_LDFLAGS = -module -avoid-version -no-undefined
ipsec_PROGRAMS = sw-collector
sw_collector_SOURCES = \
sw_collector/sw-collector.c \
sw_collector/sw_collector_db.h sw_collector/sw_collector_db.c \
sw_collector/sw_collector_dpkg.h sw_collector/sw_collector_dpkg.c \
sw_collector/sw_collector_history.h sw_collector/sw_collector_history.c \
sw_collector/sw_collector_info.h sw_collector/sw_collector_info.c \
sw_collector/sw_collector_rest_api.h sw_collector/sw_collector_rest_api.c
sw_collector_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
$(top_builddir)/src/libimcv/libimcv.la \
$(json_LIBS)
sw-collector.o : $(top_builddir)/config.status
templatesdir = $(pkgdatadir)/templates/database/sw-collector
dist_templates_DATA = sw_collector/sw_collector_tables.sql

2
src/sw-collector/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
sw-collector
sw-collector.8

View File

@ -0,0 +1,33 @@
sbin_PROGRAMS = sw-collector
sw_collector_SOURCES = \
sw-collector.c \
sw_collector_db.h sw_collector_db.c \
sw_collector_dpkg.h sw_collector_dpkg.c \
sw_collector_history.h sw_collector_history.c \
sw_collector_info.h sw_collector_info.c \
sw_collector_rest_api.h sw_collector_rest_api.c
sw-collector.o : $(top_builddir)/config.status
AM_CPPFLAGS = \
-I$(top_srcdir)/src/libstrongswan \
-I$(top_srcdir)/src/libtncif \
-I$(top_srcdir)/src/libimcv \
-DPLUGINS=\""random openssl sqlite curl"\"
AM_CFLAGS = $(json_CFLAGS)
sw_collector_LDADD = \
$(top_builddir)/src/libstrongswan/libstrongswan.la \
$(top_builddir)/src/libimcv/libimcv.la \
$(json_LIBS)
templatesdir = $(pkgdatadir)/templates/database/sw-collector
dist_templates_DATA = sw_collector_tables.sql
man8_MANS = sw-collector.8
CLEANFILES = $(man8_MANS)

View File

@ -0,0 +1,90 @@
.TH SW-COLLECTOR 1 "2017-07-15" "@PACKAGE_VERSION@" "strongSwan"
.
.SH "NAME"
.
sw-collector \- Extracts software installation events from dpkg history log
.
.SH "SYNOPSIS"
.
.SY "sw-collector"
.OP \-\-debug level
.OP \-\-quiet
.OP \-\-count event-count
.YS
.
.SY "sw-collector"
.OP \-\-debug level
.OP \-\-quiet
.BR \-\-list |\fB\-\-unregistered\fR|\fB\-\-generate\fR|\fB\-\-migrate
.YS
.
.SY "sw-collector"
.B \-h
|
.B \-\-help
.YS
.
.SH "DESCRIPTION"
.
.B sw-collector
extracts information about software package installation, update or removal
events from the apt history log and stores the software events in an SQLite
database. The retrieved history information is then merged and made consistent
with the actual list of installed software packages obtained with dpkg-query.
.
.SH "OPTIONS"
.
.TP
.B "\-h, \-\-help"
Prints usage information and a short summary of the available commands.
.TP
.BI "\-v, \-\-debug " level
Set debug level, default: 2.
.TP
.B "\-q, \-\-quiet
Disable debug output to stderr.
.TP
.B "\-l, \-\-list
Lists all software packages stored in the collector database showing their
installation status.
.TP
.B "\-u, \-\-unregistered
Lists all software packages residing in the local collector database but for
which no SWID tags exist yet in a central collector database reachable via a
REST interface.
.TP
.B "\-g, \-\-generate
Generates minimal SWID tags for all deleted software packages residing in the
local collector database but for which no SWID tags exist in a central collector
database reachable via a REST interface.
.TP
.B "\-m, \-\-migrate
Can be used to migrate collector database versions. Currently all architecture
suffixes are removed from dpkg package names.
.
.SH "CONFIGURATION"
.
The following parameters can be configured in strongswan.conf:
.P
sw-collector {
database = sqlite:///etc/pts/collector.db
history = /var/log/apt/history.log
first_time = 2016-04-22T20:55:14Z
rest_api {
uri = https://admin-user:ietf99hackathon@tnc.strongswan.org/api/
timeout = 120
}
tag_creator {
name = strongSwan Project
regid = strongswan.org
}
}
.
.SH "FILES"
.
@PKGDATADIR@/templates/database/sw-collector/sw_collector_tables.sql
.
.SH "SEE ALSO"
.
.BR strongswan.conf (5)