summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/munin/plugins/jenkins_builds_results14
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/munin/plugins/jenkins_builds_results b/etc/munin/plugins/jenkins_builds_results
index 82b8ff73..ab36f1b2 100755
--- a/etc/munin/plugins/jenkins_builds_results
+++ b/etc/munin/plugins/jenkins_builds_results
@@ -40,7 +40,7 @@ if [ "$1" = "config" ]; then
echo 'graph_category jenkins'
draw=AREA
for PREFIX in $JOB_PREFIXES ; do
- for STATE in success unstable failed ; do
+ for STATE in success unstable failure ; 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
@@ -50,9 +50,15 @@ if [ "$1" = "config" ]; then
fi
for PREFIX in $JOB_PREFIXES ; do
- for STATE in success unstable failed ; do
+ PREFIX_RESULTS=$(for i in /var/lib/jenkins/jobs/${PREFIX}*/builds/*_*/log ; do tail -1 $i 2>/dev/null; echo " \n"; done )
+ for STATE in success unstable failure ; 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)
- echo "jenkins_builds_results_${PREFIX}_${STATE}.value $NR"
+ if [ "$STATE" = "failure" ] ; then
+ # count aborted as failed
+ NR=$(echo -e "$PREFIX_RESULTS" | egrep -i -c "($STATE|aborted)")
+ else
+ NR=$(echo -e "$PREFIX_RESULTS" | grep -i -c $STATE)
+ fi
+ echo "jenkins_builds_results_${PREFIX}_${STATE}.value $NR"
done
done