Extracting Data from Jenkins API

The Jenkins XML API is very useful for automating tasks like this – if you simply append “/api/xml” to a Jenkins job URL, it will serve up an XML version – note there is also a JSON API and a CLI and plenty of other options, but I’m using what suits me.

The Jenkins XML API

For example, if you go to one of your Jenkins jobs and add /api/xml like this: “http://yourjenkinsserver:8080/job/yourjobname/api/xml”

That XML contains loads of very useful information inside handy XML tag descriptions – you just need a way to get at that data and then you can present it as you like…

In order to monitor Jenkins data we will need to extract needed information from The Jenkins XML API and load it into a datamart. Then we can run monitoring based on the data we loaded from the Jenkins CI server.