From patchwork Fri Apr 10 17:17:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fischer X-Patchwork-Id: 2923 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 48zPpF3ZFBz3yC0 for ; Fri, 10 Apr 2020 17:17:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 48zPpC2RkBz2mg; Fri, 10 Apr 2020 17:17:23 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 48zPpC00Jkz2yK0; Fri, 10 Apr 2020 17:17:23 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 48zPp66lPKz2xgV for ; Fri, 10 Apr 2020 17:17:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 48zPp65Jbtz2jG for ; Fri, 10 Apr 2020 17:17:18 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1586539038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=mNgeAcaQFNCrnWutfJlR4iZuI2/PZyXm6nOGDBABNMM=; b=9a1yipWiWXAWHPsvvED44syScqUVV9+TTwoAPD5dNvZsN8HLio2TqcYu8trVOkqmBevGOP tYOwdt9bkI0/vFAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1586539038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=mNgeAcaQFNCrnWutfJlR4iZuI2/PZyXm6nOGDBABNMM=; b=LuFao15BcrzobNtGz0xN4gJ787x916CUbCFd8KOe4ESvCmLey1t4Z4G59W69VthUGjnDxs i2xzejeM6+IGZCRq3ELhurNlBalVcuky9K+k/M4bmVZgcLZdGAoOYhYW0odHEJGZhmwu+Z dNYcSNyLo6Jmo/7kf1cS7IVznbYjydfQtsYeEP+cTY02Vqrfpl8Y6IxigqjCWuMokueuLP 97cgONWtsisG4s/yxP1kW1FGPqqLdUq/8muEeInBEbCPMs+VozNHs4vCjZS3MCGJzA4pcz eGnAU3af2gc4hQpA7wT75tgB5XOOVWbE3JjeeN0Zqdntukdf5BxLxONW2T263g== From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH 2/4] traffic.cgi: Changed time interval for vnstat graphs from 5 to 1 minute Date: Fri, 10 Apr 2020 19:17:09 +0200 Message-Id: <20200410171711.3902-2-matthias.fischer@ipfire.org> In-Reply-To: <20200410171711.3902-1-matthias.fischer@ipfire.org> References: <20200410171711.3902-1-matthias.fischer@ipfire.org> Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=matthias.fischer@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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 --- 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 !
"; } 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 <