#!/bin/sh # # Plugin to monitor the number of failed logins in the last 15 minutes # # Parameters: # # config # autoconf # # Configuration variables # # mysqlopts - Options to pass to mysql which should include the # username, password, host and alternc database. # # Example of the entry in plugin-conf.d/munin-node # [alternc*] # user root # env.mysqlopts --defaults-file=/etc/mysql/alternc.cnf # # #%# family=auto #%# capabilities=autoconf LOGFILE=${logfile:-/var/log/alternc/bureau.log} OFFSET_FILE=/var/lib/munin/plugin-state/alternc_failedlogins.offset LOGTAIL=${logtail:-/usr/sbin/logtail} if [ "$1" = "autoconf" ]; then echo yes exit 0 fi if [ "$1" = "config" ]; then echo 'graph_title AlternC - number of failed logins' echo 'graph_vlabel quantity' echo 'graph_category alternc' echo 'totalfailed.label total of failed logins' exit 0 fi /usr/bin/printf "totalfailed.value " ${LOGTAIL} ${LOGFILE} ${OFFSET_FILE} | grep 'ERROR - - Utilisateur ou mot de passe incorrect' | wc -l