Chef Agent Install
Thomas Steele avatar
Written by Thomas Steele
Updated over a week ago

Installing the Linux agent via Chef enables Blue Matador to collect and analyze server metrics on any 64-bit Linux-based operating system running Chef. After installation, the following events will be detected on your servers without configuring any thresholds:

  • CPU Anomalies

  • Disk Inodes & Space

  • Open Files & Threads Ulimit

  • Swapping

  • Server Time Drift

  • Server Unresponsive

Requirements

Installing the Blue Matador Linux Agent via Chef requires either an active trial or paid account. Contact sales to get started.  You will also need to meet the following requirements:

  • 64-bit Linux installed on the target servers

  • Chef version 12.1 or higher

  • The server must have egress (outbound) internet access to download and install packages

  • The ability to trigger a chef run on the target servers

Installation Process

The installation process is easiest when using Berkshelf, knife, or git submodules.

1. Log in to the app and navigate to the Integrations page via Setup > Integrations

2. Expand the Chef installation dialog by clicking on the Install button on the Chef tile

3. Install the cookbook

a. If you are using Berkshelf, add our cookbook to your Berksfile

cookbook 'bluematador_agent' 

b. If you are using knife, you can install our cookbook from the Chef Supermarket

knife cookbook site install bluematador_agent 

c. Otherwise you can clone our repo into your cookbooks directory

git clone https://github.com/bluematador/chef-bluematador

4. Specify the environment your agent will run in. This will help you identify servers in our system.

5. Set the node attributes from the Blue Matador UI in either the environment file, data bag, or node attributes. Then, add the bluematador_agent recipe to your server’s run list.

6. Upload the cookbook and your updated roles using either berks or knife

a. If using berks

berks upload

b. If using knife

knife cookbook upload bluematador_agent 

7. Run chef-client on at least one server so you can verify the installation

Troubleshooting

 If you are unable to verify that the agent is connected, first check out the agent log on the server. The default logging level only shows FATAL and ERROR level log messages, so it is normal for there to be no log messages if the agent is running properly.

tail -n 100 -f /var/log/bluematador-agent.log 

If there are messages in the log that indicate an issue on Blue Matador’s side, try restarting the agent, then checking the Atlas page to see if that server appears.

sudo service bluematador-agent restart 

Or

sudo systemctl restart bluematador-agent 

Or

sudo /etc/init.d/bluematador-agent restart  

Verbose Logging

If you are still having issues getting the agent to connect, you can increase the log level to prepare logs to submit to your account manager for support. 

On systems using systemd, template the /etc/systemd/system/bluematador-agent.service file and replace the following line

ExecStart=/usr/sbin/bluematador-agent -log /var/log/bluematador-agent.log -verbose 2 -config /etc/bluematador-agent/config.ini -datadir /var/lib/bluematador-agent 

With

ExecStart=/usr/sbin/bluematador-agent -log /var/log/bluematador-agent.log -verbose 5 -config /etc/bluematador-agent/config.ini -datadir /var/lib/bluematador-agent 

Then run chef-client to update the file and restart the agent. 

On upstart-based systems, template the /etc/init.d/bluematador-agent file and replace all instances of -verbose "${VERBOSITY}" with -verbose  5 then run chef-client to update the file and restart the agent.

Network Issues

In order for the agent to connect to Blue Matador’s servers, ensure it has outgoing network connectivity to app.bluematador.com:443 and bluematador-flint-modules.s3.amazonaws.com:443.

If you are running the agent behind a proxy, follow this guide to set the HTTP_PROXY and HTTPS_PROXY environment variables in the systemd config located at /etc/systemd/system/bluematdor-agent.service as a Chef template, then run chef-client to update the file and restart the agent.

Proxy Setup

You may configure the Linux agent to connect to Blue Matador's servers via an HTTP proxy. To do this, add the following lines to your attributes file, replacing the example http proxy endpoint with your proxy's endpoint.

default['bluematador_agent']['http_proxy'] = 'http://myproxy.example.co:3128'
default['bluematador_agent']['https_proxy'] = 'http://myproxy.example.co:3128'

After updating the config file, make sure your proxy has whitelisted traffic to app.bluematador.com:443 and bluematador-flint-modules.s3.amazonaws.com:443, then run Chef.

Frequently Asked Questions

Does the Linux agent run on 32-bit Linux? The Blue Matador Linux agent does not currently support 32-bit architectures.

Do I need to install the Linux agent on every server? The linux agent can and should be installed on any servers that you need automatic server monitoring on. This includes production servers, utility servers, databases, and dev servers. The agent only collects metrics from the servers it is running on.

Should I install the Linux agent if I am using the AWS integration with EC2 Instances? While the AWS integration collects many EC2 metrics, the Linux agent still provides value on top of that. Some server metrics such as disk usage, process ulimits, and server time drift cannot be collected from AWS.

Should I install the Linux agent on a Kubernetes node? The preferred method of monitoring Kubernetes is to install the Blue Matador agent as a DaemonSet in your Kubernetes cluster. Installing the Linux agent directly on a node will not provide any Kubernetes events, but will still provide the Linux server events. Using both installations simultaneously can result in duplicate events.  

Does the Linux agent installed via Chef monitor Chef Server? The Linux agent will monitor the underlying server but does not do any metric collection for Chef Server, or any Chef Client runs on the server.

I have an issue with the Chef cookbook, how do I report it? The chef cookbook is open source and the best way to report issues and contribute is via github.

 

Did this answer your question?