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();
this.jmxUrl = "service:jmx:rmi:///jndi/rmi://" + hostIp + ":" +port + "/jmxrmi";
this.username = (String) config.getTarget().getAuth().get("username");
this.password = (String) config.getTarget().getAuth().get("password");
this.username = (String) config.getTarget().getAuth().get("id");
this.password = (String) config.getTarget().getAuth().get("pw");
// connection
MBeanServerConnection beanCon;

View File

@ -25,7 +25,7 @@ public class AppTest {
ClassLoader classLoader = getClass().getClassLoader();
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();
Config c = mapper.readValue(new File(path),Config.class);

View File

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

View File

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