Commit Graph

24 Commits (b2ce0ef9d5c65ecad7d2fffdce70b7c73a7b987c)

Author SHA1 Message Date
Nicholas Brown b2ce0ef9d5 Add a logging attribute to the ipfix config element
This allows the logging level to set as part of configuration, instead
of having to use the `-l` CLI option. This mean it can also be changed
dynamically when the config file is re-read for changes.
2020-05-27 10:57:25 +01:00
Nicholas Brown 30aedc9edf Simplify ConfigManager parsing loop 2019-03-29 12:17:50 +00:00
Nicholas Brown ca8539500a Just use LOG_* instead of MSG_*
Just a used grep/sed to replace them.
The order of MSG_ levels was just weird.
2018-02-12 22:27:24 +00:00
Nicholas Brown 065b3f5bb5 Use LOG_UPTO for traditional sylog behaviour 2018-02-12 22:27:24 +00:00
Luca Boccassi caea67c757 Fix typo in help text 2017-06-10 12:39:35 +01:00
Luca Boccassi 669ac758f2 Clarify in help text that -q is implied by -b 2017-06-09 18:06:09 +01:00
Luca Boccassi 45d5f7bd91 Use msg(MSG_FATAL) instead of fprintf in vermont.cc 2017-06-09 18:04:52 +01:00
Nicholas Brown ee74eda48d Remove unused variable 2017-06-08 18:49:34 +01:00
Nicholas Brown 5476edeae8 Simplify the logging code interaction with main
The existing syslog mask and msg level were essentially the same, as
setting the syslog mask was always also setting the msg level. Made
this more obvious by moving all the syslog handling code into the msg
module. This also give clean separation of responsibilities, and
reduces the code size, and makes the signal handlers simpler.

The significant change is dynamically allocate the ConfigManager so
that can be deleted explicitly, instead of when going out scope of
main, thus allowing for msg_shutdown to be called after this, as the
ConfigManager's destructor makes use of messaging. Being able to call
msg_shutdown mean syslog can be flushed/closed and pthread mutex not
left dangling.
2017-06-08 18:49:34 +01:00
Luca Boccassi 8ce50f7d92 Reload on SIGHUP, up/down debug on SIGUSR1/2
Reload on SIGHUP instead of SIGUSR1. SIGUSR1/2 increase/decrease debug
level at runtime.
Also add support for SIGTERM, same as SIGINT.
2017-06-08 18:49:34 +01:00
Luca Boccassi 0c492767bf Syslog and journald support
Add new CLI options to support logging to Syslog and journald.
journald support is also behind a new CMake flag, SUPPORT_JOURNALD,
since it adds a dependency on libsystemd-journal.
Add --quiet, which will disable output to STDOUT/STDERR. Useful
when logging directly to the above mentioned loggers.
Add --log-level, to allow for mix and match log levels, for example
only warning and critical can be enabled together.

New usage output:

VERsatile MONitoring Tool - VERMONT
 MANDATORY OPTIONS:
 -f, --config-file FILE     Use configuration file

 OTHER OPTIONS:
 -h, --help                 Display this help and exit
 -d, --debug                Log verbosity: -d NOTICE, -dd INFO,
                                -ddd DEBUG
 -l, --log-level LEVEL      Log level. Can be specified multiple
                                times and mix-matched.
                                In increasing order:

                                    debug
                                    info
                                    notice
                                    warning
                                    error
                                    critical

                                Default: critical, warning, error
 -q, --quiet                Do not write output to console
 -b, --daemon               Run in daemon mode (implies -q)
 -p, --pid-file FILE        Set process id filename (use with -d)
 -u, --user USER            Change user to USER (use with -d)
 -g, --group GROUP          Change group to GROUP (use with -d)
 -s, --syslog               Log to syslog
 -j, --journald             Log to journald
2017-06-08 18:49:34 +01:00
Luca Boccassi 2fc0a05d5b Add CLI options to daemonize
Add a number of new CLI options, which enable Vermont to run as an
old-style *nix daemon. These include forking itself in the
background, changing user and group id, and creating a PID file.
Useful when being run by a SysV Init script.

New help text:

VERsatile MONitoring Tool - VERMONT
 MANDATORY OPTIONS:
 -f, --config-file FILE     Use configuration file

 OTHER OPTIONS:
 -h, --help                 Display this help and exit
 -d, --debug                Log verbosity: -d NOTICE, -dd INFO,
                                -ddd DEBUG
 -b, --daemon               Run in daemon mode (implies -q)
 -p, --pid-file FILE        Set process id filename (use with -d)
 -u, --user USER            Change user to USER (use with -d)
 -g, --group GROUP          Change group to GROUP (use with -d)
2017-06-08 18:49:34 +01:00
Lothar Braun 5a73d5f155 Format fixes 2012-01-08 12:59:36 +01:00
Lothar Braun d28e24d233 use mach semaphores on mac os x instead of posix real time semaphores (as they are not supported on Mac OS X) 2011-03-07 16:02:33 +01:00
muenz c574beeb68 removed unsupported command line arguments
git-svn-id: file:///Users/braun/svn/vermont/trunk/vermont@2559 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-09-30 16:00:36 +00:00
limmer 64b3740e29 merged branch 'new-template' to dtls-merge
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/dtls-merge@2549 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-09-28 16:46:08 +00:00
sithhaue 1bcb187aab added a centralized signal handling mechanism in vermont
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/dtls-merge@2445 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-06-30 10:16:39 +00:00
danielmentz f0d0e7cad8 added comment that explains why ConfigManager must be initialized at the scope of the main function.
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/dtls-merge@2398 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-06-01 11:49:12 +00:00
danielmentz ffefbacc2f Moved variable definitions into another scope. Previously, the application crashed due to d'tors being called in the wrong order.
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/dtls-merge@2397 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-05-31 14:19:54 +00:00
danielmentz 46f10287be merged DTLS support
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/dtls-merge@2394 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-05-27 15:44:33 +00:00
limmer 8468aa5f04 fixed information element type ids in Vermont: now PENs (private enterprise numbers) are used for biflow and Vermont-specific fields
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/new-template@2375 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-05-20 12:23:47 +00:00
sithhaue 1d2b26fa8a Renamed PcapExporterFifo to PcapExporterPipe.
Removed DelayedDeleter/Reconnector.
If a module can't be reused after a reconfiguration, it will be shut down after a specific timeout.
Fixed some Segfaults.



git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/new-template@2331 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2010-05-05 11:30:02 +00:00
muenz 01e6e7e5a1 GPL2 comments addeed (shall we use headache instead? http://www.normalesup.org/~simonet/soft/headache/manual.html )
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/new-template@2221 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2009-12-14 11:12:16 +00:00
limmer 78ba659249 copied branch vermont-dynamic-config@r2113 to trunk
git-svn-id: file:///Users/braun/svn/vermont/trunk/vermont@2115 aef3b71b-58ee-0310-9ba9-8811b9f0742f
2009-06-23 17:09:49 +00:00