From patchwork Mon May 24 14:04:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: nateos2g X-Patchwork-Id: 4368 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 4Fpf8Q5hr3z3wbl for ; Mon, 24 May 2021 14:04:06 +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 4Fpf8P3WM2z6ZS; Mon, 24 May 2021 14:04:05 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Fpf8N6f8qz2xt5; Mon, 24 May 2021 14:04:04 +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 4Fpf8M43zrz2xpb for ; Mon, 24 May 2021 14:04:03 +0000 (UTC) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 4Fpf8K2f9cz2RH for ; Mon, 24 May 2021 14:04:01 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id CB3B24B28; Mon, 24 May 2021 10:03:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 24 May 2021 10:03:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm3; bh=D8SBeFYFlmD/oGW1hSeMxif5de npwpexGZ3G4RQJkBE=; b=vroNFQhhm9wHV0quECBfJdEibWGQC7IYmfics4pX0t uN9Vpr+he0pxjUP1jN9QePoP2yoh3vIi0DauLC7TzfQNYAE6WwyUxxBI4oYuf5Fz E4Fqxx1CIFhpdfSuNilASKwg7gSjVm2ZDRlCDvhS2rxZTB52ZCA5A0nx7vgJr1bR Z2wtLYEUFp+G0n9g+2stW0C5TlPtDnypBDuVVks6L9AMaGNstjyRJYY9cra3iezx oHYM1iiC0knyld3RqA4gljSM/TqOWMlUVjMoA0uoz4ybfmFbmoCS+C094bu3aHkN 39wRLLS6vigJDTwucCKcThuhlnK5M37vSwS/wCysN8eQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=D8SBeF YFlmD/oGW1hSeMxif5denpwpexGZ3G4RQJkBE=; b=XdGzz1x0BIMKrhggcY1KZ5 nlVrAO97G62pzIIser+9wCn+QjQHgLWpiYVIULK4ee1dFZg6A0AVZHkRRk3+/RgC UKjdcGw1W28hih2KqAzDhGIt6Dy8MxGz3tnkC24FTKR5aiz4gWTjXjfyMET7z6UH mNaskrmMkaYgzEHP5af7ZX+uv+xwu3lWaH5sOAhYNs9NyPEl2WLkfAMRXobJNkAZ Awr4cRVrEWlwRRU+A5Q/h3r3q0sRIWdudwkwwBf1ZI5RDIFORvhk7tVaRjMEWSej rY+SMLX228LnK8T7D2+lMJC9reYr1hy/tzotyAuJphWi3rt3i4PYkHf2w2vmos6Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejledgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpehnrghtvghoshdvghesfhgrshhtmhgrihhlrdgtohhmnecuggft rfgrthhtvghrnhepffduveegleetgfffhfevheelheefhffffedtleduueelkeejkeduie etgfejueffnecuffhomhgrihhnpehiphhfihhrvgdrohhrghenucfkphepieelrddufeef rddutdegrdelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehnrghtvghoshdvghesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from mxn.oakseng.org (cpe-69-133-104-93.cinci.res.rr.com [69.133.104.93]) by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 May 2021 10:03:57 -0400 (EDT) From: nateos2g@fastmail.com To: development@lists.ipfire.org Subject: [PATCH] Network based RRD graphs Bytes to Bits Date: Mon, 24 May 2021 10:04:19 -0400 Message-Id: <20210524140419.29733-1-nateos2g@fastmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1621865042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=D8SBeFYFlmD/oGW1hSeMxif5denpwpexGZ3G4RQJkBE=; b=nY60U3B0vfqPiTfbyGEeDfne/erDS6E/klvpA6IVWXiaFyNy2ynQgUtOhWhUaDb67oTRXB fdcBXC4kjDf7h/v9NLAtBz03ZgCh7iOd3VW4y8mgRCwr5Q7QAASUGNqKHlrOoodOt/YVD8 3i8k2iKjsUaSI5sri04YtGg3IGuXMHsDc5Sthvvv/Gzc4pAfC3Kk2FUK9eKyF1jXxlVZvB 9/3kI8THFGysBrrsRPyhSxhuAZB9TcD2zVYigDBZZZqUKhp5G3qLIHMJoOD5NTXgn0lATF z2Q/FDmDb0gPWxsLs+mJ5gvZ0Zx/viVgAO12/K21dqSrHKR/MV8Bx3d30FzsEg== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1621865042; a=rsa-sha256; cv=none; b=Sxk7OzKPho8DBbqlOmDECbYJUyeIvvtw0e4se3NnEoxI3ZPylKpKYvjHLgPLqCL6TMqnAT U2TcBhLAFKAlFXdwOvxIXcyk6UQAc2pgy46Pf7vJ3490p2eYbeMdKThe8VU1S1Um40KcJH 4ruT6lTkOfZbbv2DxuD/cs8Fi0fznNdJAYORo+jq55ecdMmQjMa2O8UTJPGiinJxoKW2Ro A2iSo/GQQfsGfIwC8ErADa3Hj1qe4X82neXvKkCBseyMqKdGRZTq5XhBdOQnmVQZ0V4fy0 YohJAuSg0pV0yzg+Jy6Q5qn/Kp7gvqn0oem27rbdti2IREGKszD/wAfDN4Piyg== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=fastmail.com header.s=fm3 header.b=vroNFQhh; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=XdGzz1x0; spf=pass (mail01.ipfire.org: domain of nateos2g@fastmail.com designates 64.147.123.20 as permitted sender) smtp.mailfrom=nateos2g@fastmail.com X-Spamd-Result: default: False [-5.28 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(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.20(0.00)]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.20]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[fastmail.com,none]; DKIM_TRACE(0.00)[fastmail.com:+,messagingengine.com:+]; RECEIVED_SPAMHAUS_PBL(0.00)[69.133.104.93:received]; RCVD_TLS_LAST(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]; BAYES_HAM(-3.00)[99.99%]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[fastmail.com:s=fm3,messagingengine.com:s=fm2]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.20:from]; SPF_REPUTATION_HAM(-0.84)[-0.83617746393235]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NO_DN(0.00)[]; MID_CONTAINS_FROM(1.00)[]; FREEMAIL_CC(0.00)[fastmail.com] X-Rspamd-Queue-Id: 4Fpf8K2f9cz2RH Authentication-Results: mail01.ipfire.org; dkim=pass header.d=fastmail.com header.s=fm3 header.b=vroNFQhh; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=XdGzz1x0; spf=pass (mail01.ipfire.org: domain of nateos2g@fastmail.com designates 64.147.123.20 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" From: Nate Oaks 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(-) 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', 'ovpn add conf' => 'Additional configuration',