Perfino agent logging - perfino

Can the logger used by the perfino agent be configured? We would like to control the maximum size of the file.
Our agent is currently configured like so:
javaagent:/usr/local/lib/perfino/perfino.jar=server=perfino.env,name=${HSTNAMESHORT}-${APPNAME},group=${ENV}/${HSTNAMESHORT},logMBean=10,logFile=${LOG_DIR}/perfinologs/${HSTNAMESHORT}-${APPNAME}.log"
Thanks!

Related

How to configure TFS build agent with web proxy

We noticed that one of our task started failing with the following error after using a new proxy:
Error: connect ETIMEDOUT 102.33.19.18:443
If we remove the proxy, everything back to the track. However, we already configured proxy for our build agent.
Are there something special we missed?
When your self-hosted agent requires a web proxy, you can inform the agent about the proxy during configuration. This allows your agent to connect to Azure Pipelines or TFS through the proxy. This in turn allows the agent to get sources and download artifacts. Finally, it passes the proxy details through to tasks which also need proxy settings in order to reach the web.
To enable the agent to run behind a web proxy, pass --proxyurl, --proxyusername and --proxypassword during agent configuration.
For example:
./config.cmd --proxyurl http://127.0.0.1:8888 --proxyusername "myuser" --proxypassword "mypass"
Note: It applies to agent version 2.122 and newer. Do not forget to restart your agent and give it a try again.

Simple Jenkins notifications in a closed network?

We are a small development team (4 developers) with the following environment:
Windows 10 (64-bit)
Jenkins version 2.150.2
PCs connected through a CLOSED NETWORK (no Internet connections)
no email
We would like to use Jenkins notifications, so developers would be automatically notified for example when a build gets broken.
Jenkins Plugin Manager lists many (several tens) plugins under the section Build Notifiers, but we are not sure which one would be appropriate.
Something like Slack is not an option, because Slack servers are cloud-based and we have a closed network.
Something like Mattermost (a self-hosted alternative to Slack) would be overkill: requires Windows Server, MySQL, and what not (see https://docs.mattermost.com/install/prod-windows-2012.html).
Basically, we just need a small window to pop up on developers' screens when something goes wrong in Jenkins. What would be a simple way to achieve that?
You can add HipChat plugin assuming you can setup an internal HipChat server
HipChat Server Host: The hostname (and optionally the port number) for the HipChat server in use. Note that the server will always be accessed via HTTPS
And send notification to users
The HipChat Notification plugin provides the previously mentioned hipchatSend step that you can use in your pipeline. The only required (default) parameter is a message.
You can use AnyStatus to monitor Jenkins jobs and views.
AnyStatus is a desktop notifications app for Windows that helps developers keep track of services such as Jenkins, Azure DevOps, TeamCity, AppVeyor and more. AnyStatus will notify you when your Jenkins jobs start, complete or fail. It shows the progress of jobs while they are running and enables you to start or stop jobs remotely.
AnyStatus can also monitor other resources such as databases, network, web servers, computer resources and more. You can also develop your own plugins.
AnyStatus is a standalone application that can run in a closed network.
No server or internet connection is required.
Disclaimer: I am the author of AnyStatus.

Jenkins Dynamic Agents - Clone from VM conflicts with node/agents/labels

Is it possible to provision multiple vms from an agent template/snapshot and access them within a Jenkins job? Or does this limit have to be known ahead of time and each pre-provisioned and connected to Jenkins?
Reading the documentation on Distributed Builds and vsphere plugin I have this perception that I could have a template VM from which I dynamically provision as many clones as I need (limited by concurrent build limits) and connect and build on those - however when it comes to implementation I have two problems:
1) The agent tries to connect to the same nodes defined in /computer (cloning and have static ips so have lots of conflicts there)
2) If I name the vm clone as something else, the label is not recognized as a valid node (i.e. Clone from a VM attached as node 'Agent1' to 'Agent2' -- using the label 'Agent2' does not connect to the new vm since Agent2 is not a valid node)
You can have Jenkins create new nodes from a template and name them with an incrementing counter (i.e. prefix of 'WinAgent-' create 'WinAgent-1', W'WinAgent-2', etc and they show up as new nodes under the executors)
1) This is an issue of static IPs. Use VM configurations to change the IP or setup dhcp. Use the vm options to have Jenkins send in the name of the agent. For example, in esx use vmtoolsd --cmd "info-get guestinfo.SLAVE_JNLP_URL" Use a script to start the agent using the parameters from the vm options.
2) When setup in the vsphere cloud portion of 'Manage Jenkins > Configure System' the system will create a new node automatically. All you have to do in the script is use the configured label.

