test
This commit is contained in:
parent
53d3c7156b
commit
3201bf605c
8
pom.xml
8
pom.xml
|
@ -10,11 +10,11 @@
|
||||||
<version>1.0.0-RELEASE</version>
|
<version>1.0.0-RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>com.loafle</groupId>
|
<groupId>com.loafle.overflow</groupId>
|
||||||
<artifactId>snmp_crawler</artifactId>
|
<artifactId>crawler.snmp</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<name>com.loafle.snmp_crawler</name>
|
<name>com.loafle.overflow.crawler.snmp</name>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- https://mvnrepository.com/artifact/org.snmp4j/snmp4j -->
|
<!-- https://mvnrepository.com/artifact/org.snmp4j/snmp4j -->
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.loafle</groupId>
|
<groupId>com.loafle.overflow</groupId>
|
||||||
<artifactId>crawler_java</artifactId>
|
<artifactId>crawler_java</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="Maven: org.snmp4j:snmp4j:2.5.0" level="project" />
|
<orderEntry type="library" name="Maven: org.snmp4j:snmp4j:2.5.0" level="project" />
|
||||||
<orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
|
<orderEntry type="library" name="Maven: log4j:log4j:1.2.14" level="project" />
|
||||||
<orderEntry type="library" name="Maven: com.loafle:crawler_java:1.0.0-SNAPSHOT" level="project" />
|
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_java:1.0.0-SNAPSHOT" level="project" />
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.13" level="project" />
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.13" level="project" />
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.loafle.overflow.crawler;
|
package com.loafle.overflow.crawler.snmp;
|
||||||
|
|
||||||
|
import com.loafle.overflow.crawler.Crawler;
|
||||||
|
import com.loafle.overflow.crawler.snmp.version.SNMPv2c;
|
||||||
|
import com.loafle.overflow.crawler.snmp.version.SNMPv3;
|
||||||
import org.snmp4j.Snmp;
|
import org.snmp4j.Snmp;
|
||||||
import org.snmp4j.TransportMapping;
|
import org.snmp4j.TransportMapping;
|
||||||
import org.snmp4j.smi.Address;
|
import org.snmp4j.smi.Address;
|
||||||
|
@ -36,7 +39,7 @@ public class SNMPCrawler extends Crawler {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object get(String id) {
|
protected Object getInternal(Map<String, Object> config) {
|
||||||
//return getByV2c(MethodType.VALIDATE, null);
|
//return getByV2c(MethodType.VALIDATE, null);
|
||||||
//return getByV2c(MethodType.GET, new String[]{"1.3.6.1.2.1.1.5.0", "1.3.6.1.2.1.2.2.1.6.2"});
|
//return getByV2c(MethodType.GET, new String[]{"1.3.6.1.2.1.1.5.0", "1.3.6.1.2.1.2.2.1.6.2"});
|
||||||
return getByV2c(MethodType.WALK, new String[]{"1.3.6.1.2.1.25.2.3.1.3"});
|
return getByV2c(MethodType.WALK, new String[]{"1.3.6.1.2.1.25.2.3.1.3"});
|
|
@ -1,4 +1,4 @@
|
||||||
package com.loafle.overflow.crawler;
|
package com.loafle.overflow.crawler.snmp.version;
|
||||||
|
|
||||||
import org.snmp4j.PDU;
|
import org.snmp4j.PDU;
|
||||||
import org.snmp4j.Snmp;
|
import org.snmp4j.Snmp;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.loafle.overflow.crawler;
|
package com.loafle.overflow.crawler.snmp.version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by insanity on 17. 4. 7.
|
* Created by insanity on 17. 4. 7.
|
|
@ -1,4 +1,4 @@
|
||||||
package com.loafle.overflow.crawler;
|
package com.loafle.overflow.crawler.snmp.version;
|
||||||
|
|
||||||
import org.snmp4j.*;
|
import org.snmp4j.*;
|
||||||
import org.snmp4j.mp.MPv3;
|
import org.snmp4j.mp.MPv3;
|
|
@ -2,7 +2,7 @@
|
||||||
package com.loafle;
|
package com.loafle;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import com.loafle.overflow.crawler.SNMPCrawler;
|
import com.loafle.overflow.crawler.snmp.SNMPCrawler;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user