Skip to content

Commit db95337

Browse files
committed
refactor(fail2ban): be a bit more verbose in case everything is ok
1 parent ab18ea1 commit db95337

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ and this project does NOT adhere to [Semantic Versioning](https://semver.org/spe
1111

1212
## [Unreleased]
1313

14-
tbd
14+
### Changed ("refactor", "chore" etc.)
15+
16+
Monitoring Plugins:
17+
18+
* refactor(fail2ban): be a bit more verbose in case everything is ok
1519

1620

1721

check-plugins/fail2ban/fail2ban

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from lib.globals import (STATE_CRIT, STATE_OK, # pylint: disable=C0413
2323
STATE_UNKNOWN, STATE_WARN)
2424

2525
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
26-
__version__ = '2025021501'
26+
__version__ = '2025032401'
2727

2828
DESCRIPTION = 'In fail2ban, checks the amount of banned IP addresses per jail.'
2929

@@ -158,14 +158,11 @@ def main():
158158
perfdata += lib.base.get_perfdata(jail, f2b_currently_banned, None, args.WARN, args.CRIT, 0, None) # pylint: disable=C0301
159159

160160
# over and out
161-
if not count:
162-
msg = 'Everything is ok.'
163-
else:
164-
msg = '{} {} banned\n{}'.format(
165-
count,
166-
lib.txt.pluralize('IP', count),
167-
msg,
168-
)
161+
msg = '{} {} banned\n{}'.format(
162+
count,
163+
lib.txt.pluralize('IP', count),
164+
msg,
165+
)
169166
lib.base.oao(msg, state, perfdata, always_ok=args.ALWAYS_OK)
170167

171168

0 commit comments

Comments
 (0)