The following commands can help quickly identify issues and check the agent is running normally.
/usr/share/python/sd-agent/agent.py info
This command will output useful information about the agent including file paths, system information, and information on installed plugins. Example output:
=================== Collector (v 2.2.0) =================== Status date: 2018-01-26 16:15:08 (58s ago) Pid: 2737 Platform: Linux-4.4.0-31-generic-i686-with-Ubuntu-14.04-trusty Python Version: 2.7.6, 32bit Logs: , /var/log/sd-agent/collector.log, syslog:/dev/log Clocks ====== NTP offset: -0.0053 s System UTC time: 2018-01-26 16:16:06.481758 Paths ===== conf.d: /etc/sd-agent/conf.d checks.d: /usr/share/python/sd-agent/checks.d Hostnames ========= socket-hostname: ubuntu hostname: ubuntu socket-fqdn: ubuntu Checks ====== sd_cpu_stats (2.2.0) -------------------- - instance #0 [OK] - Collected 20 metrics, 0 events & 0 service checks disk (2.2.0) ------------ - instance #0 [OK] - Collected 16 metrics, 0 events & 0 service checks network (2.2.0) --------------- - instance #0 [OK] - Collected 19 metrics, 0 events & 0 service checks Emitters ======== - http_emitter [OK]
/usr/share/python/sd-agent/agent.py configcheck
This will check the plugin yaml configuration files located at /etc/sd-agent/conf.d/
and will output any parsing errors. Example output:
rabbitmq.yaml is valid
dns_check.yaml is valid
mysql.yaml is valid
All yaml files passed. You can now run the ServerDensity agent.
/usr/share/python/sd-agent/agent.py check {checkname}
This will run the check standalone without running any other checks. Replace {checkname}
with the desired check or plugin. You can find individual commands for each plugin in it's respective doc. Example output:
2018-01-26 16:36:56,772 | INFO | sd.collector | config(config.py:1130) | initialized checks.d checks: ['dns_check', 'sd_cpu_stats', 'network', 'mysql', 'disk', 'rabbitmq'] 2018-01-26 16:36:56,773 | INFO | sd.collector | config(config.py:1131) | initialization failed checks.d checks: [] 2018-01-26 16:36:56,774 | INFO | sd.collector | checks.collector(collector.py:547) | Running check disk Metrics: [('system.fs.inodes.total', 1516984616, 589824L, {'device_name': '/', 'hostname': 'ubuntu', 'type': 'gauge'}), ('system.disk.free', 1516984616, 5102168.0, {'device_name': '/', 'hostname': 'ubuntu', 'type': 'gauge'}), ('system.fs.inodes.used', 1516984616, 484L, {'device_name': '/dev', 'hostname': 'ubuntu', 'type': 'gauge'}), ('system.disk.total', 1516984616, 501620.0, {'device_name': '/dev', 'hostname': 'ubuntu', 'type': 'gauge'})] Events: [] Service Checks: [] Service Metadata: [{}] disk (2.2.0) ------------ - instance #0 [OK] - Collected 16 metrics, 0 events & 0 service checks
/usr/share/python/sd-agent/agent.py jmx {option}
This command will execute various jmx actions based on the option provided. You can also specify a plugin to narrow the scope of the command, or run the command without specifying a plugin
Available options:
- list_matching_attributes [OPTIONAL: LIST OF CHECKS]: List attributes that match at least one of your instances configuration - list_limited_attributes [OPTIONAL: LIST OF CHECKS]: List attributes that do match one of your instances configuration but that are not being collected because it would exceed the number of metrics that can be collected - collect [OPTIONAL: LIST OF CHECKS]: Start the collection of metrics based on your current configuration and display them in the console - list_collected_attributes [OPTIONAL: LIST OF CHECKS]: List attributes that will actually be collected by your current instances configuration - list_not_matching_attributes [OPTIONAL: LIST OF CHECKS]: List attributes that don't match any of your instances configuration - list_everything [OPTIONAL: LIST OF CHECKS]: List every attributes available that has a type supported by JMXFetch
Example output of /usr/share/python/sd-agent/agent.py jmx list_matching_attributes solr
:
2018-01-26 17:02:21,232 | WARNING | sd.collector | jmxfetch(jmxfetch.py:393) | jmx doesn't have a 'conf' section. Only basic JVM metrics will be collected. See https://support.serverdensity.com/hc/en-us/articles/115014942368 for more information 2018-01-26 17:02:21,319 | INFO | sd.collector | jmxfetch(jmxfetch.py:239) | Starting jmxfetch: 2018-01-26 17:02:21,321 | INFO | sd.collector | jmxfetch(jmxfetch.py:296) | Running java -Xms50m -Xmx200m -classpath /usr/share/python/sd-agent/checks/libs/jmxfetch-0.15.0-jar-with-dependencies.jar org.datadog.jmxfetch.App --check solr.yaml --check_period 60000 --conf_directory /etc/sd-agent/conf.d --log_level INFO --log_location /var/log/sd-agent/jmxfetch.log --reporter console --status_location /tmp/jmx_status.yaml list_matching_attributes ##################################### Instance: localhost:3000 ##################################### Matching: 1/350. Bean name: java.lang:type=Threading - Attribute name: ThreadCount - Attribute type: int Matching: 2/350. Bean name: java.lang:type=GarbageCollector,name=ConcurrentMarkSweep - Attribute name: CollectionCount - Attribute type: long Matching: 3/350. Bean name: java.lang:type=GarbageCollector,name=ConcurrentMarkSweep - Attribute name: CollectionTime - Attribute type: long Matching: 4/350. Bean name: java.lang:type=GarbageCollector,name=ParNew - Attribute name: CollectionCount - Attribute type: long Matching: 5/350. Bean name: java.lang:type=GarbageCollector,name=ParNew - Attribute name: CollectionTime - Attribute type: long Matching: 9/350. Bean name: java.lang:type=Memory - Attribute name: HeapMemoryUsage - Attribute type: javax.management.openmbean.CompositeData Matching: 13/350. Bean name: java.lang:type=Memory - Attribute name: NonHeapMemoryUsage - Attribute type: javax.management.openmbean.CompositeData
Comments