huhouhua / jenkins-exporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jenkins Exporter

Build Status

Jenkins exporter is a exporter to get metrics of Jenkins server, deployed on FSOFT environment.

Jenkins exporter has written in python3. It's tested in Jenkins version 2.143 and 2.176.1.

Note: We used timestamp() in datetime library not supported by python2, so make sure running Jenkins exporter in python3 or newer

Usage:

You can download source code and build docker yourself, or use docker image we have built.

Step 1: Build image

docker build -t jenkins_exporter .

Step 2: Run Jenkins exporter

docker run -p 9145:9145 --name jenkins_exporter -d \
-e "JENKINS_SERVER=http://jenkins_server" \
-e "JENKINS_USERNAME=example" \
-e "JENKINS_PASSWORD=123456" jenkins_exporter

With:

  • JENKINS_SERVER: is the url of Jenkins
  • JENKINS_USERNAME: is the user of Jenkins who have permission to access Jenkins resource
  • JENKINS_PASSWORD: is the password of user.

Or using config file:

docker run -p 9145:9145 --name jenkins_exporter -d \
-v "/link/to/your/config/file.ini:/root/config.ini" \
jenkins_exporter

with config.ini:

JENKINS_SERVER=http://jenkins_server
JENKINS_USERNAME=example
JENKINS_PASSWORD=123456

About

License:Apache License 2.0


Languages

Language:Python 98.1%Language:Shell 1.4%Language:Dockerfile 0.6%