From 075deb383e9f2726f1803093a44f4108beabd6ca Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 10 Nov 2012 00:24:04 +0100 Subject: quite some munin plugin fixes --- etc/munin/plugins/jenkins_builds | 2 +- etc/munin/plugins/jenkins_builds_results | 5 +++-- etc/munin/plugins/jenkins_builds_running | 1 - etc/munin/plugins/jenkins_jobs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/munin/plugins/jenkins_builds b/etc/munin/plugins/jenkins_builds index 9cb2d2d8..c2d0fea6 100755 --- a/etc/munin/plugins/jenkins_builds +++ b/etc/munin/plugins/jenkins_builds @@ -48,6 +48,6 @@ if [ "$1" = "config" ]; then fi for PREFIX in $JOB_PREFIXES ; do - NR=$(find /var/lib/jenkins/jobs/$PREFIX*/builds/* -type d -mtime -1 | wc -l) + NR=$(find /var/lib/jenkins/jobs/$PREFIX*/builds/ -type d -mtime -1 -name "*_*"| wc -l) echo "jenkins_builds_$PREFIX.value $NR" done diff --git a/etc/munin/plugins/jenkins_builds_results b/etc/munin/plugins/jenkins_builds_results index ec299f4f..2dfb7310 100755 --- a/etc/munin/plugins/jenkins_builds_results +++ b/etc/munin/plugins/jenkins_builds_results @@ -50,8 +50,9 @@ if [ "$1" = "config" ]; then 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) + for STATE in success unstable failed ; do + NR=0 + NR=$( (for i in /var/lib/jenkins/jobs/${PREFIX}*/builds/*/log ; do tail -1 $i 2>/dev/null; done ) | grep -i -c $STATE) NR=$(echo "$NR/2"|bc) echo "jenkins_builds_results_${PREFIX}_${STATE}.value $NR" done diff --git a/etc/munin/plugins/jenkins_builds_running b/etc/munin/plugins/jenkins_builds_running index c4624473..4a211e79 100755 --- a/etc/munin/plugins/jenkins_builds_running +++ b/etc/munin/plugins/jenkins_builds_running @@ -29,7 +29,6 @@ if [ "$1" = "autoconf" ]; then exit 0 fi -JOB_PREFIXES=$(ls -1 /var/lib/jenkins/jobs/|cut -d "_" -f1|sort -u) if [ "$1" = "config" ]; then echo 'graph_title Jenkins Builds running' diff --git a/etc/munin/plugins/jenkins_jobs b/etc/munin/plugins/jenkins_jobs index 8502525c..6d2619c2 100755 --- a/etc/munin/plugins/jenkins_jobs +++ b/etc/munin/plugins/jenkins_jobs @@ -48,6 +48,6 @@ if [ "$1" = "config" ]; then fi for PREFIX in $JOB_PREFIXES ; do - NR=$(find /var/lib/jenkins/jobs/ -name "$PREFIX*" -type d | wc -l) + NR=$(find /var/lib/jenkins/jobs/ -maxdepth 1 -name "$PREFIX*" -type d | wc -l) echo "jenkins_jobs_$PREFIX.value $NR" done -- cgit v1.2.3-70-g09d2