Issue in displaying Jenkins build data to influxDB - jenkins

I am facing some issues in fetching Jenkins build data into influxDB. Actually, the main requirement is to show Jenkins job build results on Grafana dashboard. So, I have created a Jenkins freestyle job and also installed influxDB plugin(1.17) and then I executed Windows batch command (as I am using a Windows 7 machine). it throws nullpointerexception. Please let me know what i need to do.
Images are given below.
configure InfluxDB details
Configure job
Build Configure Job
Build Outputlog

Related

Jenkins skip some jobs in chain of freestyle jobs

We got a requirement to implement CICD using Jenkins.
Here, Jenkins is running in windows machine and application server running in linux machine and build activity should happen in Linux system. So, We are connecting to linux machine using Jenkins's SSH plugin and executing jobs.
I have created list of freestyle jobs to checkout code from CVS, cleanup activity, Build , stop server, start server, Run Junit, run sonar. all these jobs are chained using 'build other projects' option in post build Action section.
Here, all jobs executes in sequential manner. But, sometimes I need to execute only few jobs like stop and start server.
So, please help me how we can randomly pick jobs which need to be run before triggering build.
Thanks,
Ganesha

Using ELK to get Jenkins build data from logs

I currently am using filebeat to ship my Jenkins build log from /var/log/jenkins.
I grok the build logs with Logstash so I can display the success/fail etc in Kibana and make some dashboard --> this is working well.
One thing I cannot seem to get is the total build times for the job as a whole.
I am using pipeline and multi pipeline build job types.
I can see the build stage time totals in the console logs but no matter the logging level I set globally for Jenkins, these do not display in the logs.
Has anyone managed to get this right?
Thanks
We have been using this Jenkins logstash-plugin https://wiki.jenkins.io/display/JENKINS/Logstash+Plugin
successfully to stash the data from Jenkins jobs to elasticsearch.
Supported indexers by this plugins are available in this link
https://wiki.jenkins.io/display/JENKINS/Logstash+Plugin#LogstashPlugin-IndexersCurrentlySupported
We are using the elasticsearch indexer which stashes the data directly to elasticsearch but if you want your data to go via logstash you can use Logstash indexer.
The payload format for the data is as below
https://wiki.jenkins.io/display/JENKINS/Logstash+Plugin#LogstashPlugin-JSONPayloadFormat

Output sonarqube result to different server locations

Is there a way to output SonarQube results to 2 different server locations through a Jenkins configuration, using a single Jenkins build for each SonarQube output?
I know Jenkins has a concept of parameterized build where the build could be parameterized by the Sonar Server name.
I guess that you are talking about the parameterized plugin:
https://wiki.jenkins.io/display/JENKINS/Parameterized+Trigger+Plugin
This plugin let you provide data when you trigger the build. This is a great plugin when your builds trigger each others, and you need data from a previous build executed on another slave.
If you want a single build, and the Sonar Server Name is determined inside the build, you will need to find your way using Shell.
Get it at some point:
SONAR_NAME=$( .... )
and re-use it within the same build:
ssh $SONAR_NAME#....

How to fetch Upstream build number in Jenkins 2.103

I tried installed Parameterized Build Plugin, but it doesn't shown in Jenkins Configure Page.
We are executing a Pipeline project with the script.
I am using Jenkins ver. 2.103.
I have two projects A and B.
A is parent project.
B is child project.
B needs A Last successful build number.
I have tried a couple of solutions on StackOverflow and other forums but no luck.
because I am using Jenkins Pipeline no plugins works for me .
I used Shell script to update latest succesful build number to a file and use the same in other job.
Share file data between jobs.

Jenkins Multi configuration job: Skip build step if slave is offline

I have created a Jenkins Multi configuration job that runs a build step on 5 windows slaves. Now if one of the slaves is offline (for some reason) the job is blocked until the slave(s) which is offline is put back online.
Is it possible to continue the build and simply skip the build step on the slave(s) that is offline?
Try using Elastic Axis plugin. Afer installing it, in the multi configuration job you can find new axis added as Elastic axis. You just need to provide the label of the node. The job will run on all the nodes with that label. There is a check box provided to skip the nodes that are offline.

Resources