mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Add job stats graph
This commit is contained in:
parent
5f432d0d6d
commit
f7cce85865
39
plugins/sge/sge_job_stats
Executable file
39
plugins/sge/sge_job_stats
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Graphs the number of running and waiting jobs, as well as when they
|
||||
# are submitted.
|
||||
#
|
||||
# Tested with Son of Gridengine.
|
||||
|
||||
if [ "$1" = "config" ]
|
||||
then
|
||||
echo graph_title SGE gridengine jobs
|
||||
echo graph_vlabel count
|
||||
echo graph_category processes
|
||||
echo running.label Running jobs
|
||||
echo running.type GAUGE
|
||||
echo running.draw AREA
|
||||
echo waiting.label Queued jobs
|
||||
echo waiting.type GAUGE
|
||||
echo waiting.draw STACK
|
||||
echo maxnum.label Submitted jobs
|
||||
echo maxnum.type DERIVE
|
||||
echo maxnum.draw LINE2
|
||||
echo maxnum.min 0
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. /opt/sge/default/common/settings.sh
|
||||
|
||||
qstat -u '*' | awk '
|
||||
BEGIN{maxnum = 0; running = 0; waiting = 0}
|
||||
/^ /{
|
||||
maxnum = (maxnum > $1 ? maxnum : $1);
|
||||
if ( $5 == "r" ) {
|
||||
running += 1;
|
||||
} else {
|
||||
waiting += 1;
|
||||
}
|
||||
}
|
||||
END { printf("running.value %d\nwaiting.value %d\nmaxnum.value %d\n", running, waiting, maxnum); }'
|
Loading…
Reference in New Issue
Block a user