This commit is contained in:
geek 2017-09-12 18:46:46 +09:00
parent 87bd965376
commit 8ce0ab73ac
4 changed files with 13 additions and 13 deletions

View File

@ -81,8 +81,8 @@ public class JmxCrawler extends Crawler{
String port = config.getTarget().getConnection().getPort(); String port = config.getTarget().getConnection().getPort();
this.jmxUrl = "service:jmx:rmi:///jndi/rmi://" + hostIp + ":" +port + "/jmxrmi"; this.jmxUrl = "service:jmx:rmi:///jndi/rmi://" + hostIp + ":" +port + "/jmxrmi";
this.username = (String) config.getTarget().getAuth().get("username"); this.username = (String) config.getTarget().getAuth().get("id");
this.password = (String) config.getTarget().getAuth().get("password"); this.password = (String) config.getTarget().getAuth().get("pw");
// connection // connection
MBeanServerConnection beanCon; MBeanServerConnection beanCon;

View File

@ -25,7 +25,7 @@ public class AppTest {
ClassLoader classLoader = getClass().getClassLoader(); ClassLoader classLoader = getClass().getClassLoader();
URL url = classLoader.getResource("config/"); URL url = classLoader.getResource("config/");
String path = classLoader.getResource("config/example.json").getFile(); String path = classLoader.getResource("config/example1.json").getFile();
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
Config c = mapper.readValue(new File(path),Config.class); Config c = mapper.readValue(new File(path),Config.class);

View File

@ -8,7 +8,8 @@
"portType" : "tcp" "portType" : "tcp"
}, },
"auth" : { "auth" : {
"id": "jmxuser",
"pw": "tomcat"
} }
}, },
"schedule" : { "schedule" : {
@ -25,14 +26,13 @@
{"metric" : "net.connector[$0].loadOnStartup", "key" : "loadOnStartup"}, {"metric" : "net.connector[$0].loadOnStartup", "key" : "loadOnStartup"},
{"metric" : "net.connector[$0].errorCount", "key" : "errorCount"}, {"metric" : "net.connector[$0].errorCount", "key" : "errorCount"},
{"metric" : "net.connector[$0].objectName", "key" : "objectName"} {"metric" : "net.connector[$0].objectName", "key" : "objectName"}
], ],
"queryInfo" : { "queryInfo" : {
"query": "*Catalina:j2eeType=Servlet,*", "query": "*Catalina:j2eeType=Servlet,*",
"extend" : { "extend" : {
"aliases" : [ "aliases" : [
{ {
"key": "Catalina:j2eeType", "key": "WebModule",
"index":0 "index":0
} }
] ]

View File

@ -8,8 +8,8 @@
"portType" : "tcp" "portType" : "tcp"
}, },
"auth" : { "auth" : {
"username": "jmxuser", "id": "jmxuser",
"password": "tomcat" "pw": "tomcat"
} }
}, },
"schedule" : { "schedule" : {
@ -31,7 +31,7 @@
"extend" : { "extend" : {
"aliases" : [ "aliases" : [
{ {
"key": "Catalina:type", "key": "name",
"index":0 "index":0
} }
] ]
@ -55,7 +55,7 @@
"extend" : { "extend" : {
"aliases" : [ "aliases" : [
{ {
"key": "Catalina:type", "key": "WebModule",
"index":0 "index":0
} }
] ]
@ -76,7 +76,7 @@
"extend" : { "extend" : {
"aliases" : [ "aliases" : [
{ {
"key": "Catalina:j2eeType", "key": "name",
"index":0 "index":0
} }
] ]
@ -96,7 +96,7 @@
"extend" : { "extend" : {
"aliases" : [ "aliases" : [
{ {
"key": "Catalina:type", "key": "StringCache",
"index":0 "index":0
} }
] ]
@ -116,7 +116,7 @@
"extend" : { "extend" : {
"aliases" : [ "aliases" : [
{ {
"key": "Catalina:type", "key": "WebModule",
"index":0 "index":0
} }
] ]