Tuesday, July 15, 2014

An example to configure ganglia module (jenkins) thru puppet

This page is to illustrate to configure jenkins ganglia module (using standard ganglia puppet module available on puppetlab) via puppet


  • Copy ganalia.py in jenkins_ganglia_module/files/jenkins.py
  • You need to do soem changes in jenkins.py if python version <2 .6="" li="">


Here is jenkinsganglia.pp puppet file.

# puppet class jenkins_ganglia_module/manifests/jenkinsganglia.pp
class jenkins_ganglia_module::jenkinsganglia{

  file{

      '/usr/lib64/ganglia/python_modules/jenkins.py':
        ensure => file,
        owner  => 'root',
        group  => 'root',
        mode   => '0644',
        source => "puppet:///modules/jenkins_ganglia_module/jenkins.py",
        notify => Class['ganglia::gmond::service'];
  }

# create config file

    ganglia::gmond::module{ 'jenkins':
            language => 'python',
            params   => {
                base_url       => 'http://127.0.0.1:8080',
                username       => 'hudson',
                apitoken       => '123456123456123456123456'
            }
    }

    ganglia::gmond::collection_group { 'jenkins':
            collect         => 10,
            time_threshold  => 20
    }

    Ganglia::Gmond::Metric {
        collection_group => 'jenkins',
        value_threshold => 1.0
    }

    ganglia::gmond::metric {
        'jenkins_overallload_busy_executors':
            user_title => 'Number of busy executors on master and slaves';

        'jenkins_overallload_queue_length':
            user_title => 'Length of the queue on master and slaves';

        'jenkins_overallload_total_executors':
            user_title => 'Number of executors on master and slaves';

        'jenkins_jobs_total':
            user_title => 'Total number of jobs';

        'jenkins_jobs_blue':
            user_title => 'Number of jobs with status blue';

        'jenkins_jobs_red':
            user_title => 'Number of jobs with status red';

        'jenkins_jobs_yellow':
            user_title => 'Number of jobs with status yellow';

        'jenkins_jobs_grey':
            user_title => 'Number of jobs with status grey';

        'jenkins_jobs_aborted':
            user_title => 'Number of jobs with status aborted';

        'jenkins_jobs_notbuilt':
            user_title => 'Number of jobs with status notbuilt';

        'jenkins_jobs_disabled':
            user_title => 'Number of jobs with status disabled';
    }
}


  1. Check jenkins.conf in ganglia module.d  directory ( jenkins ganlia module configuration)
  2. Check jenkins.conf in ganglia configuration directory ( jenkins metrics configuration)
  3. Check jenkins.py in in ganlia python_module directory
  4. Run puppet agent and restart gmond if required

No comments:

Post a Comment