diff options
Diffstat (limited to 'etc/munin/plugins')
-rwxr-xr-x | etc/munin/plugins/jenkins_builds | 9 | ||||
-rwxr-xr-x | etc/munin/plugins/jenkins_builds_results | 58 | ||||
-rwxr-xr-x | etc/munin/plugins/jenkins_builds_running | 5 | ||||
-rwxr-xr-x | etc/munin/plugins/jenkins_jobs | 9 |
4 files changed, 70 insertions, 11 deletions
diff --git a/etc/munin/plugins/jenkins_builds b/etc/munin/plugins/jenkins_builds index bb2a4763..3e7b09db 100755 --- a/etc/munin/plugins/jenkins_builds +++ b/etc/munin/plugins/jenkins_builds @@ -5,7 +5,7 @@ =head1 NAME -jenkins_builds - Plugin to measure number of jenknis builds +jenkins_builds - Plugin to measure number of jenkins builds =head1 AUTHOR @@ -29,6 +29,7 @@ if [ "$1" = "autoconf" ]; then exit 0 fi +JOB_PREFIXES=$(ls -1 /var/lib/jenkins/jobs/|cut -d "-" -f1-2|sort -u) if [ "$1" = "config" ]; then echo 'graph_title Jenkins Builds in the last 24h' @@ -37,11 +38,11 @@ if [ "$1" = "config" ]; then echo 'graph_total total' echo 'graph_vlabel Jenkins Builds per category in the last 24h' echo 'graph_category jenkins' + draw=AREA for PREFIX in $JOB_PREFIXES ; do echo "jenkins_builds_$PREFIX.label $PREFIX builds" - echo "jenkins_builds_$PREFIX.draw STACK" - #print_warning jenkins_builds_$PREFIX - #print_critical jenkins_builds_$PREFIX + echo "jenkins_builds_$PREFIX.draw $draw" + if [ "$draw" = "AREA" ] ; then draw=STACK ; fi done exit 0 fi diff --git a/etc/munin/plugins/jenkins_builds_results b/etc/munin/plugins/jenkins_builds_results new file mode 100755 index 00000000..9458b5c7 --- /dev/null +++ b/etc/munin/plugins/jenkins_builds_results @@ -0,0 +1,58 @@ +#!/bin/sh +# -*- sh -*- + +: << =cut + +=head1 NAME + +jenkins_builds_results - Plugin to measure number of jenkins builds + +=head1 AUTHOR + +Contributed by Holger Levsen + +=head1 LICENSE + +GPLv2 + +=head1 MAGIC MARKERS + + #%# family=auto + #%# capabilities=autoconf + +=cut + +. $MUNIN_LIBDIR/plugins/plugin.sh + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +JOB_PREFIXES=$(ls -1 /var/lib/jenkins/jobs/|cut -d "-" -f1-2|sort -u) +if [ "$1" = "config" ]; then + + echo 'graph_title Jenkins Build results' + echo 'graph_args --base 1000 -l 0 ' + echo 'graph_scale no' + echo 'graph_total total' + echo 'graph_vlabel Jenkins Builds results per category' + echo 'graph_category jenkins' + draw=AREA + for PREFIX in $JOB_PREFIXES ; do + for STATE in success unstable failed ; do + echo "jenkins_builds_results_${PREFIX}_${STATE}.label ${PREFIX} ${STATE}" + echo "jenkins_builds_results_${PREFIX}_${STATE}.draw $draw" + if [ "$draw" = "AREA" ] ; then draw=STACK ; fi + done + done + exit 0 +fi + +for PREFIX in $JOB_PREFIXES ; do + for STATE in success unstable failed ; do + NR=$( (for i in /var/lib/jenkins/jobs/${PREFIX}*/builds/*/log ; do tail -1 $i ; done ) | grep -i -c $STATE) + NR=$(echo "$NR/2"|bc) + echo "jenkins_builds_results_${PREFIX}_${STATE}.value $NR" + done +done diff --git a/etc/munin/plugins/jenkins_builds_running b/etc/munin/plugins/jenkins_builds_running index 5166279a..8b4e31de 100755 --- a/etc/munin/plugins/jenkins_builds_running +++ b/etc/munin/plugins/jenkins_builds_running @@ -5,7 +5,7 @@ =head1 NAME -jenkins_builds_running - Plugin to measure number of jenknis builds which are currently running +jenkins_builds_running - Plugin to measure number of jenkins builds which are currently running =head1 AUTHOR @@ -29,6 +29,7 @@ if [ "$1" = "autoconf" ]; then exit 0 fi +JOB_PREFIXES=$(ls -1 /var/lib/jenkins/jobs/|cut -d "-" -f1-2|sort -u) if [ "$1" = "config" ]; then echo 'graph_title Jenkins Builds running' @@ -38,8 +39,6 @@ if [ "$1" = "config" ]; then echo 'graph_category jenkins' echo "jenkins_builds_running.label $PREFIX builds_running" echo "jenkins_builds_running.draw AREA" - #print_warning jenkins_builds_running - #print_critical jenkins_builds_running exit 0 fi diff --git a/etc/munin/plugins/jenkins_jobs b/etc/munin/plugins/jenkins_jobs index 170a0333..a93967a2 100755 --- a/etc/munin/plugins/jenkins_jobs +++ b/etc/munin/plugins/jenkins_jobs @@ -5,7 +5,7 @@ =head1 NAME -jenkins_jobs - Plugin to measure number of jenknis jobs +jenkins_jobs - Plugin to measure number of jenkins jobs =head1 AUTHOR @@ -29,6 +29,7 @@ if [ "$1" = "autoconf" ]; then exit 0 fi +JOB_PREFIXES=$(ls -1 /var/lib/jenkins/jobs/|cut -d "-" -f1-2|sort -u) if [ "$1" = "config" ]; then echo 'graph_title Jenkins Jobs' @@ -37,11 +38,11 @@ if [ "$1" = "config" ]; then echo 'graph_total total' echo 'graph_vlabel Jenkins Jobs per category' echo 'graph_category jenkins' + draw=AREA for PREFIX in $JOB_PREFIXES ; do echo "jenkins_jobs_$PREFIX.label $PREFIX jobs" - echo "jenkins_jobs_$PREFIX.draw STACK" - #print_warning jenkins_jobs_$PREFIX - #print_critical jenkins_jobs_$PREFIX + echo "jenkins_jobs_$PREFIX.draw $draw" + if [ "$draw" = "AREA" ] ; then draw=STACK ; fi done exit 0 fi |