diff --git a/fail2ban b/fail2ban new file mode 100755 index 0000000..7ccd1bf --- /dev/null +++ b/fail2ban @@ -0,0 +1,59 @@ +#!/bin/bash +# +# munin plugin to monitor bans on Fail2ban jails +# +# Origional Author: Thomas Leveil +# Contributors: none +# Version: 1.1 +# +############################################### +# You have to specify a different user in the munin-node config file as follow: +# +# [fail2ban_all_jails] +# user root +############################################### +# +# HISTORY +# v1.1 : better autoconf +# +#%# family=contrib +#%# capabilities=autoconf + + +case $1 in + autoconf) + if [ -z $(which fail2ban-client) ]; then + echo no + exit 1 + fi + if [ $(whoami) != "root" ]; then + echo "no (fail2ban-client found but must run as root)" + exit 1 + fi + if [ -x $(which fail2ban-client) ]; then + echo yes + exit 0 + else + echo "no (fail2ban-client found but not executable)" + exit 1 + fi + ;; + config) + echo "graph_title Fail2ban" + echo 'graph_vlabel active bans' + echo 'graph_category Network' + echo 'graph_info number of jailled ip' + echo 'graph_info This graph shows the amount of bans caught by Fail2ban' + #$(which fail2ban-client) status | awk '/Jail list:/ { for (i=4; i<=NF; i++) { sub(/,$/,"",$i); jail=$i; sub(/-/,"_",$i); print "fail2ban_"$i".label "jail } }' + $(which fail2ban-client) status | sed s/-//g | awk '/Jail list:/ { for (i=4; i<=NF; i++) { sub(/,$/,"",$i); jail=$i; print "fail2ban_"$i".label "jail } }' + exit 0 + ;; +esac + + $(which fail2ban-client) status | awk '/Jail list:/ { for (i=4; i<=NF; i++) { sub(/,$/,"",$i); print $i } }' | \ + while read JAIL; do + #echo -n "fail2ban_${JAIL//-/_}.value " + echo -n "fail2ban_${JAIL//-/}.value " + $(which fail2ban-client) status $JAIL | sed s/-//g | awk '/Currently banned:/ { print $NF }' + done + diff --git a/ircd b/ircd new file mode 100755 index 0000000..89fbe6a --- /dev/null +++ b/ircd @@ -0,0 +1,105 @@ +#!/usr/bin/php +