Skip to content

Instantly share code, notes, and snippets.

View olivielpeau's full-sized avatar

Olivier Vielpeau olivielpeau

View GitHub Profile
@olivielpeau
olivielpeau / README.md
Last active February 7, 2018 21:00
Run JMXFetch as a different user (to use AttachAPI for instance)

These instructions are known to work with version 5.10.1 of the packaged linux Datadog Agent

Using the AttachAPI can require running JMXFetch as the same user as the JVM you want to monitor.

To run JMXFetch as the jmv_user user (once you've identified which user your JVM is running as), please follow these steps:

  1. Make 2 changes on the /etc/dd-agent/supervisor.conf file: supervisord should be configured to run with user=root and jmxfetch with user=jvm_user. See lines 20 and 58 of the attached file below.
  2. Add jvm_user to the dd-agent group (on Debian distros: sudo usermod -G dd-agent jvm_user, on RHEL: sudo gpasswd -a jvm_user dd-agent)
  3. Grant the dd-agent group write access to the JMXFetch log file and the agent's run directory (/opt/datadog-agent/run/): sudo chmod -R g+w /var/log/datadog/jmxfetch.log /opt/datadog-agent/run/
@olivielpeau
olivielpeau / vsphere_metrics.txt
Last active February 18, 2016 00:17
vSphere extended metrics switched from `gauge` type to `rate` in 5.7.0
vsphere.cpu.capacity.contention
vsphere.cpu.capacity.demand
vsphere.cpu.capacity.usage
vsphere.cpu.coreUtilization
vsphere.cpu.corecount.contention
vsphere.cpu.demand
vsphere.cpu.totalmhz
vsphere.cpu.usage
vsphere.cpu.usagemhz
vsphere.cpu.utilization
@olivielpeau
olivielpeau / wmi_query.ps1
Created November 13, 2015 17:00
Running a wmi query from powershell
$query = "Select Name,PercentInterruptTime,Timestamp_Sys100NS,Frequency_Sys100NS from Win32_PerfRawData_PerfOS_Processor"
Get-WmiObject -Query $query
@olivielpeau
olivielpeau / 01-install-datadog-agent.config
Created November 12, 2015 22:34
Updating the Datadog agent hostname (on Elastic Beanstalk, Windows)
files:
"c:\\datadog\\ddagent-cli.msi":
source: https://s3.amazonaws.com/volusion-vnext-api-environment/ddagent-cli.msi
"c:\\init_scripts\\update_agent_hostname.ps1":
content: |
#stop DatadogAgent service
Stop-Service -Name DatadogAgent;
$hostname = Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/hostname
Add-Content C:\ProgramData\Datadog\datadog.conf "`rhostname: $hostname"
#start DatadogAgent service
@olivielpeau
olivielpeau / import_ssl.log
Created October 27, 2015 18:57
Error on startup of the Agent Application, MacOS
(pdb) import ssl
Oct 27 14:48:42 Agents-MacBook-Pro.local gui[46020] <Notice>: (Pdb) (Pdb) *** ImportError: dlopen(/Applications/Datadog Agent.app/Contents/Resources/lib/python2.7/lib-dynload/_ssl.so, 2): Library not loaded: @executable_path/../Frameworks/libssl.1.0.0.dylib
Oct 27 14:48:42 Agents-MacBook-Pro.local gui[46020] <Notice>: Referenced from: /Applications/Datadog Agent.app/Contents/Resources/lib/python2.7/lib-dynload/_ssl.so
Oct 27 14:48:42 Agents-MacBook-Pro.local gui[46020] <Notice>: Reason: no suitable image found. Did find:
Oct 27 14:48:42 Agents-MacBook-Pro.local gui[46020] <Notice>: /Applications/Datadog Agent.app/Contents/MacOS/../Frameworks/libssl.1.0.0.dylib: truncated mach-o error: segment __LINKEDIT extends to 378336 which is past end of file 367912
Oct 27 14:48:42 Agents-MacBook-Pro.local gui[46020] <Notice>: /Applications/Datadog Agent.app/Contents/MacOS/../Frameworks/libssl.1.0.0.dylib: truncated mach-o error: segment __LINKEDIT extends to 378336 which is past end of file 367912