Load Impact's Open Source Server Monitoring Agents
Server Monitoring helps you to measure performance metrics from your own servers and integrates these metrics with the graphs generated from your Load Impact test.
Load Impact offers three options to monitor a system under test(SUT).
You can use:
- Our open source monitoring agents (described in this article)
- An Integration with New Relic
- Sending metrics from another APM via our Server Monitoring Agents (advanced)
These instructions, plus source code, are available on our GitHub Repo
In all cases, monitoring agents will provide you with additional context to monitor the system under test during a test. This allows you to make powerful correlations helping you identify performnace problems, faster.
If you wish to collect more specialized metrics than just the standard physical server metrics (i.e. CPU usage, memory, Disk I/O and Network I/O), our Server Monitoring Agents are also compatible with the Nagios plugin system. A tutorial on custom metrics with Server Monitoring agents is available here
Step 1: Download and install Server Monitoring Agent
The first step is to download the agent installer for your server platform. Download links can be found below.
The server monitoring agent requires Python 2.6+ and the module
psutil. Both Python and
psutil are bundled in the Windows installer, but on Ubuntu you may need to
apt-get install python-psutil
Packages/Installers: The latest installers/packages of our Server Monitoring Agents are found within our app here: Monitoring or by navigating to the integrations menu -> Server Agent (Login required).
Step 2: Generate a Server Monitoring Token
Below the packages, you can also generate your token:
You will use the same token for all Load Impact Monitoring Agents. You can re-generate a new token at any time if you believe it has been compromised or distributed to someone outside your company. Upon re-generation, the old token is no longer valid.
Step 3: Name your agents and give them access
During the installation of the server monitoring agent you will be asked to provide a name for the agent and the token. You should give it a contextual name to make it easier to identify it later on.
If you are using the python files to install your agent, please read README.md. You will need to set the name and token within the config file. Using our provided template, this can be found on lines 1-8 of li_metrics_agent.conf:
# Load Impact Server Metrics sample configuration file [General] # agent_name - hostname or any other identifier for this server, choose wisely agent_name = myagent # server_metrics_token - assigned to your account on loadimpact.com server_metrics_token = SERVER_METRICS_API_TOKEN
To ensure that the agents can connect, please allow outgoing port 443 against api.loadimpact.com in your firewall.
Step 4: Wait for check-in
Once installed, click “Check installation” within Load Impact. We will see if your agent has started communication with us.
Step 5: Configure your test to include the agents
Once the installation is complete, the server monitoring agent will start automatically and you will be able to select it on the test configuration page. You must specifically add the Server Monitoring Agent to any test you wish to collect these metrics for.
Refer to: Test Configuration for more details
Step 6: Review your Server Monitoring results
Once your test has started, you will be able to see your Server Monitoring results in real time. Scroll down below the main graph and “Add Visualization Widget” -> Select your monitoring agent. You can now plot your metrics on the main graph.
How do the Server Monitoring Agents communicate with Load Impact?
Load Impact servers never contact the server monitoring agents. It is the other way around - the agents contact Load Impact regularly. Since most firewalls allow outgoing HTTP connections, this generally ensures that the data can be sent to our servers. If you have outgoing firewall rules, please allow outgoing port 443 against api.loadimpact.com in your firewall.
The agents contact Load Impact every few minutes. If our system sees you are logged in to your Load Impact account we will tell the agents to start contacting us a little more frequently. This is to minimize the waiting time for tests to start with monitoring agents.
When a test is started with an agent configured, we will wait for that agent to contact us as described above. When it does - by sending us an HTTP request - we will respond to the agent to begin collecting data and sending it to us. This is considered active mode - collecting data and transmitting it to us continuously throughout the load test (using HTTP). When the test is complete, we will tell the agent to stop collecting data. When you logout from loadimpact.com, we will also tell the agent to contact us less frequently.
Note: On Windows Server you must make sure that the proper Truested Root CA Certificate (“GeoTrust Global CA”) is present in the Trusted Root Certificate Authorities. If you don’t have this root CA certificate you’ll see CERTIFICATE_VERIFY_FAILED errors in the Server Monitoring Agent log file. The needed root CA certificate can be downloaded from GeoTrust (from this page: https://www.geotrust.com/resources/root-certificates/), and installed by following these steps:
- Open Microsoft Management Console (Start -> Run -> mmc.exe)
- Choose File -> Add/Remove Snap-in
- In the Standalone tab, choose Add
- Choose the Certificates snap-in, and click Add
- In the wizard, choose the Computer Account, and then choose Local Computer. Press Finish to end the wizard
- Close the Add/Remove Snap-in dialog
- Navigate to Certificates (Local Computer)
- Right-click the Trusted Root Certification Authorities store and choose All Tasks -> Import
- Follow the wizard and provide the certificate file that you downloaded from GeoTrust
In a future version the Server Monitoring Agent will make an attempt to trigger an “Automatic Root Certificate Update” to download the needed root CA certificate, if the group policy hasn’t been turned off (Computer Settings / Administrative Templates / System / Internet Communication Management / Turn off Automatic Root Certificate Update), but in some environments this might not be possible due to firewall restrictions etc. In those cases the manual root CA certificate installation process described above will be necessary.
What are the default values returned for the metrics and can they be changed?
The default values reported back are as follows:
- Network - bps
- Disk- bps
- CPU - % of system-wide utilization
- Memory - % of utilization
- Our agents are also compatible with the Nagios plugin system if you wanted to send other metrics back during a test.
If you would like to configure custom metrics with our Monitoring Agents, please see this tutorial.
You can report back on different things that may be interesting for you. For example, packets/s for network performance or an individual CPU. You can change the defaults by opening the
li_metrics_agent.conf file in the install directory and making the necessary changes
My agent is not working! Help!
In the event that an agent takes too long to check-in, or just fails to report back information we recommend the following steps to troubleshoot:
- Ensure port 443 is open against api.loadimpact.com
- Restart the agent (because turning it off and on again works far too often with computers)
- Check the log file in the install folder (and send it to us if you need help.)