For details see: https://humdi%5Bdot%5Dnet/vnstat/CHANGES
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- config/rootfiles/common/vnstat | 13 +++++-------- lfs/vnstat | 5 ++--- 2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/config/rootfiles/common/vnstat b/config/rootfiles/common/vnstat index 42e00ed2a..963b64bf7 100644 --- a/config/rootfiles/common/vnstat +++ b/config/rootfiles/common/vnstat @@ -1,12 +1,9 @@ -#etc/cron.d -#etc/cron.d/vnstat etc/vnstat.conf usr/bin/vnstat usr/bin/vnstati -#usr/sbin/vnstatd -#usr/share/man/man5/vnstat.conf.5 -#usr/share/man/man1/vnstatd.1 -#usr/share/man/man1/vnstati.1 +usr/sbin/vnstatd #usr/share/man/man1/vnstat.1 -#var/lib/vnstat -var/log/vnstat +#usr/share/man/man1/vnstati.1 +#usr/share/man/man5/vnstat.conf.5 +#usr/share/man/man8/vnstatd.8 +#var/log/vnstat diff --git a/lfs/vnstat b/lfs/vnstat index 27189126b..904e5a256 100644 --- a/lfs/vnstat +++ b/lfs/vnstat @@ -24,7 +24,7 @@
include Config
-VER = 1.18 +VER = 2.6
THISAPP = vnstat-$(VER) DL_FILE = $(THISAPP).tar.gz @@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = c9abaeb0ce758c16f6cdfa247bd8606c +$(DL_FILE)_MD5 = fe2928a81243cc8a532a357f97221736
install : $(TARGET)
@@ -80,7 +80,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cd $(DIR_APP) && make all $(MAKETUNING) LOCAL_CONFIGURE_OPTIONS="--enable-readline=yes" cd $(DIR_APP) && make install - sed -i 's|eth0|green0|g' /etc/vnstat.conf sed -i 's|SaveInterval 5|SaveInterval 1|g' /etc/vnstat.conf sed -i 's|/var/lib/vnstat|/var/log/vnstat|g' /etc/vnstat.conf sed -i 's|/var/log/vnstat/vnstat.log|/var/log/vnstat.log|g' /etc/vnstat.conf
This keeps the graphs a bit more "updated".
From 'man vnstat':
'-c (--cache-time) => Update output file only if at least *time* minutes have passed since the previous file update.
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- html/cgi-bin/traffic.cgi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/html/cgi-bin/traffic.cgi b/html/cgi-bin/traffic.cgi index fbffecb7c..e19bea20a 100644 --- a/html/cgi-bin/traffic.cgi +++ b/html/cgi-bin/traffic.cgi @@ -86,15 +86,15 @@ sub display_vnstat if ( $testdata =~ 'enough') { print"No data for $device !<br>"; } else { - system("/usr/bin/vnstati -c 5 -s -i $device -o /srv/web/ipfire/html/graphs/vnstat-s-$device.png"); + system("/usr/bin/vnstati -c 1 -s -i $device -o /srv/web/ipfire/html/graphs/vnstat-s-$device.png"); # Hour graph - system("/usr/bin/vnstati -c 5 -h -i $device -o /srv/web/ipfire/html/graphs/vnstat-h-$device.png"); + system("/usr/bin/vnstati -c 1 -h -i $device -o /srv/web/ipfire/html/graphs/vnstat-h-$device.png"); # Day graph - system("/usr/bin/vnstati -c 5 -d -i $device -o /srv/web/ipfire/html/graphs/vnstat-d-$device.png"); + system("/usr/bin/vnstati -c 1 -d -i $device -o /srv/web/ipfire/html/graphs/vnstat-d-$device.png"); # Month graph - system("/usr/bin/vnstati -c 5 -m -i $device -o /srv/web/ipfire/html/graphs/vnstat-m-$device.png"); + system("/usr/bin/vnstati -c 1 -m -i $device -o /srv/web/ipfire/html/graphs/vnstat-m-$device.png"); # Top10 graph - system("/usr/bin/vnstati -c 5 -t -i $device -o /srv/web/ipfire/html/graphs/vnstat-t-$device.png"); + system("/usr/bin/vnstati -c 1 -t -i $device -o /srv/web/ipfire/html/graphs/vnstat-t-$device.png");
# Generate HTML-Table with the graphs print <<END
Added the new 'vnstatd' daemon to 'start' and 'stop' section.
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- src/initscripts/system/vnstat | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/src/initscripts/system/vnstat b/src/initscripts/system/vnstat index 363307013..bcc19c3ab 100755 --- a/src/initscripts/system/vnstat +++ b/src/initscripts/system/vnstat @@ -17,15 +17,28 @@ case "$1" in mount_ramdisk "${VNSTATLOG}" evaluate_retval fi + + boot_mesg "Starting vnstatd..." + loadproc /usr/sbin/vnstatd -d --alwaysadd + sleep 2 + evaluate_retval ;; + stop) + boot_mesg "Stopping vnstatd..." + killproc /usr/sbin/vnstatd + sleep 2 + evaluate_retval + umount_ramdisk "${VNSTATLOG}" ;; + restart) ${0} stop sleep 1 ${0} start ;; + backup) # Backup all data if ramdisk is used if mountpoint "${RRDLOG}" &>/dev/null; then
Hey,
On 10 Apr 2020, at 18:17, Matthias Fischer matthias.fischer@ipfire.org wrote:
Added the new 'vnstatd' daemon to 'start' and 'stop' section.
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org
src/initscripts/system/vnstat | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/src/initscripts/system/vnstat b/src/initscripts/system/vnstat index 363307013..bcc19c3ab 100755 --- a/src/initscripts/system/vnstat +++ b/src/initscripts/system/vnstat @@ -17,15 +17,28 @@ case "$1" in mount_ramdisk "${VNSTATLOG}" evaluate_retval fi
boot_mesg "Starting vnstatd..."
loadproc /usr/sbin/vnstatd -d --alwaysadd
sleep 2
evaluate_retval
What is the sleep operation necessary for?
Also, evaluate_retval will now always consider the return code of “sleep” which is probably not what we want here. We want to see when launching vnstatd fails.
Also, loadproc will already take care of printing “OK” or “ERROR”.
;;
- stop)
boot_mesg "Stopping vnstatd..."
killproc /usr/sbin/vnstatd
sleep 2
evaluate_retval
Same here. It delays the shutdown operation unnecessarily.
Best, -Michael
- umount_ramdisk "${VNSTATLOG}" ;;
- restart) ${0} stop sleep 1 ${0} start ;;
- backup) # Backup all data if ramdisk is used if mountpoint "${RRDLOG}" &>/dev/null; then
-- 2.18.0
Hi,
On 11.04.2020 10:56, Michael Tremer wrote:
Hey,
On 10 Apr 2020, at 18:17, Matthias Fischer matthias.fischer@ipfire.org wrote:
Added the new 'vnstatd' daemon to 'start' and 'stop' section.
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org
src/initscripts/system/vnstat | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/src/initscripts/system/vnstat b/src/initscripts/system/vnstat index 363307013..bcc19c3ab 100755 --- a/src/initscripts/system/vnstat +++ b/src/initscripts/system/vnstat @@ -17,15 +17,28 @@ case "$1" in mount_ramdisk "${VNSTATLOG}" evaluate_retval fi
boot_mesg "Starting vnstatd..."
loadproc /usr/sbin/vnstatd -d --alwaysadd
sleep 2
evaluate_retval
What is the sleep operation necessary for?
Thinking about it, I thought it could be necessary to give the script a little time to complete...
Also, evaluate_retval will now always consider the return code of “sleep” which is probably not what we want here. We want to see when launching vnstatd fails.
I see. Ok.
Also, loadproc will already take care of printing “OK” or “ERROR”.
Changed => deleted 'sleep 2' => https://patchwork.ipfire.org/patch/2935/
Best, Matthias
;;
- stop)
boot_mesg "Stopping vnstatd..."
killproc /usr/sbin/vnstatd
sleep 2
evaluate_retval
Same here. It delays the shutdown operation unnecessarily.
Best, -Michael
- umount_ramdisk "${VNSTATLOG}" ;;
- restart) ${0} stop sleep 1 ${0} start ;;
- backup) # Backup all data if ramdisk is used if mountpoint "${RRDLOG}" &>/dev/null; then
-- 2.18.0
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- src/scripts/makegraphs | 3 --- 1 file changed, 3 deletions(-)
diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index b91a70e3a..1dc14b8a3 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -106,9 +106,6 @@ sub updatehdddata{ } }
-## Update vnstat -system ('/usr/bin/vnstat -u'); - my @disks = `ls -1 /sys/block | grep -E '^sd|^nvme|^mmcblk|^xvd|^vd|^md' | sort | uniq`; system("unlink /var/run/hddstatus 2>/dev/null && touch /var/run/hddstatus"); foreach (@disks){