- Jenkins' Metrics Plugin
- A python script, which gets metrics from above plugin and transform it in a readable Zabbix item.
- A Zabbix Agentd config file which runs the above script and sends result to Zabbix server
- First install Jenkins' Metrics Plugin and create a access key.
- Put Jenkins’ URL and access key into
jenkins-metrics.py
- Move
jenkins-metrics.py
andjenkins_zabbix.conf
to Jenkins master instance. - Now take another look at Jenkins' Metrics Plugin to know more about these metrics and start creating items in Zabbix server
It simply uses Jenkins' Metrics Plugin’s API to get a Json containing metrics and transforms it in a more readable file to Zabbix.
However you can also make use of it without a Zabbix, like shown bellow:
python jenkins-metrics.py
This will return all the metrics at once. If you want to get just one of the metrics, use a full path to a metric item. For example, to get this metric
{
"gauges" : {
"jenkins.executor.count.value" : {
"value" : 52
},
...
You can type:
python jenkins-metrics.py gauges.jenkins.executor.count.value.value