Comment 1 for bug 929021

Revision history for this message
Bhuvan Arumugam (bhuvan) wrote : Re: available slave count should be monitored with alerts

Monty, as you may know, Jenkins has support for api, we may extract status of each slave by appending "api/" to each url. For example, to get list of all slaves, we may use following url:
  * JSON format: https://jenkins.openstack.org/computer/api/json
  * XML format: https://jenkins.openstack.org/computer/api/xml

We may then scan through each slave and identify the number of executors idle. If they fell below the threshold limit (default: 5), we'll raise a warning.

I wish to write a (python) script to perform these tasks. Could you please clarify following doubts?
  1) Do we simply throw a warning message, or should we send an alert to specified email address?
  2) How do we execute the script? on-demand from command line, or another jenkins jobs?
  3) Where do i commit the script? openstack-ci repository, or elsewhere?

OTOH, Jenkins also has native python api to interact with Jenkins system, jenkinsapi. I'd believe, it's a overkill to use it to perform desired operation.
  http://pypi.python.org/pypi/jenkinsapi