]>
granicus.if.org Git - vnstat/log
Teemu Toivola [Sat, 10 Mar 2018 23:23:05 +0000 (01:23 +0200)]
replace asctime() with strftime()
Teemu Toivola [Sat, 10 Mar 2018 22:56:30 +0000 (00:56 +0200)]
add missing variable init and teardown to waittimesync() tests
Teemu Toivola [Sat, 10 Mar 2018 17:55:07 +0000 (19:55 +0200)]
add tests for waittimesync()
Teemu Toivola [Sat, 10 Mar 2018 17:10:32 +0000 (19:10 +0200)]
Merge branch 'travis_warnings'
Teemu Toivola [Sat, 10 Mar 2018 17:05:06 +0000 (19:05 +0200)]
add mising no- prefix to parameters
Teemu Toivola [Sat, 10 Mar 2018 16:59:26 +0000 (18:59 +0200)]
more warning scope reductions for osx in travis
Teemu Toivola [Sat, 10 Mar 2018 16:47:30 +0000 (18:47 +0200)]
reduce scope of osx warnings in travis to avoid log getting flooded by few specific warnings from check framework files
Teemu Toivola [Sat, 10 Mar 2018 16:36:14 +0000 (18:36 +0200)]
drop --enable-werror in travis for osx as it appears to trigger errors from check framework files
Teemu Toivola [Sat, 10 Mar 2018 16:19:52 +0000 (18:19 +0200)]
Apple has extern long timezone in time.h
Teemu Toivola [Sat, 10 Mar 2018 16:06:58 +0000 (18:06 +0200)]
add --enable-werror parameter for configure and use it in travis
Teemu Toivola [Fri, 9 Mar 2018 22:56:05 +0000 (00:56 +0200)]
modify environment setup
Teemu Toivola [Fri, 9 Mar 2018 22:38:32 +0000 (00:38 +0200)]
clang specific parameters and warning to errors as travis has only green/red build end status options
Teemu Toivola [Fri, 9 Mar 2018 22:12:38 +0000 (00:12 +0200)]
refactor sql date generation handling, fixes last clang warnings (padding excluded)
Teemu Toivola [Tue, 6 Mar 2018 20:34:05 +0000 (22:34 +0200)]
improve data cleanup debug prints
Teemu Toivola [Tue, 6 Mar 2018 20:31:05 +0000 (22:31 +0200)]
return TimeSyncWait functionality
Teemu Toivola [Tue, 6 Mar 2018 19:55:49 +0000 (21:55 +0200)]
fix and improve config validator syntax
Teemu Toivola [Tue, 6 Mar 2018 18:17:56 +0000 (20:17 +0200)]
improve code readability and remove -Wformat-non-iso clang warning
Teemu Toivola [Mon, 5 Mar 2018 20:45:23 +0000 (22:45 +0200)]
add clang padding warning ignores to legacy database format definition in order to avoid anyone having sudden urges to fix possible alignment issues
Teemu Toivola [Mon, 5 Mar 2018 20:32:50 +0000 (22:32 +0200)]
improve define readability
Teemu Toivola [Mon, 5 Mar 2018 20:17:15 +0000 (22:17 +0200)]
add check for __clang__ being defined as gcc raises warnings for clang specific pragmas
Teemu Toivola [Mon, 5 Mar 2018 20:05:44 +0000 (22:05 +0200)]
fix clang warnings from tests
Teemu Toivola [Mon, 5 Mar 2018 20:05:05 +0000 (22:05 +0200)]
ignore clang _XOPEN_SOURCE warning as it doesn't appear to be avoidable
Teemu Toivola [Mon, 5 Mar 2018 19:32:37 +0000 (21:32 +0200)]
more warning fixes
Teemu Toivola [Mon, 5 Mar 2018 19:28:10 +0000 (21:28 +0200)]
more warning fixes
Teemu Toivola [Mon, 5 Mar 2018 18:33:03 +0000 (20:33 +0200)]
fix gcc warning
Teemu Toivola [Mon, 5 Mar 2018 18:11:13 +0000 (20:11 +0200)]
fix some clang warnings
Teemu Toivola [Mon, 5 Mar 2018 15:42:47 +0000 (17:42 +0200)]
bring back one disabled test, discard the other due to too similar content
Teemu Toivola [Sun, 4 Mar 2018 20:54:44 +0000 (22:54 +0200)]
fix cppcheck and clang warnings
Teemu Toivola [Sun, 4 Mar 2018 20:26:19 +0000 (22:26 +0200)]
add development status to README.md
Teemu Toivola [Sun, 4 Mar 2018 20:12:42 +0000 (22:12 +0200)]
wrap README.md lines as GitHub appears to be happy to unwrap sections back
Teemu Toivola [Sun, 4 Mar 2018 20:06:48 +0000 (22:06 +0200)]
merge sqldb branch, vnStat 2.0 on master begins here
Teemu Toivola [Sun, 4 Mar 2018 17:50:27 +0000 (19:50 +0200)]
bump version to 1.19 beta
Teemu Toivola [Sun, 4 Mar 2018 17:32:38 +0000 (19:32 +0200)]
adjust time sync check to not complain when daemon is stopped and started during the same second (service restart scenario)
Teemu Toivola [Sun, 4 Mar 2018 17:14:55 +0000 (19:14 +0200)]
final preparations for version 1.18 release
Teemu Toivola [Sun, 4 Mar 2018 17:03:08 +0000 (19:03 +0200)]
update example configuration file
Teemu Toivola [Sun, 4 Mar 2018 16:14:33 +0000 (18:14 +0200)]
Merge pull request #92 from cgzones/cppcheck
fix cppcheck note
Teemu Toivola [Sun, 4 Mar 2018 16:14:19 +0000 (18:14 +0200)]
Merge pull request #91 from cgzones/warnings
fix several clang compiler warnings
Christian Göttsche [Sun, 4 Mar 2018 13:05:59 +0000 (14:05 +0100)]
fix cppcheck note
[src/dbcache.c:166]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'.
Christian Göttsche [Thu, 1 Mar 2018 15:46:29 +0000 (16:46 +0100)]
fix clang -Wmissing-variable-declarations
./src/common.h:331:6: error: no previous extern declaration for non-static variable 'data' [-Werror,-Wmissing-variable-declarations]
DATA data;
./src/common.h:332:5: error: no previous extern declaration for non-static variable 'cfg' [-Werror,-Wmissing-variable-declarations]
CFG cfg;
./src/common.h:333:8: error: no previous extern declaration for non-static variable 'ifinfo' [-Werror,-Wmissing-variable-declarations]
IFINFO ifinfo;
./src/common.h:334:6: error: no previous extern declaration for non-static variable 'errorstring' [-Werror,-Wmissing-variable-declarations]
char errorstring[512];
./src/common.h:335:10: error: no previous extern declaration for non-static variable 'ifacebw' [-Werror,-Wmissing-variable-declarations]
ibwnode *ifacebw;
./src/common.h:336:5: error: no previous extern declaration for non-static variable 'debug' [-Werror,-Wmissing-variable-declarations]
int debug;
./src/common.h:337:5: error: no previous extern declaration for non-static variable 'noexit' [-Werror,-Wmissing-variable-declarations]
int noexit; /* = running as daemon if 2 */
./src/common.h:338:5: error: no previous extern declaration for non-static variable 'intsignal' [-Werror,-Wmissing-variable-declarations]
int intsignal;
./src/common.h:339:5: error: no previous extern declaration for non-static variable 'pidfile' [-Werror,-Wmissing-variable-declarations]
int pidfile;
./src/common.h:340:5: error: no previous extern declaration for non-static variable 'disableprints' [-Werror,-Wmissing-variable-declarations]
int disableprints;
./src/dbcache.h:24:11: error: no previous extern declaration for non-static variable 'dataptr' [-Werror,-Wmissing-variable-declarations]
datanode *dataptr;
Christian Göttsche [Thu, 1 Mar 2018 15:41:40 +0000 (16:41 +0100)]
fix clang -Wfloat-conversion
src/ifinfo.c:358:18: error: implicit conversion turns floating-point number into integer: 'float' to 'uint64_t' (aka 'unsigned long') [-Werror,-Wfloat-conversion]
maxtransfer = ceilf((maxbw/8.0f)*interval*1.1f);
Christian Göttsche [Thu, 1 Mar 2018 15:26:18 +0000 (16:26 +0100)]
fix clang -Wsign-conversion
src/ifinfo.c:329:31: error: implicit conversion changes signedness: 'int32_t' (aka 'int') to 'unsigned long' [-Werror,-Wsign-conversion]
if (data.btime < (btime-cfg.bvar)) {
Christian Göttsche [Thu, 1 Mar 2018 14:52:38 +0000 (15:52 +0100)]
fix clang -Wshorten-64-to-32
src/common.c:190:37: error: implicit conversion loses integer precision: 'long' to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
return data.lastupdated-mktime(&d)+timezone;
src/common.c:255:8: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen(s);
src/cfg.c:676:17: error: implicit conversion loses integer precision: 'long' to 'int32_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
*cset->loci = strtol(value, (char **)NULL, 0);
src/ibw.c:259:12: error: implicit conversion loses integer precision: 'long' to 'int32_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
ivalue = strtol(value, (char **)NULL, 0);
src/fs.c:50:8: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen(tmp);
src/fs.c:96:8: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
len = strlen(dir);
src/image.c:165:47: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
gdImageString(ic->im, gdFontGetTiny(), width-(strlen(datestring)*gdFontGetTiny()->w+12), 9+ic->showedge, (unsigned char*)datestring, ic->cheaderdate);
Christian Göttsche [Thu, 1 Mar 2018 14:45:50 +0000 (15:45 +0100)]
fix clang -Wbad-function-cast
src/misc.c:370:62: error: cast from function call of type 'uint64_t' (aka 'unsigned long') to non-matching type 'float' [-Werror,-Wbad-function-cast]
snprintf(buffer, 64, "%"DECCONV"*.2f %s", len, rate/(float)getunitdivisor(unitmode, 4), getrateunitprefix(unitmode, 4));
src/misc.c:372:62: error: cast from function call of type 'uint64_t' (aka 'unsigned long') to non-matching type 'float' [-Werror,-Wbad-function-cast]
snprintf(buffer, 64, "%"DECCONV"*.2f %s", len, rate/(float)getunitdivisor(unitmode, 3), getrateunitprefix(unitmode, 3));
src/misc.c:374:62: error: cast from function call of type 'uint64_t' (aka 'unsigned long') to non-matching type 'float' [-Werror,-Wbad-function-cast]
snprintf(buffer, 64, "%"DECCONV"*.2f %s", len, rate/(float)getunitdivisor(unitmode, 2), getrateunitprefix(unitmode, 2));
src/misc.c:376:70: error: cast from function call of type 'uint64_t' (aka 'unsigned long') to non-matching type 'float' [-Werror,-Wbad-function-cast]
snprintf(buffer, 64, "%"DECCONV"*.*f %s", len, declen, rate/(float)getunitdivisor(unitmode, 1), getrateunitprefix(unitmode, 1));
Christian Göttsche [Thu, 1 Mar 2018 14:41:31 +0000 (15:41 +0100)]
fix clang -Wconversion
src/dbcache.c:38:12: error: implicit conversion loses integer precision: 'int' to 'short' [-Werror,-Wconversion]
n->sync = sync;
Teemu Toivola [Sat, 3 Mar 2018 23:08:10 +0000 (01:08 +0200)]
add prerequisites section to INSTALL files, closes #58
Teemu Toivola [Sat, 3 Mar 2018 19:23:46 +0000 (21:23 +0200)]
documentation update
Teemu Toivola [Sat, 3 Mar 2018 18:25:50 +0000 (20:25 +0200)]
add README in Markdown format with command instructions on how to get started
Teemu Toivola [Fri, 2 Mar 2018 23:03:53 +0000 (01:03 +0200)]
add make target for testing man pages for errors and warnings, most likely not shell agnostic and not intended as dependency for the check target
Teemu Toivola [Mon, 26 Feb 2018 21:50:32 +0000 (23:50 +0200)]
fix compiler warnings
Teemu Toivola [Mon, 26 Feb 2018 21:42:31 +0000 (23:42 +0200)]
add output sanity check tests for mostly unfilled databases
Teemu Toivola [Mon, 26 Feb 2018 21:36:52 +0000 (23:36 +0200)]
add section separators for improving readabilty of the vnstat -h output, configurable using HourlySectionStyle
Teemu Toivola [Mon, 26 Feb 2018 20:58:01 +0000 (22:58 +0200)]
add options for controlling the number of decimals used in outputs, reduce the default number of decimals used in hourly output from 2 to 1 in order to improve readability
Teemu Toivola [Wed, 21 Feb 2018 21:12:36 +0000 (23:12 +0200)]
remove possible division by float zero
Teemu Toivola [Wed, 21 Feb 2018 21:11:46 +0000 (23:11 +0200)]
remove possible division by float zero
Teemu Toivola [Sat, 17 Feb 2018 19:05:02 +0000 (21:05 +0200)]
make number of executed tests visible
Teemu Toivola [Sat, 17 Feb 2018 18:34:08 +0000 (20:34 +0200)]
re-enable os x in travis
Teemu Toivola [Thu, 15 Feb 2018 21:55:43 +0000 (23:55 +0200)]
fix waittimesync() timestamp handling, fixes #85
Teemu Toivola [Wed, 14 Feb 2018 21:24:51 +0000 (23:24 +0200)]
add support for combining --live and --json, closes #25
Teemu Toivola [Wed, 14 Feb 2018 16:32:02 +0000 (18:32 +0200)]
add support for combining -tr and --json, closes #56
Teemu Toivola [Tue, 13 Feb 2018 20:18:03 +0000 (22:18 +0200)]
update CHANGES
Teemu Toivola [Tue, 13 Feb 2018 20:12:54 +0000 (22:12 +0200)]
minor example file cleanup
Teemu Toivola [Tue, 13 Feb 2018 19:58:44 +0000 (21:58 +0200)]
Merge pull request #80 from cgzones/systemd_hardening
vnstat.service: add hardening and auto restart
Teemu Toivola [Tue, 13 Feb 2018 19:54:43 +0000 (21:54 +0200)]
always show used version when debug is enabled
Teemu Toivola [Sun, 11 Feb 2018 13:08:26 +0000 (15:08 +0200)]
fix compilers warnings found in tests
Teemu Toivola [Sun, 11 Feb 2018 00:39:42 +0000 (02:39 +0200)]
update CHANGES and year info, minor style cleanup
Teemu Toivola [Sun, 11 Feb 2018 00:13:09 +0000 (02:13 +0200)]
add rtc sanity check and sync wait to daemon startup, wait duration can be changed from the configuration file, resolves #85
Teemu Toivola [Fri, 9 Feb 2018 23:03:28 +0000 (01:03 +0200)]
add optional parameter to --oneline output for forcing fields to output in bytes
Teemu Toivola [Fri, 9 Feb 2018 22:33:10 +0000 (00:33 +0200)]
avoid possible division by zero
Teemu Toivola [Wed, 7 Feb 2018 21:19:23 +0000 (23:19 +0200)]
add task duration measurement for debug purposes
Teemu Toivola [Mon, 5 Feb 2018 22:44:26 +0000 (00:44 +0200)]
flush data from cache to database using one transaction, this results in a significant reduction in disk i/o especially when monitoring multiple interfaces
Teemu Toivola [Mon, 5 Feb 2018 21:32:03 +0000 (23:32 +0200)]
improve errorstring handling with timestamp, fix legacy database import usage when --alwaysadd was used, don't always try to open database in rw mode when write access isn't needed, add base for longer transactions
Teemu Toivola [Tue, 30 Jan 2018 20:43:42 +0000 (22:43 +0200)]
avoid monitoring and storing information of interfaces that don't produce any data
Teemu Toivola [Tue, 30 Jan 2018 19:21:27 +0000 (21:21 +0200)]
remove line changes from log prints
Teemu Toivola [Tue, 30 Jan 2018 19:16:27 +0000 (21:16 +0200)]
--daemon + --debug isn't a supported combination
Teemu Toivola [Tue, 30 Jan 2018 18:58:32 +0000 (20:58 +0200)]
improve daemon logging
Teemu Toivola [Sat, 27 Jan 2018 23:42:00 +0000 (01:42 +0200)]
add pebibyte support
Teemu Toivola [Sat, 27 Jan 2018 23:22:34 +0000 (01:22 +0200)]
remove hardcoded values from unit conversions
Teemu Toivola [Sat, 27 Jan 2018 22:47:22 +0000 (00:47 +0200)]
bump version from alpha to beta, update README.md, fix vnstati help output
Teemu Toivola [Sat, 27 Jan 2018 21:57:46 +0000 (23:57 +0200)]
implement summary image outputs, remove support of old style (default in versions up to 1.7) summary image layout
Teemu Toivola [Fri, 26 Jan 2018 21:38:27 +0000 (23:38 +0200)]
yet another fix for hourly image rate scaling, this time for getting the axis numbers to be nice and even
Teemu Toivola [Sat, 20 Jan 2018 17:24:26 +0000 (19:24 +0200)]
reorder includes to fix errors with old compilers in uint64_t handling
Teemu Toivola [Sat, 20 Jan 2018 16:56:19 +0000 (18:56 +0200)]
fix hourly image rate unit scaling, improve test coverage
Teemu Toivola [Tue, 16 Jan 2018 21:37:54 +0000 (23:37 +0200)]
implement hourly image output and improve image output test coverage
Teemu Toivola [Fri, 12 Jan 2018 21:44:55 +0000 (23:44 +0200)]
suppress output of tests generating output even when passing
Teemu Toivola [Fri, 12 Jan 2018 21:20:55 +0000 (23:20 +0200)]
image output also needs tests
Teemu Toivola [Wed, 10 Jan 2018 20:09:50 +0000 (22:09 +0200)]
improve cfg test coverage, related to #84
Teemu Toivola [Tue, 9 Jan 2018 22:00:00 +0000 (00:00 +0200)]
add support for negative numbers to setcfgvalue(), fixes #84
Teemu Toivola [Sun, 7 Jan 2018 20:32:24 +0000 (22:32 +0200)]
error print cleanup
Teemu Toivola [Sun, 7 Jan 2018 17:39:52 +0000 (19:39 +0200)]
2017 -> 2018
Teemu Toivola [Sun, 7 Jan 2018 17:38:13 +0000 (19:38 +0200)]
error handling improvements in vnstat
Teemu Toivola [Sun, 7 Jan 2018 14:45:51 +0000 (16:45 +0200)]
update README.md
Teemu Toivola [Sun, 7 Jan 2018 14:18:54 +0000 (16:18 +0200)]
fix warnings, increase size of errorstring to fix file paths without truncation
Teemu Toivola [Sun, 7 Jan 2018 14:01:54 +0000 (16:01 +0200)]
remove checks for SQLITE_NOTICE and SQLITE_WARNING to improve support for older sqlite releases, these result codes are only used by sqlite3_log() which doesn't get invoked
Teemu Toivola [Sun, 7 Jan 2018 01:23:23 +0000 (03:23 +0200)]
fix warnings
Teemu Toivola [Sat, 6 Jan 2018 23:44:50 +0000 (01:44 +0200)]
improve logging and handling of possible database errors
Teemu Toivola [Thu, 4 Jan 2018 21:00:08 +0000 (23:00 +0200)]
reopen database after starting daemon when forking is used, fixes #82
Christian Göttsche [Fri, 3 Nov 2017 09:02:07 +0000 (10:02 +0100)]
vnstat.service: add hardening and auto restart
Teemu Toivola [Mon, 9 Oct 2017 20:28:01 +0000 (23:28 +0300)]
update Travis CI configuration
Teemu Toivola [Mon, 9 Oct 2017 20:22:52 +0000 (23:22 +0300)]
Merge pull request #79 from vergoh/travis_fix
Fix Travis CI usage
Teemu Toivola [Mon, 9 Oct 2017 20:18:58 +0000 (23:18 +0300)]
disable osx testing in Travis due to environment issues (brew + ruby)