]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commit - config/cfgroot/graphs.pl
graphs.pl: Fixes graph failure when the DROP_HOSTILE directory is missing
authorAdolf Belka <adolf.belka@ipfire.org>
Wed, 14 Feb 2024 10:34:36 +0000 (11:34 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 14 Feb 2024 19:01:44 +0000 (19:01 +0000)
commit2071b2964fed10cbcf62bd2d7da3b7e718f8a88f
tree91fc4971dfdb354c0ffdc9c3cc186a99830fc6a2
parentf3d7ce3b5d83222c78bc2b246f6afd5766af4dc9
graphs.pl: Fixes graph failure when the DROP_HOSTILE directory is missing

- If a fresh install is done then only the DROP_HOSTILE_IN & DROP_HOSTILE_OUT
   rrd directories are created.
- With the DROP_HOSTILE directory missing then when the fwhits graph is updated an error
   message is caused by the inability to open the required files.
- This patch adds an if/else loop into the fwhits graph code to deal with the two cases
   of the DROP_HOSTILE being present or not depending on the history and if a backup with
   logs has been restored from when DROP_HOSTILE was in use.
- Tested on vm testbed and created a historical line for the hostile data when it was not
   split
- There might be a simpler or better approach than this but it was the only option I
   could identify. I couldn't find anything about being able to use if loops within the
   RRD::Graph loop

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/graphs.pl