In previous blog, I have written how to install latest Hygieia Dashboard in centos 7.6 and in this blog I will cover how to deploy Hygieia collectors.

What is Hygieia collectors?

It collects the data from various DevOps tools and display the metrics in Hygieia Dashboard.For each DevOps tool we need to build different collectors. For eg.  To display the Metrics of Jenkins, we need to build Hygieia Jenkins collector, similarly for other tools as well.

This Link has the list of collectors are available for Hygieia Dashboard, https://hygieia.github.io/Hygieia/widget_view.html

In this blog am going to cover Hygieia Jenkins collector building ,configuration and configure in Hygieia Dashboard.

Hygieia Jenkins Collector :

Requirement :
OS : centos 7.6
Hygieia Dashboard version : v3.1.0

To install Hygieia dashboard follow this link, https://www.devopsart.com/2019/09/step-by-step-installation-of-hygieia.html

1.Create collectors directory,clone the collector repo and build it,

#cd /opt/hygieia

#mkdir collectors

#cd collectors

#git clone https://github.com/Hygieia/hygieia-build-jenkins-collector.git

#cd hygieia-build-jenkins-collector

#mvn install

2.After successful maven build, go to target directory and you can see  jenkins-build-collector-x.x.x.jar will be generated.

3.Create properties file in same target directory with the required details,

#vi jenkins.properties

auth.expirationTime=1200000
# Database Name
dbname=dashboarddb

# Database HostName - default is localhost
dbhost=localhost

# Database Port - default is 27017
dbport=27017

# MongoDB replicaset
dbreplicaset=false
#dbhostport=[host1:port1,host2:port2,host3:port3]

# Database Username - default is blank
dbusername=dashboarduser

# Database Password - default is blank
dbpassword=dbpassword

# Collector schedule (required)
jenkins.cron=0/5 * * * * *

# The page size
jenkins.pageSize=1000

# The folder depth - default is 10
jenkins.folderDepth=10

# Jenkins server (required) - Can provide multiple
jenkins.servers[0]=http://192.168.56.101:8080

# If using username/token for API authentication
# (required for Cloudbees Jenkins Ops Center) For example,
jenkins.servers[1]=http://admin:11e275754565f45549201d61afbe51f36c@192.168.56.101:8080

# Another option: If using same username/password Jenkins auth,
# set username/apiKey to use HTTP Basic Auth (blank=no auth)
jenkins.usernames[0]=admin
jenkins.apiKeys[0]=11e275754565f45549201d61afbe51f36c

# Determines if build console log is collected - defaults to false
jenkins.saveLog=true

# Search criteria enabled via properties (max search criteria = 2)
jenkins.searchFields[0]= uaty
jenkins.searchFields[1]= dev

# Timeout values
jenkins.connectTimeout=20000
jenkins.readTimeout=20000

save and close the file.

Here am using the same mongo db credentials which I have used in Hygieia dashboard api properties.Then update the jenkins details.

4.Deploy the jar file.

#cd /opt/hygieia/collectors/hygieia-build-jenkins-collector/target

#java -jar jenkins-build-collector-x.x.x.jar  --spring.config.name=jenkins --spring.config.location=/opt/hygieia/collectors/hygieia-build-jenkins-collector/target/jenkins.properties  -Djasypt.encryptor.password=hygieiasecret

Once its ran successfully, you will get output like below,




5.Now login to Hygieia Dashboard and create a dashoard.


6.Next in widget management choose "Build"  widget and click create.

7.Once the dashboard is created we need to configure the widget to choose which jenkins jobs metrics we need to see in dashboard.

A successful jenkins collector will show the Jenkins jobs like below in the widget configuration,



Choose the required Job and submit it.

Now wait for few minutes to view the Jenkins metrices in Hygieia Dashboard, then we can see the metrices like below,


Thats all, Hygieia Jenkins collector is successfully build and configured in Hygieia Dashboard. Similar way we need to follow above steps for other collectors.

Here is my Hygieia Dashboard which has Jenkins ,Sonar, Cucumber and Gitlab collectors.



1 Comments

  1. Thnaks Prabhu. I am unable to get a successful deploy widgets though pipeline job is working fine for me. I am using hygieia-jenkins-publisher plugin. Can you help me wth that

    ReplyDelete

Post a Comment

Previous Post Next Post