Projet

Général

Profil

Révision 74a9f763

ID74a9f76309030c866956d088aef1a575f4c8349c
Parent 319a3df8
Enfant 93c4fe40

Ajouté par ?ar?nas Burdulis il y a presque 14 ans

Initial version

Voir les différences:

plugins/other/condor_queue_
1
#!/bin/bash
2
#
3
# Wildcard-plugin to monitor Condor queue.
4
#
5
# Author: Šarūnas Burdulis, sarunas(a)mail.saabnet.com, 2008
6
#
7
# Runs 'condor_q -g' (list global queue), tail's to the last 
8
# line of output (contains job summary) and 
9
# gets numbers of queued, idle, running and held jobs.
10
#
11
# Parameters understood:
12
#
13
# 	config   (required)
14
# 	autoconf (optional - used by munin-config)
15
#	suggest  (optional - used by munin-config)
16
#
17
# Configurable variables:
18
#
19
# 	env.condor_q - Path to condor_q executable,
20
#		       defaults to /usr/local/condor/bin/condor_q
21
# 	env.title    - Graph title, overrides "Condor Queue [suffix]".
22
# 	env.options  - Additional command line options to condor_q. 
23
#		       Only a limited set of options can be used, as many
24
# 		       of them eliminate the summary line from condor_q output.
25
#
26
# Magic markers - optional - used by installation scripts and
27
# munin-config:
28
#
29
#%# family=contrib
30
#%# capabilities=autoconf
31

  
32
# optional tag in symlink
33
TAG=`basename $0 | sed 's/^condor_queue_//g'`
34

  
35
# env.title
36
TITLE="$title"
37

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

  
45
# env.options
46
OPTIONS="$options"
47

  
48
if [ ! -z "$TITLE" ]; then
49
    GRAPHTITLE="$TITLE"
50
elif [ ! -z "$TAG" ]; then
51
    GRAPHTITLE="Queue (${TAG})"
52
else
53
    GRAPHTITLE="Queue"
54
fi
55

  
56
if [ "$1" = "autoconf" ]; then
57
    echo "no"
58
    exit 1
59
fi
60

  
61
if [ "$1" = "suggest" ]; then
62
    echo "For example: condor_queue_clusterTwo."
63
    exit 0
64
fi
65

  
66
if [ "$1" = "config" ]; then
67
    echo "graph_title "$GRAPHTITLE""
68
    echo "graph_order held running idle queue"
69
    echo "graph_args --lower-limit 0 "
70
    echo "graph_vlabel Jobs"
71
    echo "graph_scale no"
72
    echo "graph_info Shows global Condor queue from condor_q -g."
73
    echo "graph_category Condor"
74
    echo "graph_period second"
75
    echo "held.label Held"
76
    echo "held.draw AREA"
77
    echo "held.type GAUGE"
78
    echo "held.info Held"
79
    echo "running.label Running"
80
    echo "running.draw STACK"
81
    echo "running.type GAUGE"
82
    echo "running.info Running"
83
    echo "idle.label Idle"
84
    echo "idle.draw STACK"
85
    echo "idle.type GAUGE"
86
    echo "idle.info Idle"
87
    echo "queue.label Queue"
88
    echo "queue.draw LINE"
89
    echo "queue.type GAUGE"
90
    echo "queue.info Queue" 
91
    exit 0
92
fi
93

  
94
# example: 3076 jobs; 3052 idle, 24 running, 0 held
95
$CQ -g $OPTIONS | tail -n1 | awk '{print "queue.value " $1 "\nheld.value " $7 "\nrunning.value " $5 "\nidle.value " $3}'
96
				  

Formats disponibles : Unified diff