From mboxrd@z Thu Jan  1 00:00:00 1970
From: Adolf Belka <adolf.belka@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH v3 6/7] graphs.pl: Fixes bug12981 - Creates in and outgoing
 drop hostile graph entries
Date: Sun, 21 Jan 2024 12:45:52 +0100
Message-ID: <20240121114553.5182-6-adolf.belka@ipfire.org>
In-Reply-To: <20240121114553.5182-1-adolf.belka@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8351388479527880504=="
List-Id: <development.lists.ipfire.org>

--===============8351388479527880504==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

- This v3 version of the patch set splits the single hostile networks graph e=
ntry into
   incoming hostile networks and outgoing hostile networks entries.

Fixes: bug12981
Tested-by: Adolf Belka <adolf.belka(a)ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
 config/cfgroot/graphs.pl | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl
index 9803dd124..f527447b5 100644
--- a/config/cfgroot/graphs.pl
+++ b/config/cfgroot/graphs.pl
@@ -693,7 +693,8 @@ sub updatefwhitsgraph {
 		"DEF:newnotsyn=3D".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-f=
ilter-NEWNOTSYN/ipt_bytes-DROP_NEWNOTSYN.rrd:value:AVERAGE",
 		"DEF:portscan=3D".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-fi=
lter-PSCAN/ipt_bytes-DROP_PScan.rrd:value:AVERAGE",
 		"DEF:spoofedmartian=3D".$mainsettings{'RRDLOG'}."/collectd/localhost/iptab=
les-filter-SPOOFED_MARTIAN/ipt_bytes-DROP_SPOOFED_MARTIAN.rrd:value:AVERAGE",
-		"DEF:hostile=3D".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-fil=
ter-HOSTILE_DROP/ipt_bytes-DROP_HOSTILE.rrd:value:AVERAGE",
+		"DEF:hostilein=3D".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-f=
ilter-HOSTILE_DROP_IN/ipt_bytes-DROP_HOSTILE.rrd:value:AVERAGE",
+		"DEF:hostileout=3D".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-=
filter-HOSTILE_DROP_OUT/ipt_bytes-DROP_HOSTILE.rrd:value:AVERAGE",
 		"COMMENT:".sprintf("%-26s",$Lang::tr{'caption'}),
 		"COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),
 		"COMMENT:".sprintf("%15s",$Lang::tr{'average'}),
@@ -729,11 +730,16 @@ sub updatefwhitsgraph {
 		"GPRINT:spoofedmartian:AVERAGE:%8.1lf %sBps",
 		"GPRINT:spoofedmartian:MIN:%8.1lf %sBps",
 		"GPRINT:spoofedmartian:LAST:%8.1lf %sBps\\j",
-		"STACK:hostile".$color{"color13"}."A0:".sprintf("%-25s",$Lang::tr{'hostile=
 networks'}),
-		"GPRINT:hostile:MAX:%8.1lf %sBps",
-		"GPRINT:hostile:AVERAGE:%8.1lf %sBps",
-		"GPRINT:hostile:MIN:%8.1lf %sBps",
-		"GPRINT:hostile:LAST:%8.1lf %sBps\\j",
+		"STACK:hostilein".$color{"color13"}."A0:".sprintf("%-25s",$Lang::tr{'hosti=
le networks in'}),
+		"GPRINT:hostilein:MAX:%8.1lf %sBps",
+		"GPRINT:hostilein:AVERAGE:%8.1lf %sBps",
+		"GPRINT:hostilein:MIN:%8.1lf %sBps",
+		"GPRINT:hostilein:LAST:%8.1lf %sBps\\j",
+		"STACK:hostileout".$color{"color25"}."A0:".sprintf("%-25s",$Lang::tr{'host=
ile networks out'}),
+		"GPRINT:hostileout:MAX:%8.1lf %sBps",
+		"GPRINT:hostileout:AVERAGE:%8.1lf %sBps",
+		"GPRINT:hostileout:MIN:%8.1lf %sBps",
+		"GPRINT:hostileout:LAST:%8.1lf %sBps\\j",
 		);
 		$ERROR =3D RRDs::error;
 		return "Error in RRD::graph for firewallhits: ".$ERROR."\n" if $ERROR;
--=20
2.43.0


--===============8351388479527880504==--