Sysdig Application checks for Mesos / Marathon in DC/OS

NOTE: As of Sysdig agent version 0.50.0, the additional configuration steps described in this article are no longer necessary. This article is now an archival reference for the benefit of customers that still have this configuration. While the Agent remains backward-compatible with this type of configuration, as of version 0.50.0, the configuration necessary for Mesos/Marathon Application Checks now happens automatically. Therefore, customers that previously had configuration in dragent.yaml similar to what's described in this article are advised to remove it in favor of the new auto-config mode. Contact Sysdig support if you have questions about this change.


This guide addresses the additional configuration steps needed to allow the SysdigCloud agent to collect and report metrics for Mesos and Marathon master/slave nodes running in a DC/OS environment (1.7 or greater).

Both Master and Slave nodes require entries in the agent's configuration file, /opt/draios/etc/dragent.yaml, but the specific content will be different.

Mesos Master

Login to the mesos-master and create a file /var/tmp/dragent.yaml with the following content:
(replace values in red)

customerid: <Access Key>
tags: example_tag:example_value
app_checks:
- name: mesos-master
check_module: mesos_master
interval: 30
pattern:
comm: mesos-master
conf:
url: "http://<IP>:{port}"
- name: marathon
check_module: marathon
interval: 30
pattern:
arg: marathon.jar
conf:
url: "http://localhost:{port}"

Note: IP should be a host IP address and not localhost. Usually, this is the IP assigned to eth0 but interface name can vary.


Start the SysdigCloud agent with the following command:

docker run -d --name sysdig-agent --privileged --net host --pid host -v /var/tmp/dragent.yaml:/opt/draios/etc/dragent.yaml -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro sysdig/agent

 

Mesos-Slaves

A unique /var/tmp/dragent.yaml file needs to be created on every node in the cluster. There are many ways to do this, shown below is one method using a script to help automate the task:

1. On the master node create the file /tmp/dragent.yaml with the following content:

customerid: <Access Key>
tags: example_tag:example_value
app_checks:
  - name: mesos-slave
    check_module: mesos_slave
    pattern:
      comm: mesos-agent
    interval: 30
    conf:
      url: "http://REPLACEME:{port}"

 

2. Create the file /tmp/nodes with the list of all slave node IPs, for example:

10.0.6.74
10.0.2.190
10.0.2.192
10.0.2.193
10.0.2.194
 

 

3. Now, run the script below in your master's /tmp/nodes folder to copy (and customize) the dragent.yaml file to each slave node:

for i in $(cat /tmp/nodes ); do echo $i; scp -i /tmp/<your ssh key>.pem /tmp/dragent.yaml $i:/var/tmp/ ; ssh -i /tmp/<your ssh key>.pem $i "sed -ie 's/REPLACEME/'"${i}"'/g' /var/tmp/dragent.yaml"; done

 

4. In Marathon, scale sysdig-cloud to 0 and edit the configuration.

    a) Remove all environmental variables:

 

 

  b) In the Volumes section, add /opt/draios/etc/dragent.yaml and /var/tmp/dragent.yaml 

  

 

  c) Scale sysdig-cloud back to the number of nodes in your cluster.

 

You should now see Mesos master and slave metrics in your SysdigCloud account.

Have more questions? Submit a request