From 6c33dc5c18974b22a04bf71ff520d1679b228679 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 22 May 2008 22:07:19 +0200 Subject: [PATCH] use vnstat for traffic statistic now --- config/rootfiles/common/vnstat | 6 + config/rootfiles/common/vnstati | 2 + doc/packages-list.txt | 2 + html/cgi-bin/traffic.cgi | 416 +++----------------------- lfs/vnstat | 82 +++++ lfs/vnstati | 79 +++++ make.sh | 2 + src/initscripts/init.d/networking/any | 9 +- src/initscripts/init.d/networking/red | 13 +- src/scripts/makegraphs | 2 + 10 files changed, 237 insertions(+), 376 deletions(-) create mode 100644 config/rootfiles/common/vnstat create mode 100644 config/rootfiles/common/vnstati create mode 100644 lfs/vnstat create mode 100644 lfs/vnstati diff --git a/config/rootfiles/common/vnstat b/config/rootfiles/common/vnstat new file mode 100644 index 0000000000..715250602f --- /dev/null +++ b/config/rootfiles/common/vnstat @@ -0,0 +1,6 @@ +/etc/cron.d +/etc/cron.d/vnstat +/etc/vnstat.conf +/usr/bin/vnstat +#usr/share/man/man1/vnstat.1 +/var/log/vnstat diff --git a/config/rootfiles/common/vnstati b/config/rootfiles/common/vnstati new file mode 100644 index 0000000000..f60322a5be --- /dev/null +++ b/config/rootfiles/common/vnstati @@ -0,0 +1,2 @@ +/usr/bin/vnstati +#usr/share/man/man1/vnstati.1.gz diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 9d1aacbbb6..9b79299fd6 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -283,6 +283,8 @@ * vim-7.0 * vlan.1.9 * vlc-0.8.6f +* vnstat-1.6 +* vnstati-beta3 * vsftpd-2.0.5 * w_scan-20080105 * wget-1.10.2 diff --git a/html/cgi-bin/traffic.cgi b/html/cgi-bin/traffic.cgi index 91101e8361..0930fdf40d 100644 --- a/html/cgi-bin/traffic.cgi +++ b/html/cgi-bin/traffic.cgi @@ -36,9 +36,6 @@ my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); -my @dummy = (@NETTRAFF::months, @NETTRAFF::longmonths, $NETTRAFF::colorOk, $NETTRAFF::colorWarn, $NETTRAFF::colorMax); -undef(@dummy); - my %cgiparams; my %pppsettings; my %netsettings; @@ -46,393 +43,68 @@ my %netsettings; &General::readhash("${General::swroot}/ppp/settings", \%pppsettings); &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); -my @now = localtime(time); - -$now[5] = $now[5]+1900; - -$cgiparams{'STARTYEAR'} = $now[5]; -$cgiparams{'STARTMONTH'} = $now[4]; - -my $startDay = '1'; -my $endDay = '1'; - -if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on') -{ - $startDay = $NETTRAFF::settings{'STARTDAY'}; - $endDay = $NETTRAFF::settings{'STARTDAY'}; -} - -# this periode started last month -if ($now[3] < $startDay) -{ - # when current month is january we start in last year december - if ($now[4] == 0) { - $cgiparams{'STARTYEAR'} = $now[5]-1; - $cgiparams{'STARTMONTH'} = 11; - } - else - { - $cgiparams{'STARTYEAR'} = $now[5]; - $cgiparams{'STARTMONTH'} = $now[4]-1; - } -} &Header::getcgihash(\%cgiparams); -my $selectYearALL = ""; -$selectYearALL = 'selected=\'selected\'' if($cgiparams{'STARTYEAR'} eq '????'); - -my $selectMonthALL = ""; -$selectMonthALL = 'selected=\'selected\'' if($cgiparams{'STARTMONTH'} eq '??'); - &Header::showhttpheaders(); &Header::openpage($Lang::tr{'sstraffic'}, 1, ''); &Header::openbigbox('100%', 'left'); -&Header::openbox('100%', 'left', ""); - -my $firstDayTxt = ''; - -if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on') -{ - $firstDayTxt = " ($Lang::tr{'monthly volume start day short'}: $NETTRAFF::settings{'STARTDAY'}.)"; -} - -print < - - -
- $Lang::tr{'selecttraffic'}$firstDayTxt: - - - -
- - -
- -
- - - -END - -&Header::closebox(); &Header::openbox('100%', 'left', "$Lang::tr{'traffics'}"); -my $dateWidth = '20%'; -my $netWidth = '34%'; -my $inOutWidth = '17%'; +# Display internal network +display_vnstat($netsettings{'GREEN_DEV'}); -# 4 networks -if ($netsettings{'CONFIG_TYPE'} =~ /^(4)$/) { - $dateWidth = '12%'; - $netWidth = '22%'; - $inOutWidth = '11%'; -} -# 3 networks -if ($netsettings{'CONFIG_TYPE'} =~ /^(2|3)$/) { - $dateWidth = '16%'; - $netWidth = '28%'; - $inOutWidth = '14%'; +# Display external network / check if it is PPP or ETH +# and dont display if RED_DEV=GREEN_DEV (green only mode) +if ($netsettings{'RED_TYPE'} ne 'PPPOE') { + if ($netsettings{'RED_DEV'} ne $netsettings{'GREEN_DEV'}) { + display_vnstat($netsettings{'RED_DEV'}); + } +} else { + display_vnstat("ppp0"); } -print < - - - $Lang::tr{'trafficgreen'} -END - +# Check config and display aditional Networks (BLUE and ORANGE) +# if they exist if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/) { - print "$Lang::tr{'trafficblue'}"; + display_vnstat($netsettings{'BLUE_DEV'}); } if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) { - print "$Lang::tr{'trafficorange'}"; -} - -if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) { - print "$Lang::tr{'trafficred'}"; -} -print < - - - - - - -END - -if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/) -{ - print ""; - print ""; -} - -if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) -{ - print ""; - print ""; -} -if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) -{ -print ""; -print ""; -} -print ""; - -my $total_blue_in=0; -my $total_blue_out=0; -my $total_green_in=0; -my $total_green_out=0; -my $total_orange_in=0; -my $total_orange_out=0; -my $total_red_in=0; -my $total_red_out=0; -my $lines=0; - - - -my $startYear = $cgiparams{'STARTYEAR'}; -my $endYear = $cgiparams{'STARTYEAR'}; -my $startMonth = $cgiparams{'STARTMONTH'}; -my $endMonth = $cgiparams{'STARTMONTH'}; -my $displayMode = "daily_multi"; -$startDay = '1'; -$endDay = '1'; -my $selectedMonth = '0'; - -if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on') -{ - $startDay = $NETTRAFF::settings{'STARTDAY'}; - $endDay = $NETTRAFF::settings{'STARTDAY'}; -} - -# "show All ? -if ($cgiparams{'STARTYEAR'} eq '????') -{ - # 'show all month' + 'show all years' - # OR + 'show all years' - - # if we have a , we read all traffic but display only the selected month - if($cgiparams{'STARTMONTH'} ne '??') - { - $selectedMonth = $cgiparams{'STARTMONTH'} + 1; - $selectedMonth = $selectedMonth < 10 ? $selectedMonth = "0".$selectedMonth : $selectedMonth; - } - - $displayMode = "monthly"; - # start with 1970-01-01 - $startYear = 1970; - $startMonth = '1'; - $startDay = '1'; - # end with next year: 20xx-01-01 - $endYear = $now[5] + 1; - $endMonth = '1'; - $endDay = '1'; -} -elsif ($cgiparams{'STARTMONTH'} eq '??') -{ - # 'show all month' + 200x - $displayMode = "monthly"; - # start with 200x-01-01 - $startMonth = '1'; - $startDay = '1'; - # end with (200x+1)-01-01 - $endYear = $startYear + 1; - $endMonth = '1'; - $endDay = '1'; -} -else -{ - # no "Show All" - $startMonth++; - $endMonth = $endMonth + 2; - - # this periode started last month - if ($now[3] < $startDay) - { - # when current month is january we start in last year december - if ($endMonth == 1) { - $startYear--; - $startMonth = 12; - } - } - else - { - # when we are in december, this periode ends next year january - if ($startMonth == 12) { - $endYear++; - $endMonth = 1; - } - } -} - - - -$startMonth = $startMonth < 10 ? $startMonth = "0".$startMonth : $startMonth; -$endMonth = $endMonth < 10 ? $endMonth = "0".$endMonth : $endMonth; -$startDay = $startDay < 10 ? $startDay = "0".$startDay : $startDay; -$endDay = $endDay < 10 ? $endDay = "0".$endDay : $endDay; - -my $start = "$startYear$startMonth$startDay"; -my $end = "$endYear$endMonth$endDay"; - -my %allDaysBytes = (); -my @allDays = &Traffic::calcTraffic(\%allDaysBytes,$start,$end, $displayMode); - - -foreach (@allDays) -{ - # special code for: + 'show all years' - if($cgiparams{'STARTMONTH'} ne '??' && $cgiparams{'STARTYEAR'} eq '????') - { - # show only those traffic in the selected month - if($allDaysBytes{$_}{'Day'} !~ /^\d\d\d\d-$selectedMonth$/) - { - next; - } - } - - $total_green_in += $allDaysBytes{$_}{${Traffic::green_in}}; - $total_green_out += $allDaysBytes{$_}{${Traffic::green_out}}; - - if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/) - { - $total_blue_in += $allDaysBytes{$_}{${Traffic::blue_in}}; - $total_blue_out += $allDaysBytes{$_}{${Traffic::blue_out}}; - } - - if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) - { - $total_orange_in += $allDaysBytes{$_}{${Traffic::orange_in}}; - $total_orange_out += $allDaysBytes{$_}{${Traffic::orange_out}}; - } - - if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) - { - $total_red_in += $allDaysBytes{$_}{${Traffic::red_in}}; - $total_red_out += $allDaysBytes{$_}{${Traffic::red_out}}; - } - - if ($lines % 2) { - print ""; } - else { - print ""; } - - printf "\n", $allDaysBytes{$_}{'Day'}; - printf "\n", ($allDaysBytes{$_}{${Traffic::green_in}}/1048576); - printf "\n", ($allDaysBytes{$_}{${Traffic::green_out}}/1048576); - - if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/) - { - printf "\n", ($allDaysBytes{$_}{${Traffic::blue_in}}/1048576); - printf "\n", ($allDaysBytes{$_}{${Traffic::blue_out}}/1048576); - } - if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) - { - printf "\n", ($allDaysBytes{$_}{${Traffic::orange_in}}/1048576); - printf "\n", ($allDaysBytes{$_}{${Traffic::orange_out}}/1048576); - } - - if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) - { - printf "\n", ($allDaysBytes{$_}{${Traffic::red_in}}/1048576); - printf "\n", ($allDaysBytes{$_}{${Traffic::red_out}}/1048576); - } - - $lines++; -} - -$total_green_in=sprintf("%.2f", ($total_green_in/1048576)); -$total_green_out=sprintf("%.2f", ($total_green_out/1048576)); -$total_blue_in=sprintf("%.2f", ($total_blue_in/1048576)); -$total_blue_out=sprintf("%.2f", ($total_blue_out/1048576)); -$total_orange_in=sprintf("%.2f", ($total_orange_in/1048576)); -$total_orange_out=sprintf("%.2f", ($total_orange_out/1048576)); -$total_red_in=sprintf("%.2f", ($total_red_in/1048576)); -$total_red_out=sprintf("%.2f", ($total_red_out/1048576)); - -if ($lines % 2) {print ""; } -else {print ""; } - -print <$Lang::tr{'trafficsum'} - - -END - -if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/) -{ - print ""; - print ""; -} - -if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) -{ - print ""; - print ""; -} -if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) -{ -print ""; -print ""; -} -print "
$Lang::tr{'trafficdate'}$Lang::tr{'trafficin'}$Lang::tr{'trafficout'}$Lang::tr{'trafficin'}$Lang::tr{'trafficout'}$Lang::tr{'trafficin'}$Lang::tr{'trafficout'}$Lang::tr{'trafficin'}$Lang::tr{'trafficout'}
%s%.3f%.3f%.3f%.3f%.3f%.3f%.3f%.3f
$total_green_in MB$total_green_out MB$total_blue_in MB$total_blue_out MB$total_orange_in MB$total_orange_out MB$total_red_in MB$total_red_out MB
"; - -if($NETTRAFF::settings{'MONTHLY_VOLUME_ON'} eq 'on') -{ - my $total_red_all = sprintf("%.2f", ($total_red_in + $total_red_out)); - - my $color = $NETTRAFF::colorOk; - - my $warnTraff = ($NETTRAFF::settings{'MONTHLY_VOLUME'} * $NETTRAFF::settings{'WARN'} / 100); - if($NETTRAFF::settings{'WARN_ON'} eq 'on' - && $warnTraff < $total_red_all) - { - $color = $NETTRAFF::colorWarn; - } - if($NETTRAFF::settings{'MONTHLY_VOLUME'} < $total_red_all) - { - $color = $NETTRAFF::colorMax; - } - - print < - $Lang::tr{'monthly volume'} ($NETTRAFF::settings{'MONTHLY_VOLUME'} MB) - $total_red_all MB - -END + display_vnstat($netsettings{'ORANGE_DEV'}); } &Header::closebox(); &Header::closebigbox(); &Header::closepage(); + +sub display_vnstat +{ + my $device = $_[0]; + + # Sumary graph sometimes hang so i print the text + print "
";
+	system("/usr/bin/vnstat -s -i $device");
+	print "
"; + # generate Graphs if they are older than 5 min (-c 5) + # Hour graph + system("/usr/bin/vnstati -c 5 -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"); + # Month graph + system("/usr/bin/vnstati -c 5 -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"); + +# Generate HTML-Table with the graphs +print < + + + + + +END +; +} diff --git a/lfs/vnstat b/lfs/vnstat new file mode 100644 index 0000000000..b2a4c6e758 --- /dev/null +++ b/lfs/vnstat @@ -0,0 +1,82 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.6 + +THISAPP = vnstat-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = ccaffe8e70d47e0cf2f25e52daa25712 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && make $(MAKETUNING) LOCAL_CONFIGURE_OPTIONS="--enable-readline=yes" + cd $(DIR_APP) && make install + sed -i 's|eth0|green0|g' /etc/vnstat.conf + sed -i 's|/var/lib/vnstat|/var/log/vnstat|g' /etc/vnstat.conf + -mkdir -p /var/log/vnstat + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/lfs/vnstati b/lfs/vnstati new file mode 100644 index 0000000000..c7cd6edafb --- /dev/null +++ b/lfs/vnstati @@ -0,0 +1,79 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = beta3 + +THISAPP = vnstati-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 5652b955e16716cec48da464b083c76f + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist: + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && make $(MAKETUNING) LOCAL_CONFIGURE_OPTIONS="--enable-readline=yes" + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index c32eba0700..2e2e674698 100755 --- a/make.sh +++ b/make.sh @@ -575,6 +575,8 @@ buildipfire() { ipfiremake squidclamav ipfiremake bc ipfiremake esniper + ipfiremake vnstat + ipfiremake vnstati } buildinstaller() { diff --git a/src/initscripts/init.d/networking/any b/src/initscripts/init.d/networking/any index 7d22429549..3c38d5c4a2 100644 --- a/src/initscripts/init.d/networking/any +++ b/src/initscripts/init.d/networking/any @@ -76,6 +76,9 @@ case "${1}" in echo_failure exit 1 fi + + # Create/Update vnstat database + /usr/bin/vnstat -u -i ${DEVICE} --force > /dev/null 2>&1 boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..." ip addr add ${args} dev ${DEVICE} @@ -86,8 +89,10 @@ case "${1}" in boot_mesg "Removing IPv4 address ${ADDRESS} from the ${DEVICE} interface..." ip addr del ${args} dev ${DEVICE} evaluate_retval + + # Update vnstat database + /usr/bin/vnstat -u -i ${DEVICE} > /dev/null 2>&1 + exit 0; ;; - esac - # End diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index 52e5d095b0..bb8a04d0cf 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -88,6 +88,9 @@ case "${1}" in exit 1 fi fi + + ## Create/Update vnstat + /usr/bin/vnstat -u -i ${DEVICE} --force > /dev/null 2>&1 if [ "${TYPE}" == "STATIC" ]; then @@ -318,7 +321,8 @@ case "${1}" in evaluate_retval # echo PPP: /usr/sbin/pppd pty "$PPPOE_CMD" $PPP_STD_OPTIONS $DEBUG $DEMAND $PPPD_SYNC fi - + ## Create/Update vnstat + /usr/bin/vnstat -u -i ppp0 --force > /dev/null 2>&1 /etc/rc.d/init.d/connectd start fi @@ -372,6 +376,8 @@ case "${1}" in elif [ "$TYPE" == "PPPOE" ]; then boot_mesg "Bringing down the PPP interface ..." + ## Update vnstat + /usr/bin/vnstat -u -i ppp0 > /dev/null 2>&1 rm -f /var/ipfire/red/keepconnected killall -w -s TERM /usr/sbin/pppd 2>/dev/null evaluate_retval @@ -391,8 +397,11 @@ case "${1}" in killall -w -s KILL /usr/sbin/pppd >/dev/null 2>&1 killall -w -s KILL br2684ctl >/dev/null 2>&1 rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} + + ## Update vnstat + /usr/bin/vnstat -u -i ${DEVICE} > /dev/null 2>&1 + exit 0; ;; - esac # End diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 50a1a512c5..cfe5f8fa39 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -100,6 +100,8 @@ sub updatehdddata ## Update ipac logs #system ('/usr/sbin/fetchipac'); +## Update vnstat +system ('/usr/bin/vnstat -u'); my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; system("unlink /tmp/hddstatus && touch /tmp/hddstatus"); -- 2.39.2