PluginOutdatedCatalog: auth

File auth, 1009 bytes (added by jintxo, at 2006-05-11T00:14:22+02:00)

Extremely simple auth.log file parser

Line 
1#!/bin/sh
2#
3#
4# Script to show auth stuff
5#
6# Parameters understood:
7#
8#       config   (required)
9#       autoconf (optional - used by munin-config)
10#
11#
12# Magic markers (optional - used by munin-config and installation
13# scripts):
14#
15#%# family=auto
16#%# capabilities=autoconf
17
18MAXLABEL=20
19
20if [ "$1" = "autoconf" ]; then
21        echo yes
22        exit 0
23fi
24
25if [ "$1" = "config" ]; then
26
27        echo 'graph_title Auth Log Parser'
28        echo 'graph_args --base 1000 -l 0'
29        echo 'graph_vlabel days'
30        echo 'illegal_user.label Illegal Username'
31        echo 'possible_breakin.label Possible Breakin Attempt'
32        echo 'authentication_failure.label Authentication Failure'
33        exit 0
34fi
35
36echo -en "illegal_user.value "
37echo $(grep -i "illegal user" /var/log/auth.log | grep "`date '+%b %d'`" | wc -l)
38echo -n
39echo -en "possible_breakin.value "
40echo $(grep -i "breakin attempt" /var/log/auth.log | grep "`date '+%b %d'`" | wc -l)
41echo -en "authentication_failure.value "
42echo $(grep -i "authentication failure" /var/log/auth.log | grep "`date '+%b %d'`" | wc -l)