[Jenkins] monitor free space on jenkins slave

Eyal Edri eedri at redhat.com
Tue Apr 17 15:01:16 UTC 2012


fyi,

Until we have a proper monitoring solution (nagios,etc..).
i added a new job to monitor jenkins slaves disk space and alert to infra at ovirt.org 
if one of the partitions of jenkins slave have is more than 90%.

http://jenkins.ovirt.org/view/system-monitoring/job/check_disk_space_on_jenkins_slaves/

maybe we can add this as a cron to other ovirt servers as well: (and move it to nagios when it's available)

#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
  echo $output
  usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1  )
  partition=$(echo $output | awk '{ print $2 }' )
  if [ $usep -ge 90 ]; then
    echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" 
    exit 1 (can be replaced with mutt/mail command)
  fi
done




More information about the Infra mailing list