Skip to content

Instantly share code, notes, and snippets.

@smalleni
Created September 2, 2017 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smalleni/a53789003f71e4816695c4cac657761b to your computer and use it in GitHub Desktop.
Save smalleni/a53789003f71e4816695c4cac657761b to your computer and use it in GitHub Desktop.
Collectd Config for JMX
# Interval default is 10s
Interval 10
# Hostname for this machine, if not defined, use gethostname(2) system call
Hostname "overcloud-controller-0"
# Loaded Plugins:
LoadPlugin "logfile"
<Plugin "logfile">
File "/var/log/collectd.log"
LogLevel "info"
PrintSeverity true
Timestamp true
</Plugin>
LoadPlugin write_graphite
LoadPlugin unixsock
LoadPlugin java
# Open unix domain socket for collectdctl
<Plugin unixsock>
SocketFile "/var/run/collectd-unixsock"
SocketGroup "collectd"
SocketPerms "0770"
DeleteSocket true
</Plugin>
# Graphite Host Configuration
<Plugin write_graphite>
<Carbon>
Host "10.12.21.1"
Port "2003"
Prefix "odl-osp12-non-containerized."
Protocol "tcp"
LogSendErrors true
StoreRates true
AlwaysAppendDS false
EscapeCharacter "_"
</Carbon>
</Plugin>
<Plugin "java">
JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
LoadPlugin "org.collectd.java.GenericJMX"
<Plugin "GenericJMX">
<MBean "gc-count">
ObjectName "java.lang:type=GarbageCollector,*"
InstancePrefix "gc-"
InstanceFrom "name"
<Value>
Type "derive"
Table false
Attribute "CollectionCount"
InstancePrefix "count"
</Value>
</MBean>
<MBean "gc-time">
ObjectName "java.lang:type=GarbageCollector,*"
InstancePrefix "gc-"
InstanceFrom "name"
<Value>
Type "derive"
Table false
Attribute "CollectionTime"
InstancePrefix "time"
</Value>
</MBean>
<MBean "memory_pool">
ObjectName "java.lang:type=MemoryPool,*"
InstancePrefix "memory_pool-"
InstanceFrom "name"
<Value>
Type "memory"
Table true
Attribute "Usage"
</Value>
</MBean>
<MBean "memory-heap">
ObjectName "java.lang:type=Memory"
InstancePrefix "memory-heap"
<Value>
Type "memory"
Table true
Attribute "HeapMemoryUsage"
</Value>
</MBean>
<MBean "memory-nonheap">
ObjectName "java.lang:type=Memory"
InstancePrefix "memory-nonheap"
<Value>
Type "memory"
Table true
Attribute "NonHeapMemoryUsage"
</Value>
</MBean>
<MBean "thread">
ObjectName "java.lang:type=Threading"
InstancePrefix "threading"
<Value>
Type "gauge"
Table false
Attribute "ThreadCount"
InstancePrefix "count"
</Value>
</MBean>
<MBean "thread-daemon">
ObjectName "java.lang:type=Threading"
InstancePrefix "threading"
<Value>
Type "gauge"
Table false
Attribute "DaemonThreadCount"
InstancePrefix "count-daemon"
</Value>
</MBean>
<Connection>
ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root"
Collect "memory_pool"
Collect "memory-heap"
Collect "memory-nonheap"
Collect "gc-count"
Collect "gc-time"
Collect "thread"
Collect "thread-daemon"
User "karaf"
Password "karaf"
</Connection>
</Plugin>
</Plugin>
# Include other collectd configuration files
Include "/etc/collectd.d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment