From patchwork Mon May 24 04:31:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: nateos2g X-Patchwork-Id: 4367 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 "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FpPRk10rSz3wbl for ; Mon, 24 May 2021 04:31:30 +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 "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FpPRj02GLz6cy; Mon, 24 May 2021 04:31:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FpPRh69wBz2yS0; Mon, 24 May 2021 04:31:28 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FpPRg573bz2xCy for ; Mon, 24 May 2021 04:31:27 +0000 (UTC) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (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 ESMTPS id 4FpPRd18t2z1T5 for ; Mon, 24 May 2021 04:31:25 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id EA2CF16D0 for ; Mon, 24 May 2021 00:31:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 24 May 2021 00:31:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=3 rqFc25HWBxVwiIkSszljBcuO1rF85K7DgEmw/L1VEc=; b=pzhWHmk2hiqiEFiUZ LXdbcrgjZclO/5riJI5KyydybND59S+tpBtKRqVxpuoZtSebsHiQQUIO1T4fNgT5 HweR+FYNUaMErnKoNw1PyNfI4pe5dcHjOMJCjOfWUiWKZD6LgTdf2a+hdFVefS5i Dx0hIQw12muvo1ULAkySXdnxl42vx0IjIutrh5XHWRdmUIqoGz6I8EdV/ux6fSYS lSJ6Yfjh6xu4bKowcx+LYl1znHlldtZPyt5Nuf+P4oZRjLUmZ5VbpPufAWcB19gc HpY6ryLiRE/xa5NPH+sId7QpK+wf5bLoCO/2dTnZPf4DK1gubTHmYvsF2As65gCc t7pxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=3rqFc25HWBxVwiIkSszljBcuO1rF85K7DgEmw/L1V Ec=; b=TZVJ0fWfJ7vcaKpA1FvdaD5T/ZVkh4PDIkHnb33n3OhjfYncyrUmfX4XI oGxG0RZNNZd8y4dNPtgGk//hYPE+2TOo8W/sXjNQF/jyV5fYgtNpO2lAAfoJkQ2M Np9f4ocV7qE9Sl4Bv5Srqc8wvsR5owOeAqnHe4YzFBbhRCp+FG/zTXW33bSB5L+8 LmHJxIMeN8cnPzWL48K6iY9rJD88SO/ST1JWQOWxqrFtnD8kXwtazAurONJZL2tM s6b1Rk7VXVfS34hdYTdRo0sK2kK2O83SWiQKEFGBUzWje7irjtBUJZsfYDyo4Jt9 OZwgT6YmDbEb15xNyRl/tFri/GgZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejkedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpehnrghtvghoshdvghcuoehnrghtvghoshdvghesfhgrshht mhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpeefueetgefggeekffegtdduieelve dtfedtvdduteetgfetuddvteevfedvleekffenucffohhmrghinhepihhpfhhirhgvrdho rhhgnecukfhppeeiledrudeffedruddtgedrleefnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepnhgrthgvohhsvdhgsehfrghsthhmrghilhdr tghomh X-ME-Proxy: Received: from [192.168.1.14] (cpe-69-133-104-93.cinci.res.rr.com [69.133.104.93]) by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 24 May 2021 00:31:21 -0400 (EDT) Subject: [PATCH] Network based RRD graphs Bytes to Bits To: development@lists.ipfire.org References: From: nateos2g Message-ID: <29303608-26e9-a531-b181-c6f545117592@fastmail.com> Date: Mon, 24 May 2021 00:31:28 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1621830686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3rqFc25HWBxVwiIkSszljBcuO1rF85K7DgEmw/L1VEc=; b=I9DUuRdr0IKflsVhyVnX2ei1FmzPjfD7KzZcvVPVxbjaSpuUwbMMJbSjXgu15ULtjqTYSN RADGjj5MTVzSiKUhm59Ho7ASmmnQw08UFL//Tq8XXy2eHZRRh/lw1LS2Vj9R68aiS9uAUZ 1rRQRAkyAx+CNZanVqHoXtk5c+4RfmAjyYEAx1LFm87MfyYSqaiaJedhoP0wtiun/xiafK ZqvYenaj5MCbRCZhoXNAJMNEeCMP8bejQJvbDYtZ+JjiGCawATpKxi37c8KasyAKC+zQAX Wf/TThqnD2X9hfDVeMzLfeRMxkEKwNkA7U9t52xUtd1+7ADqc3NvsfKcItW0TQ== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1621830686; a=rsa-sha256; cv=none; b=f5R+wH0Dg0wMl3zwm05A0poyKSp9gDf9C0adKu1HAEBcnaOwp3fX+V3yerix7qzE00lU7U k8JNqUAX64+8uI69qLvlpkbgr//UjUBxEwHK3nMLk9+DrzhopiA9fxtT8I4eVZJBbKwDST ZbhtRrmTNiBz7yaUn3bGHWzyBI7xBUm9Smv2vrwcIMs6bDfj8dw+yQR41Ib9ttNzr/Mbih /0+jnLjYy4kIWHpWsgiL+9aB5fIVRF0V4dooaL6nuDbfYlCwdLgIaKgVP5AyL6I4kPQTXc fVXM6MPvrO+PJuLHgSgUZlTqRwL6QMvwjUzGEfLUxzDn5sSKzDqNY45wn20Bhw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=fastmail.com header.s=fm3 header.b=pzhWHmk2; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=TZVJ0fWf; spf=pass (mail01.ipfire.org: domain of nateos2g@fastmail.com designates 64.147.123.25 as permitted sender) smtp.mailfrom=nateos2g@fastmail.com X-Spamd-Result: default: False [-6.28 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[fastmail.com]; IP_REPUTATION_HAM(-0.34)[asn: 11403(-0.33), country: US(-0.01), ip: 64.147.123.25(0.00)]; TO_DN_NONE(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.25]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[fastmail.com:+,messagingengine.com:+]; DMARC_POLICY_ALLOW(-0.50)[fastmail.com,none]; MX_GOOD(-0.01)[]; RECEIVED_SPAMHAUS_PBL(0.00)[69.133.104.93:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[fastmail.com]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.25:from]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[fastmail.com:s=fm3,messagingengine.com:s=fm2]; BAYES_HAM(-3.00)[99.99%]; FROM_HAS_DN(0.00)[]; SPF_REPUTATION_HAM(-0.83)[-0.8333251115244]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; RWL_MAILSPIKE_VERYGOOD(0.00)[64.147.123.25:from] X-Rspamd-Queue-Id: 4FpPRd18t2z1T5 Authentication-Results: mail01.ipfire.org; dkim=pass header.d=fastmail.com header.s=fm3 header.b=pzhWHmk2; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=TZVJ0fWf; spf=pass (mail01.ipfire.org: domain of nateos2g@fastmail.com designates 64.147.123.25 as permitted sender) smtp.mailfrom=nateos2g@fastmail.com; dmarc=pass (policy=none) header.from=fastmail.com X-Rspamd-Server: mail01.haj.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" For proper display of network measurements, Bps (bytes) should be converted to bps (bits). Bytes are for data/storage (RAM, HDD, SSD, etc.), bits are for network bandwidth or throughput (NICs, switches, routers, WiFi adapters, etc.). Networks transfer data as single bits at a time. It’s both more accurate and more intuitive to measure network speed in bits per second that a network connection is transmitting, not the amount of data units, or bytes, it transmits. Notice all network devices are marketed, measure and diplay in bits per second. I simply used RRD CDEF to multiply by 8. NOTE: Found: "ERROR: rpn expressions without DEF or CDEF variables are not supported". Specifically in updateqosgraph, CDEF does not like a number as a variable name. ie. "204" from $classline[1]. Requires update of the language cache files: perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang" or: update-lang-cache Found one other asking for this: https://community.ipfire.org/t/ipfire-bandwidth-usage/1203 Signed-off-by: Nate Oaks ---  config/cfgroot/graphs.pl | 202 +++++++++++++++++++++------------------  langs/en/cgi-bin/en.pl   |  13 +--  2 files changed, 117 insertions(+), 98 deletions(-)  'ovpn add conf' => 'Additional configuration', diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl index 441d4c483a46..c83ae67bbfc1 100644 --- a/config/cfgroot/graphs.pl +++ b/config/cfgroot/graphs.pl @@ -545,28 +545,30 @@ sub updateifgraph {          "-1".$period,          "-r",          "-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"}, -        "-v ".$Lang::tr{'bytes per second'}, +        "-v ".$Lang::tr{'bits per second'},          "--color=SHADEA".$color{"color19"},          "--color=SHADEB".$color{"color19"},          "--color=BACK".$color{"color21"}, "DEF:incoming=".$mainsettings{'RRDLOG'}."/collectd/localhost/interface/if_octets-".$interface.".rrd:rx:AVERAGE", "DEF:outgoing=".$mainsettings{'RRDLOG'}."/collectd/localhost/interface/if_octets-".$interface.".rrd:tx:AVERAGE", -        "CDEF:outgoingn=outgoing,-1,*", +        "CDEF:outgoingb=outgoing,8,*", +        "CDEF:outgoingn=outgoingb,-1,*", +        "CDEF:incomingb=incoming,8,*",          "COMMENT:".sprintf("%-20s",$Lang::tr{'caption'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'average'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j", - "AREA:incoming".$color{"color12"}."A0:".sprintf("%-20s",$Lang::tr{'incoming traffic in bytes per second'}), -        "GPRINT:incoming:MAX:%8.1lf %sBps", -        "GPRINT:incoming:AVERAGE:%8.1lf %sBps", -        "GPRINT:incoming:MIN:%8.1lf %sBps", -        "GPRINT:incoming:LAST:%8.1lf %sBps\\j", - "AREA:outgoingn".$color{"color13"}."A0:".sprintf("%-20s",$Lang::tr{'outgoing traffic in bytes per second'}), -        "GPRINT:outgoing:MAX:%8.1lf %sBps", -        "GPRINT:outgoing:AVERAGE:%8.1lf %sBps", -        "GPRINT:outgoing:MIN:%8.1lf %sBps", -        "GPRINT:outgoing:LAST:%8.1lf %sBps\\j", + "AREA:incomingb".$color{"color12"}."A0:".sprintf("%-20s",$Lang::tr{'incoming traffic in bits per second'}), +        "GPRINT:incomingb:MAX:%8.1lf %sbps", +        "GPRINT:incomingb:AVERAGE:%8.1lf %sbps", +        "GPRINT:incomingb:MIN:%8.1lf %sbps", +        "GPRINT:incomingb:LAST:%8.1lf %sbps\\j", + "AREA:outgoingn".$color{"color13"}."A0:".sprintf("%-20s",$Lang::tr{'outgoing traffic in bits per second'}), +        "GPRINT:outgoingb:MAX:%8.1lf %sbps", +        "GPRINT:outgoingb:AVERAGE:%8.1lf %sbps", +        "GPRINT:outgoingb:MIN:%8.1lf %sbps", +        "GPRINT:outgoingb:LAST:%8.1lf %sbps\\j",          );          $ERROR = RRDs::error;          return "Error in RRD::graph for ".$interface.": ".$ERROR."\n" if $ERROR; @@ -582,28 +584,30 @@ sub updatevpngraph {          "-1".$period,          "-r",          "-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"}, -        "-v ".$Lang::tr{'bytes per second'}, +        "-v ".$Lang::tr{'bits per second'},          "--color=SHADEA".$color{"color19"},          "--color=SHADEB".$color{"color19"},          "--color=BACK".$color{"color21"}, "DEF:incoming=".$mainsettings{'RRDLOG'}."/collectd/localhost/openvpn-$interface/if_octets_derive.rrd:rx:AVERAGE", "DEF:outgoing=".$mainsettings{'RRDLOG'}."/collectd/localhost/openvpn-$interface/if_octets_derive.rrd:tx:AVERAGE", -        "CDEF:outgoingn=outgoing,-1,*", +        "CDEF:outgoingb=outgoing,8,*", +        "CDEF:outgoingn=outgoingb,-1,*", +        "CDEF:incomingb=incoming,8,*",          "COMMENT:".sprintf("%-20s",$Lang::tr{'caption'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'average'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j", -        "AREA:incoming#00dd00:".sprintf("%-20s",$Lang::tr{'incoming traffic in bytes per second'}), -        "GPRINT:incoming:MAX:%8.1lf %sBps", -        "GPRINT:incoming:AVERAGE:%8.1lf %sBps", -        "GPRINT:incoming:MIN:%8.1lf %sBps", -        "GPRINT:incoming:LAST:%8.1lf %sBps\\j", - "AREA:outgoingn#dd0000:".sprintf("%-20s",$Lang::tr{'outgoing traffic in bytes per second'}), -        "GPRINT:outgoing:MAX:%8.1lf %sBps", -        "GPRINT:outgoing:AVERAGE:%8.1lf %sBps", -        "GPRINT:outgoing:MIN:%8.1lf %sBps", -        "GPRINT:outgoing:LAST:%8.1lf %sBps\\j", + "AREA:incomingb#00dd00:".sprintf("%-20s",$Lang::tr{'incoming traffic in bits per second'}), +        "GPRINT:incomingb:MAX:%8.1lf %sbps", +        "GPRINT:incomingb:AVERAGE:%8.1lf %sbps", +        "GPRINT:incomingb:MIN:%8.1lf %sbps", +        "GPRINT:incomingb:LAST:%8.1lf %sbps\\j", + "AREA:outgoingn#dd0000:".sprintf("%-20s",$Lang::tr{'outgoing traffic in bits per second'}), +        "GPRINT:outgoingb:MAX:%8.1lf %sbps", +        "GPRINT:outgoingb:AVERAGE:%8.1lf %sbps", +        "GPRINT:outgoingb:MIN:%8.1lf %sbps", +        "GPRINT:outgoingb:LAST:%8.1lf %sbps\\j",          );          $ERROR = RRDs::error;          return "Error in RRD::graph for ".$interface.": ".$ERROR."\n" if $ERROR; @@ -619,7 +623,7 @@ sub updatevpnn2ngraph {          "-1".$period,          "-r",          "-t ".$Lang::tr{'traffic on'}." ".$interface." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"}, -        "-v ".$Lang::tr{'bytes per second'}, +        "-v ".$Lang::tr{'bits per second'},          "--color=SHADEA".$color{"color19"},          "--color=SHADEB".$color{"color19"},          "--color=BACK".$color{"color21"}, @@ -629,44 +633,50 @@ sub updatevpnn2ngraph { "DEF:overhead_out=".$mainsettings{'RRDLOG'}."/collectd/localhost/openvpn-$interface/if_octets_derive-overhead.rrd:tx:AVERAGE", "DEF:compression_in=".$mainsettings{'RRDLOG'}."/collectd/localhost/openvpn-$interface/compression_derive-data_in.rrd:uncompressed:AVERAGE", "DEF:compression_out=".$mainsettings{'RRDLOG'}."/collectd/localhost/openvpn-$interface/compression_derive-data_out.rrd:uncompressed:AVERAGE", -        "CDEF:outgoingn=outgoing,-1,*", -        "CDEF:overhead_outn=overhead_out,-1,*", -        "CDEF:compression_outn=compression_out,-1,*", +        "CDEF:outgoingb=outgoing,8,*", +        "CDEF:outgoingn=outgoingb,-1,*", +        "CDEF:incomingb=incoming,8,*", +        "CDEF:overhead_outb=overhead_out,8,*", +        "CDEF:overhead_outn=overhead_outb,-1,*", +        "CDEF:overhead_inb=overhead_in,8,*", +        "CDEF:compression_outb=compression_out,8,*", +        "CDEF:compression_outn=compression_outb,-1,*", +        "CDEF:compression_inb=compression_in,8,*",          "COMMENT:".sprintf("%-20s",$Lang::tr{'caption'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'average'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j", -        "AREA:incoming#00dd00:".sprintf("%-23s",$Lang::tr{'incoming traffic in bytes per second'}), -        "GPRINT:incoming:MAX:%8.1lf %sBps", -        "GPRINT:incoming:AVERAGE:%8.1lf %sBps", -        "GPRINT:incoming:MIN:%8.1lf %sBps", -        "GPRINT:incoming:LAST:%8.1lf %sBps\\j", - "STACK:overhead_in#116B11:".sprintf("%-23s",$Lang::tr{'incoming overhead in bytes per second'}), -        "GPRINT:overhead_in:MAX:%8.1lf %sBps", -        "GPRINT:overhead_in:AVERAGE:%8.1lf %sBps", -        "GPRINT:overhead_in:MIN:%8.1lf %sBps", -        "GPRINT:overhead_in:LAST:%8.1lf %sBps\\j", - "LINE1:compression_in#ff00ff:".sprintf("%-23s",$Lang::tr{'incoming compression in bytes per second'}), -        "GPRINT:compression_in:MAX:%8.1lf %sBps", -        "GPRINT:compression_in:AVERAGE:%8.1lf %sBps", -        "GPRINT:compression_in:MIN:%8.1lf %sBps", -        "GPRINT:compression_in:LAST:%8.1lf %sBps\\j", - "AREA:outgoingn#dd0000:".sprintf("%-23s",$Lang::tr{'outgoing traffic in bytes per second'}), -        "GPRINT:outgoing:MAX:%8.1lf %sBps", -        "GPRINT:outgoing:AVERAGE:%8.1lf %sBps", -        "GPRINT:outgoing:MIN:%8.1lf %sBps", -        "GPRINT:outgoing:LAST:%8.1lf %sBps\\j", - "STACK:overhead_outn#870C0C:".sprintf("%-23s",$Lang::tr{'outgoing overhead in bytes per second'}), -        "GPRINT:overhead_out:MAX:%8.1lf %sBps", -        "GPRINT:overhead_out:AVERAGE:%8.1lf %sBps", -        "GPRINT:overhead_out:MIN:%8.1lf %sBps", -        "GPRINT:overhead_out:LAST:%8.1lf %sBps\\j", - "LINE1:compression_outn#000000:".sprintf("%-23s",$Lang::tr{'outgoing compression in bytes per second'}), -        "GPRINT:compression_out:MAX:%8.1lf %sBps", -        "GPRINT:compression_out:AVERAGE:%8.1lf %sBps", -        "GPRINT:compression_out:MIN:%8.1lf %sBps", -        "GPRINT:compression_out:LAST:%8.1lf %sBps\\j", + "AREA:incomingb#00dd00:".sprintf("%-23s",$Lang::tr{'incoming traffic in bits per second'}), +        "GPRINT:incomingb:MAX:%8.1lf %sbps", +        "GPRINT:incomingb:AVERAGE:%8.1lf %sbps", +        "GPRINT:incomingb:MIN:%8.1lf %sbps", +        "GPRINT:incomingb:LAST:%8.1lf %sbps\\j", + "STACK:overhead_inb#116B11:".sprintf("%-23s",$Lang::tr{'incoming overhead in bits per second'}), +        "GPRINT:overhead_inb:MAX:%8.1lf %sbps", +        "GPRINT:overhead_inb:AVERAGE:%8.1lf %sbps", +        "GPRINT:overhead_inb:MIN:%8.1lf %sbps", +        "GPRINT:overhead_inb:bLAST:%8.1lf %sbps\\j", + "LINE1:compression_inb#ff00ff:".sprintf("%-23s",$Lang::tr{'incoming compression in bits per second'}), +        "GPRINT:compression_inb:MAX:%8.1lf %sbps", +        "GPRINT:compression_inb:AVERAGE:%8.1lf %sbps", +        "GPRINT:compression_inb:MIN:%8.1lf %sbps", +        "GPRINT:compression_inb:LAST:%8.1lf %sbps\\j", + "AREA:outgoingn#dd0000:".sprintf("%-23s",$Lang::tr{'outgoing traffic in bits per second'}), +        "GPRINT:outgoingb:MAX:%8.1lf %sbps", +        "GPRINT:outgoingb:AVERAGE:%8.1lf %sbps", +        "GPRINT:outgoingb:MIN:%8.1lf %sbps", +        "GPRINT:outgoingb:LAST:%8.1lf %sbps\\j", + "STACK:overhead_outn#870C0C:".sprintf("%-23s",$Lang::tr{'outgoing overhead in bits per second'}), +        "GPRINT:overhead_outb:MAX:%8.1lf %sbps", +        "GPRINT:overhead_outb:AVERAGE:%8.1lf %sbps", +        "GPRINT:overhead_outb:MIN:%8.1lf %sbps", +        "GPRINT:overhead_outb:LAST:%8.1lf %sbps\\j", + "LINE1:compression_outn#000000:".sprintf("%-23s",$Lang::tr{'outgoing compression in bits per second'}), +        "GPRINT:compression_outb:MAX:%8.1lf %sbps", +        "GPRINT:compression_outb:AVERAGE:%8.1lf %sbps", +        "GPRINT:compression_outb:MIN:%8.1lf %sbps", +        "GPRINT:compression_outb:LAST:%8.1lf %sbps\\j",          );          $ERROR = RRDs::error;          return "Error in RRD::graph for ".$interface.": ".$ERROR."\n" if $ERROR; @@ -683,7 +693,7 @@ sub updatefwhitsgraph {          "-1".$period,          "-r",          "-t ".$Lang::tr{'firewall hits per'}." ".$Lang::tr{$period."-graph"}, -        "-v ".$Lang::tr{'bytes per second'}, +        "-v ".$Lang::tr{'bits per second'},          "--color=SHADEA".$color{"color19"},          "--color=SHADEB".$color{"color19"},          "--color=BACK".$color{"color21"}, @@ -692,36 +702,41 @@ sub updatefwhitsgraph { "DEF:forward=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-POLICYFWD/ipt_bytes-DROP_FORWARD.rrd:value:AVERAGE", "DEF:newnotsyn=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-NEWNOTSYN/ipt_bytes-DROP_NEWNOTSYN.rrd:value:AVERAGE", "DEF:portscan=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-PSCAN/ipt_bytes-DROP_PScan.rrd:value:AVERAGE", +        "CDEF:outputb=output,8,*", +        "CDEF:inputb=input,8,*", +        "CDEF:forwardb=forward,8,*", +        "CDEF:newnotsynb=newnotsyn,8,*", +        "CDEF:portscanb=portscan,8,*",          "COMMENT:".sprintf("%-26s",$Lang::tr{'caption'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'average'}),          "COMMENT:".sprintf("%14s",$Lang::tr{'minimal'}),          "COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j", - "AREA:output".$color{"color25"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}." (OUTPUT)"), -        "GPRINT:output:MAX:%8.1lf %sBps", -        "GPRINT:output:AVERAGE:%8.1lf %sBps", -        "GPRINT:output:MIN:%8.1lf %sBps", -        "GPRINT:output:LAST:%8.1lf %sBps\\j", - "STACK:forward".$color{"color23"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}." (FORWARD)"), -        "GPRINT:forward:MAX:%8.1lf %sBps", -        "GPRINT:forward:AVERAGE:%8.1lf %sBps", -        "GPRINT:forward:MIN:%8.1lf %sBps", -        "GPRINT:forward:LAST:%8.1lf %sBps\\j", - "STACK:input".$color{"color24"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}." (INPUT)"), -        "GPRINT:input:MAX:%8.1lf %sBps", -        "GPRINT:input:AVERAGE:%8.1lf %sBps", -        "GPRINT:input:MIN:%8.1lf %sBps", -        "GPRINT:input:LAST:%8.1lf %sBps\\j", - "STACK:newnotsyn".$color{"color14"}."A0:".sprintf("%-25s","NewNotSYN"), -        "GPRINT:newnotsyn:MAX:%8.1lf %sBps", -        "GPRINT:newnotsyn:AVERAGE:%8.1lf %sBps", -        "GPRINT:newnotsyn:MIN:%8.1lf %sBps", -        "GPRINT:newnotsyn:LAST:%8.1lf %sBps\\j", - "STACK:portscan".$color{"color16"}."A0:".sprintf("%-25s",$Lang::tr{'portscans'}), -        "GPRINT:portscan:MAX:%8.1lf %sBps", -        "GPRINT:portscan:AVERAGE:%8.1lf %sBps", -        "GPRINT:portscan:MIN:%8.1lf %sBps", -        "GPRINT:portscan:LAST:%8.1lf %sBps\\j", + "AREA:outputb".$color{"color25"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}." (OUTPUT)"), +        "GPRINT:outputb:MAX:%8.1lf %sbps", +        "GPRINT:outputb:AVERAGE:%8.1lf %sbps", +        "GPRINT:outputb:MIN:%8.1lf %sbps", +        "GPRINT:outputb:LAST:%8.1lf %sbps\\j", + "STACK:forwardb".$color{"color23"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}." (FORWARD)"), +        "GPRINT:forwardb:MAX:%8.1lf %sbps", +        "GPRINT:forwardb:AVERAGE:%8.1lf %sbps", +        "GPRINT:forwardb:MIN:%8.1lf %sbps", +        "GPRINT:forwardb:LAST:%8.1lf %sbps\\j", + "STACK:inputb".$color{"color24"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}." (INPUT)"), +        "GPRINT:inputb:MAX:%8.1lf %sbps", +        "GPRINT:inputb:AVERAGE:%8.1lf %sbps", +        "GPRINT:inputb:MIN:%8.1lf %sbps", +        "GPRINT:inputb:LAST:%8.1lf %sbps\\j", + "STACK:newnotsynb".$color{"color14"}."A0:".sprintf("%-25s","NewNotSYN"), +        "GPRINT:newnotsynb:MAX:%8.1lf %sbps", +        "GPRINT:newnotsynb:AVERAGE:%8.1lf %sbps", +        "GPRINT:newnotsynb:MIN:%8.1lf %sbps", +        "GPRINT:newnotsynb:LAST:%8.1lf %sbps\\j", + "STACK:portscanb".$color{"color16"}."A0:".sprintf("%-25s",$Lang::tr{'portscans'}), +        "GPRINT:portscanb:MAX:%8.1lf %sbps", +        "GPRINT:portscanb:AVERAGE:%8.1lf %sbps", +        "GPRINT:portscanb:MIN:%8.1lf %sbps", +        "GPRINT:portscanb:LAST:%8.1lf %sbps\\j",          );          $ERROR = RRDs::error;          return "Error in RRD::graph for firewallhits: ".$ERROR."\n" if $ERROR; @@ -1012,7 +1027,7 @@ sub updateqosgraph {          "-1".$period,          "-r",          "-t ".$Lang::tr{'Utilization on'}." (".$qossettings{'DEV'}.") ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"}, -        "-v ".$Lang::tr{'bytes per second'}, +        "-v ".$Lang::tr{'bits per second'},          "--color=SHADEA".$color{"color19"},          "--color=SHADEB".$color{"color19"},          "--color=BACK".$color{"color21"}, @@ -1039,21 +1054,24 @@ sub updateqosgraph {              }              if ( $classline[0] eq $qossettings{'DEV'} ){ -                push(@command, "DEF:$classline[1]=$mainsettings{'RRDLOG'}/class_$qossettings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bytes:AVERAGE"); +                # Found: ERROR: rpn expressions without DEF or CDEF variables are not supported +                # CDEF does not like a number as a variable name. ie. "204" from $classline[1] +                push(@command, "DEF:$classline[1]bit=$mainsettings{'RRDLOG'}/class_$qossettings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bytes:AVERAGE"); +                push(@command, "CDEF:$classline[8]=$classline[1]bit,8,*");                  # get color to be used for this graph                  my $graphColor = $colorMap{$colorKey};                  if ($count eq "1") { -                    push(@command, "AREA:$classline[1]$graphColor:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8])); +                    push(@command, "AREA:$classline[8]$graphColor:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));                  } else { -                    push(@command, "STACK:$classline[1]$graphColor:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8])); +                    push(@command, "STACK:$classline[8]$graphColor:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));                  } -                push(@command, "GPRINT:$classline[1]:MAX:%8.1lf %sBps" -                        , "GPRINT:$classline[1]:AVERAGE:%8.1lf %sBps" -                        , "GPRINT:$classline[1]:MIN:%8.1lf %sBps" -                        , "GPRINT:$classline[1]:LAST:%8.1lf %sBps\\j"); +                push(@command, "GPRINT:$classline[8]:MAX:%8.1lf %sbps" +                        , "GPRINT:$classline[8]:AVERAGE:%8.1lf %sbps" +                        , "GPRINT:$classline[8]:MIN:%8.1lf %sbps" +                        , "GPRINT:$classline[8]:LAST:%8.1lf %sbps\\j");                  $count++;              }          } diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index dc1fd8d67b30..b0097074beb0 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -515,6 +515,7 @@  'broken pipe' => 'Broken pipe',  'buffered memory' => 'Buffered Memory',  'buffers' => 'buffers', +'bits per second' => 'Bits per Second',  'bytes per second' => 'Bytes per Second',  'bytes received' => 'Bytes Received',  'bytes sent' => 'Bytes Sent', @@ -1431,10 +1432,10 @@  'inactive' => 'inactive',  'include logfiles' => 'Include logfiles',  'incoming' => 'incoming', -'incoming compression in bytes per second' => 'Incoming Compression', +'incoming compression in bits per second' => 'Incoming Compression',  'incoming firewall access' => 'Incoming Firewall Access', -'incoming overhead in bytes per second' => 'Incoming Overhead', -'incoming traffic in bytes per second' => 'Incoming Traffic', +'incoming overhead in bits per second' => 'Incoming Overhead', +'incoming traffic in bits per second' => 'Incoming Traffic',  'incorrect password' => 'Incorrect password',  'info' => 'Info',  'init string' => 'Init:', @@ -1907,7 +1908,7 @@  'our donors' => 'Our donors',  'out' => 'Out',  'outgoing' => 'outgoing', -'outgoing compression in bytes per second' => 'Outgoing compression', +'outgoing compression in bits per second' => 'Outgoing compression',  'outgoing firewall' => 'Outgoing Firewall',  'outgoing firewall access' => 'Outgoing Firewall Access',  'outgoing firewall add ip group' => 'Add IP Address Group', @@ -1930,8 +1931,8 @@  'outgoing firewall reset' => 'Reset all',  'outgoing firewall view group' => 'View group',  'outgoing firewall warning' => 'Not selecting source ip or mac ignores them', -'outgoing overhead in bytes per second' => 'Outgoing Overhead', -'outgoing traffic in bytes per second' => 'Outgoing Traffic', +'outgoing overhead in bits per second' => 'Outgoing Overhead', +'outgoing traffic in bits per second' => 'Outgoing Traffic',  'override mtu' => 'Override default MTU',  'ovpn' => 'OpenVPN',