forked from jmxtrans/jmxtrans
-
Notifications
You must be signed in to change notification settings - Fork 1
MoreExamples
rtoma edited this page Apr 8, 2013
·
5 revisions
Some sample JSON, to help you monitor quickly various metrics in :
- Sun/Oracle Hotspot heap, memory-pools, threads
- Apache Tomcat 6, 7 and JBoss App servers AJP/HTTP Pools and DataSources.
- In the following samples, JVM under monitoring is on an hypothetical machine named mysys.mydomain, where JMX is listening port on 8004.
- A Graphite server is installed on mygraphite.mydomain where its carbon-cache collect metrics on port 2003
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain"
}
} ],
"obj" : "java.lang:type=OperatingSystem",
"attr" : [ "SystemLoadAverage", "AvailableProcessors", "TotalPhysicalMemorySize",
"FreePhysicalMemorySize", "TotalSwapSpaceSize", "FreeSwapSpaceSize",
"OpenFileDescriptorCount", "MaxFileDescriptorCount" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain"
}
} ],
"obj" : "java.lang:type=Memory",
"resultAlias": "heap",
"attr" : [ "HeapMemoryUsage", "NonHeapMemoryUsage" ]
}, {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain"
}
} ],
"obj" : "java.lang:name=CMS Old Gen,type=MemoryPool",
"resultAlias": "cmsoldgen",
"attr" : [ "Usage" ]
}, {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "java.lang:type=GarbageCollector,name=*",
"resultAlias": "gc",
"attr" : [ "CollectionCount", "CollectionTime" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "java.lang:type=MemoryPool,name=*",
"resultAlias": "memorypool",
"attr" : [ "Usage" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain"
}
} ],
"obj" : "java.lang:type=Threading",
"resultAlias": "threads",
"attr" : [ "DaemonThreadCount", "PeakThreadCount", "ThreadCount", "TotalStartedThreadCount" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "jboss.web:type=ThreadPool,name=*",
"resultAlias": "connectors",
"attr" : [ "currentThreadCount", "currentThreadsBusy", "" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "jboss.web:type=GlobalRequestProcessor,name=*",
"resultAlias": "requests",
"attr" : [ "bytesReceived", "bytesSent", "errorCount", "maxTime", "processingTime", "requestCount" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "jboss.jca:service=ManagedConnectionPool,name=*",
"resultAlias": "datasources",
"attr" : [ "ConnectionCount", "ConnectionCreatedCount", "InUseConnectionCount",
"MaxConnectionsInUseCount", "AvailableConnectionCount" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"username" : "monitor",
"password" : "monitor!",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "Catalina:type=ThreadPool,name=*",
"resultAlias": "connectors",
"attr" : [ "currentThreadCount", "currentThreadsBusy", "" ]
} ],
"numQueryThreads" : 2
} ]
}
{
"servers": [
{
"numQueryThreads": 2,
"port" : "8004",
"host" : "mysys.mydomain",
"username" : "monitor",
"password" : "monitor!",
"queries": [
{
"outputWriters": [
{
"@class": "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings": {
"typeNames": [
"name"
],
"host": "mygraphite.mydomain",
"port": 2003
}
}
],
"resultAlias": "tomcat7-connectors",
"obj": "Catalina:type=ThreadPool,name=*",
"attr": [
"currentThreadCount",
"currentThreadsBusy"
]
},
{
"outputWriters": [
{
"@class": "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings": {
"typeNames": [
"name"
],
"host": "mygraphite.mydomain",
"port": 2003
}
}
],
"resultAlias": "tomcat7-requests",
"obj": "Catalina:type=GlobalRequestProcessor,name=*",
"attr": [
"bytesReceived",
"bytesSent",
"errorCount",
"processingTime",
"requestCount"
]
}
]
}
]
}
{
"servers" : [ {
"port" : "8004",
"host" : "mysys.mydomain",
"username" : "monitor",
"password" : "monitor!",
"queries" : [ {
"outputWriters" : [ {
"@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
"settings" : {
"port" : 2003,
"host" : "mygraphite.mydomain",
"typeNames" : [ "name" ]
}
} ],
"obj" : "Catalina:type=DataSource,class=javax.sql.DataSource,name=*",
"resultAlias": "datasources",
"attr" : [ "numActive", "numIdle" ]
} ],
"numQueryThreads" : 2
} ]
}
- Installation
- ChangeLog
- Queries
- ... MoreExamples
- ... YAMLConfig
- OutputWriters
- ... GangliaWriter
- ... GraphiteWriter
- ... KeyOutWriter
- ... MetricsdWriter
- ... OpenTSDBWriter
- ... RRDToolWriter
- ... RRDWriter
- ... StatsDWriter
- ... StdoutWriter
- ... TCollectorUDPWriter
- BestPractices