Projet

Général

Profil

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

root / plugins / condor / condor_activity_ @ 942bda31

Historique | Voir | Annoter | Télécharger (2,54 ko)

1
#!/bin/bash
2
#
3
# Wildard-plugin to monitor "activity" property of Condor nodes.
4
#
5
# Author: Šarūnas Burdulis, sarunas(a)mail.saabnet.com, 2008
6
#
7
# Runs 'condor_status' and counts virtual machines by their 
8
# reported Condor "activity" (Idle, Busy, Suspended, Vacating, Benchmarking).  
9
#
10
# Parameters understood:
11
#
12
#	config   (required)
13
# 	autoconf (optional - used by munin-config)
14
#	suggest  (optional - used by munin-config)
15
#
16
# Configurable variables:
17
#
18
# 	env.condor_status - Path to condor_status executable,
19
#		defaults to /usr/local/condor/bin/condor_status
20
# 	env.constraint - Condor ClassAds constraint(s), as they are
21
#		specified on the condor_status command line. For example, 
22
#		to monitor 64-bit Linux nodes set:
23
#		env.constraint 'arch=="x86_64" && opsys=="linux"'
24
#
25
# Magic markers - optional - used by installation scripts and
26
# munin-config:
27
#
28
#%# family=contrib
29
#%# capabilities=autoconf
30

    
31
# optional tag
32
TAG=`basename $0 | sed 's/^condor_activity_//g'`
33
if [ -z "$TAG" ]; then
34
    GRAPHTITLE="Activities"
35
else
36
    GRAPHTITLE="Activities (${TAG})"
37
fi
38

    
39
# env.condor_status
40
if [ ! -z "$condor_status" ]; then
41
    CS="$condor_status"
42
else
43
    CS="/usr/local/condor/bin/condor_status"
44
fi
45

    
46
# env.constraint
47
if [ ! -z "$constraint" ]; then
48
    CONS="-constraint ${constraint}"
49
else
50
    CONS=
51
fi
52
 
53
if [ "$1" = "autoconf" ]; then
54
    echo "no"
55
    exit 1
56
fi
57

    
58
if [ "$1" = "suggest" ]; then
59
    echo "For example: condor_activity_Linux-x86_64."
60
    exit 0
61
fi
62

    
63
if [ "$1" = "config" ]; then
64

    
65
	echo "graph_title "$GRAPHTITLE""
66
	echo "graph_order idl bus sus vac ben"
67
	echo "graph_args --lower-limit 0 "
68
	echo "graph_vlabel VMs"
69
	echo "graph_scale no"
70
	echo "graph_info Shows slot activity from condor_status."
71
	echo "graph_category Condor"
72
	echo "graph_period second"
73
	echo "idl.label Idle"
74
	echo "idl.draw AREA"
75
	echo "idl.type GAUGE"
76
	echo "idl.info Idle VMs" 
77
	echo "bus.label Busy"
78
	echo "bus.draw STACK"
79
	echo "bus.type GAUGE"
80
	echo "bus.info Busy VMs"
81
	echo "sus.label Suspended"
82
	echo "sus.draw STACK"
83
	echo "sus.type GAUGE"
84
	echo "sus.info Suspended VMs"
85
	echo "vac.label Vacating"
86
	echo "vac.draw STACK"
87
	echo "vac.type GAUGE"
88
	echo "vac.info Vacating VMs"
89
	echo "ben.label Benchmarking"
90
	echo "ben.draw STACK"
91
	echo "ben.type GAUGE"
92
	echo "ben.info Benchmarking VMs"
93
	exit 0
94
fi
95

    
96
echo -n "idl.value "
97
eval $CS $CONS | grep Idle | wc -l 
98
echo -n "bus.value "
99
eval $CS $CONS | grep Busy | wc -l 
100
echo -n "sus.value "
101
eval $CS $CONS | grep Suspended | wc -l 
102
echo -n "vac.value "
103
eval $CS $CONS | grep Vacating | wc -l 
104
echo -n "ben.value "
105
eval $CS $CONS | grep Benchmarking | wc -l