Browse Source

* update jail status report

master
Alex 'AdUser' Z 4 years ago
parent
commit
33f73dbb0e
  1. 25
      src/jail.c

25
src/jail.c

@ -496,17 +496,20 @@ f2b_jail_cmd_status(char *res, size_t ressize, f2b_jail_t *jail) {
"flags:\n" "flags:\n"
" enabled: %s\n" " enabled: %s\n"
" state: %s\n" " state: %s\n"
" filter: %s\n"
"maxretry: %d\n" "maxretry: %d\n"
"times:\n" "times:\n"
" bantime: %d\n" " bantime: %d (+%d%%)\n"
" findtime: %d\n" " findtime: %d (+%d%%)\n"
" expiretime: %d\n" " expiretime: %d (+%d%%)\n"
"incr:\n" "extend:\n"
" bantime: %.1f\n" " bantime: %.1f\n"
" findtime: %.1f\n" " findtime: %.1f\n"
" expiretime: %d\n"
"stats:\n" "stats:\n"
" banned: %d\n" " hosts: %d\n"
" matched: %d\n"; " matches: %d\n"
" bans: %d\n";
assert(res != NULL); assert(res != NULL);
assert(jail != NULL); assert(jail != NULL);
@ -514,10 +517,14 @@ f2b_jail_cmd_status(char *res, size_t ressize, f2b_jail_t *jail) {
snprintf(res, ressize, fmt, jail->name, snprintf(res, ressize, fmt, jail->name,
jail->flags & JAIL_ENABLED ? "yes" : "no", jail->flags & JAIL_ENABLED ? "yes" : "no",
jail->flags & JAIL_HAS_STATE ? "yes" : "no", jail->flags & JAIL_HAS_STATE ? "yes" : "no",
jail->flags & JAIL_HAS_FILTER ? "yes" : "no",
jail->maxretry, jail->maxretry,
jail->bantime, jail->findtime, jail->expiretime, jail->bantime, (int) (jail->bantime_extend - 1.0) * 100,
jail->bantime_extend, jail->findtime_extend, jail->findtime, (int) (jail->findtime_extend - 1.0) * 100,
jail->stats.bans, jail->stats.matches); jail->expiretime, (int) (jail->expiretime_extend - 1.0) * 100,
jail->stats.hosts,
jail->stats.matches,
jail->stats.bans);
} }
void void

Loading…
Cancel
Save