Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / radiator / radiator_auth_lag @ e5ce7492

Historique | Voir | Annoter | Télécharger (1,62 ko)

1
#!/bin/sh
2
#
3
# Plugin to monitor Radiator AUTH lag statistics
4
#
5
# Parameters:
6
#
7
# 	config   (required)
8
# 	autoconf (optional - only used by munin-config)
9
#
10
# Config variables:
11
#
12
#       statisticsdir     - Radiator AUTH statistics directory
13
#
14
# Magic markers (optional - used by munin-config and some installation
15
# scripts):
16
#%# family=auto
17
#%# capabilities=autoconf
18

    
19
STATISTICSDIR=/usr/radius/radiator/log/STATISTICS
20
if [ "$statisticsdir"  ]; then STATISTICSDIR=$statisticsdir ; fi
21

    
22

    
23
if [ "$1" = "autoconf" ]; then
24
        if [ -d ${STATISTICSDIR} ] ; then
25
                echo yes
26
                exit 0
27
        else
28
                echo no
29
                exit 1
30
        fi
31
fi
32

    
33

    
34
if [ "$1" = "config" ]; then
35
	echo 'graph_title Radiator AUTH response lag'
36
	echo 'graph_vlabel time'
37
	echo 'graph_args -l 0'
38
	echo 'graph_category radiator'
39
	echo 'graph_info This graph displayes AUTH response lag of all radiator processes combined.'
40
	#
41
	# Count all statistics files and create labels
42
	for COUNT in `ls $STATISTICSDIR/Statistics-auth* | sed -r 's/auth([1-9]{1})\.log$/auth0\1\.log/g' | sort | awk -F"auth" '{print $2}' | sed 's/\.log//g'`; do
43
		echo 'radiator'$COUNT'.label radiator_'$COUNT' '
44
		echo 'radiator'$COUNT'.type GAUGE'
45
		echo 'radiator'$COUNT'.info radiator proc '$COUNT
46
	done
47
	exit 0
48
fi
49

    
50
# Print values for all statistics files
51
for FILE in `ls $STATISTICSDIR/Statistics-auth* | sed -r 's/auth([1-9]{1})\.log$/auth0\1\.log/g' | sort`; do
52
	echo -n radiator`echo $FILE | awk -F"auth" '{print $2}' | sed 's/\.log//g'`".value "
53
	grep "ServerConfig" `echo $FILE | sed -r 's/auth[0]([1-9])\.log$/auth\1\.log/g'` | tail -1 | awk -F"|" '{print $3}'
54
done