From 1ec8f204ee0c96ca0a9cf77dff7bdb0f79402462 Mon Sep 17 00:00:00 2001 From: VVelox Date: Thu, 16 Feb 2017 10:50:46 -0600 Subject: [PATCH] add fail2ban snmpd extend script --- snmp/fail2ban | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 snmp/fail2ban diff --git a/snmp/fail2ban b/snmp/fail2ban new file mode 100644 index 0000000..4566e78 --- /dev/null +++ b/snmp/fail2ban @@ -0,0 +1,15 @@ +#!/bin/sh + +# Addthis to snmpd.conf as below. +# extend fail2ban /etc/snmp/fail2ban +# +# Also please verify your fail to ban instalation for proper table/chain names. + +if [ `uname` = "FreeBSD" ]; then + /sbin/pfctl -t fail2ban -T show | /usr/bin/grep -c . +fi +if [ `uname` = "Linux" ]; then + iptables -L -n | grep -c f2b\- +fi + +exit 0;