Skip to content

Commit

Permalink
Merge pull request #1 from kelwang/jenkins-gollar-changes
Browse files Browse the repository at this point in the history
Jenkins gollar changes
  • Loading branch information
kelwang authored Jun 26, 2018
2 parents 23523ff + 4ec7999 commit 8ff50e4
Show file tree
Hide file tree
Showing 7 changed files with 1,171 additions and 1 deletion.
Empty file added Godeps
Empty file.
8 changes: 7 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
name = "github.com/kballard/go-shellquote"
branch = "master"

[[constraint]]
name = "github.com/kelwang/gojenkins"
version = "=v1.0.1"

[[constraint]]
name = "github.com/matttproud/golang_protobuf_extensions"
version = "1.0.1"
Expand Down
1 change: 1 addition & 0 deletions plugins/inputs/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
_ "github.com/influxdata/telegraf/plugins/inputs/ipmi_sensor"
_ "github.com/influxdata/telegraf/plugins/inputs/ipset"
_ "github.com/influxdata/telegraf/plugins/inputs/iptables"
_ "github.com/influxdata/telegraf/plugins/inputs/jenkins"
_ "github.com/influxdata/telegraf/plugins/inputs/jolokia"
_ "github.com/influxdata/telegraf/plugins/inputs/jolokia2"
_ "github.com/influxdata/telegraf/plugins/inputs/jti_openconfig_telemetry"
Expand Down
79 changes: 79 additions & 0 deletions plugins/inputs/jenkins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Jenkins Plugin

The jenkins plugin gathers information about the nodes and jobs running in a jenkins instance.

This plugin does not require a plugin on jenkins and it makes use of Jenkins API to retrieve all the information needed.

### Configuration:

```toml
url = "http://my-jenkins-instance:8080"
# username = "admin"
# password = "admin"
## Set response_timeout
response_timeout = "5s"

## Optional SSL Config
# ssl_ca = /path/to/cafile
# ssl_cert = /path/to/certfile
# ssl_key = /path/to/keyfile
## Use SSL but skip chain & host verification
# insecure_skip_verify = false

## Job & build filter
# max_build_age = "1h"
## jenkins can have unlimited layer of sub jobs
## this config will limit the layers of pull, default value 0 means
## unlimited pulling until no more sub jobs
# max_subjob_depth = 0
## in workflow-multibranch-plugin, each branch will be created as a sub job
## this config will limit to call only the lasted branches
## sub jobs fetch in each layer
# empty will use default value 10
# max_subjob_per_layer = 10
# job_exclude = [ "job1", "job2/subjob1/subjob2", "job3/*"]

## Node filter
# node_exclude = [ "node1", "node2" ]

## Woker pool for jenkins plugin only
# empty this field will use default value 30
# max_connections = 30
```

### Measurements & Fields:

- jenkins_node
- disk_available
- temp_available
- memory_available
- memory_total
- swap_available
- swap_total
- response_time

- jenkins_job
- duration
- result_code (0 = SUCCESS, 1 = FAILURE, 2 = NOT_BUILD, 3 = UNSTABLE, 4 = ABORTED)

### Tags:

- jenkins_node
- arch
- disk_path
- temp_path
- node_name
- status ("online", "offline")

- jenkins_job
- job_name
- result

### Example Output:

```
$ ./telegraf --config telegraf.conf --input-filter jenkins --test
jenkins_node,arch=Linux\ (amd64),disk_path=/var/jenkins_home,temp_path=/tmp,host=myhost,node_name=master swap_total=4294963200,memory_available=586711040,memory_total=6089498624,status=online,response_time=1000i,disk_available=152392036352,temp_available=152392036352,swap_available=3503263744 1516031535000000000
jenkins_job,host=myhost,job_name=JOB1,result=SUCCESS duration=2831i,result_code=0i 1516026630000000000
jenkins_job,host=myhost,job_name=JOB2,result=SUCCESS duration=2285i,result_code=0i 1516027230000000000
```
Loading

0 comments on commit 8ff50e4

Please sign in to comment.