VSTS private agent does not removed

I was using vsts private agent vsts-agent-win7-x64-2.123.0.zip with my proj1 on Computer1 with agent name Computer1. After some period of time I removed a whole project from VSTS. Then I was trying to remove agent config like that 'config remove', but had got error
VS800075: The project with id 'd2df8515-d69b-4a5d-96bf-93872a837d25' does not exist, or you do not have permission to access it.
So I decided to setup agent without removing config. ofcause it wasn't succeed.
Then I installed new version of vsts private agent 'vsts-agent-win7-x64-2.126.0.zip'. It didn't help. Same errors with configuring and removing. After all of this I comletely delete all files in folder and install new agent. I register new agent with same name to new project proj2. Console output was succeed, service started, everything seemed to be ok. But agent didn't appear in VSTS after 30 minutes.
It was strange. I tried to remove agent again, but got this:
Сбой: Удаление агента с сервера
Moved Temporarily
Service has been deleted, but register agent still not available. It tells me to remove agent before.
Does anyone know how to delete agent and register it again in such situation?
In the agent folder, make sure you can see hidden files, delete the .agent and .credentialsfile, then call config remove again. This should remove the service from your local machine and will allow you to reconfigure the agent.
You can also extract the agent to a new folder and perform a clean installation after the service has been de-registered
If the agent is still registered int he agent pool, you can use the little X button to the right of the agent int he Agent Pool screen on VSTS (may need to maximize screen for it to become visible) to remove the agent from VSTS as well. be sure to remove it from the Agent Pool as removing jus from the Agent Queue will not delete the agent from the account completely.
If you go to settings of your account --> Agent Pools you can then view the configured agents per pool. Your private agent is probably in the Default pool if you didn't specify a custom pool. Behind the agent name is a X that you can use to remove the agent.
After successfully removing the agent, you can reinstall it on your local machine. Make sure to run your PowerShell window as an Administrator since that's required to configure a Windows Service.

Automatic jenkins master discovery and monitoring using nagios

I want a way to automatically discover Jenkins master servers and automatically monitor the health of the jobs on those Jenkins master servers so that I can look at a single console(using nagios host) to detect issues when a job is failing anywhere in integration.
Could someone help me out to finding Jenkins master servers using nagios?
There's a nagios plugin for retrieving job health information from Jenkins, but it looks like it requires manual configuration for each job, see Nagios Jenkins plugin.
I'm not familiar enough with nagios to know how any built-in auto-discovery works, but it looks like there are several example scripts (check_find_new_hosts and device discovery) for generating the necessary configuration from a network scan. You'll have to do some work to integrate the results of the scan into your nagios instance. (IIRC, you need to restart nagios after writing new configuration?)
To get the list of Jenkins servers, you can build on one of the existing network scan scripts for nagios. The script should scan an IP range and identify devices that respond to http://IP:8080/api/xml. The resulting XML document (JSON results are also supported) should contain a root tag named <hudson> (in my instance, maybe this will change to "jenkins" in a future release). If the server responds to this request, then you'll want your script to generate the nagios configuration for monitoring it.
In addition, the XML response will contain a list of jobs, like:
<job>
<name>My Job</name>
<url>http://jenkins:8080/job/My%20job/</url>
<color>blue</color>
</job>
By iterating through this list, you get the job names, job urls (for more details or polling for status), and the current statuses (blue means success). This list of jobs can provide input to the Nagios Jenkins plugin configuration.
The Jenkins Remote API is documented on your Jenkins instance, just go to http://jenkins:8080/api.

Resources