Comments (13)
I thought I had an example around for it, but I don't see it. I'll try to address that soon.
Here's something that should be pretty close. I don't have an SNMPv3 capable agent handy at the moment to try it myself.
public static void main(String[] args) throws Exception {
SimpleSnmpV3Target target = new SimpleSnmpV3Target();
target.setAddress(System.getProperty("tnm4j.agent.address", "10.0.0.1"));
target.setSecurityName(System.getProperty("tnm4j.agent.username", "manager"));
target.setAuthType(SnmpV3Target.AuthType.SHA);
target.setPrivType(SnmpV3Target.PrivType.AES128);
target.setAuthPassphrase(System.getProperty("tnm4j.agent.auth.password", "authpasswd"));
target.setPrivPassphrase(System.getProperty("tnm4j.agent.priv.password", "privpasswd"));
SnmpContext context = SnmpFactory.getInstance().newContext(target);
try {
VarbindCollection result = context.get("1.3.6.1.2.1.1.3.0").get();
System.out.println(result.get(0));
}
finally {
context.close();
}
}
I'm v
from tnm4j.
I have tried to use your rough draft and different iterations. I keep getting this;
Caused by: org.snmp4j.MessageException: Message processing model 3 returned error: Unsupported security model at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:506) at org.snmp4j.Snmp.sendMessage(Snmp.java:1004) at org.snmp4j.Snmp.send(Snmp.java:974) at org.soulwing.snmp.provider.snmp4j.SessionWrapper$AbstractRequest.send(SessionWrapper.java:200) at org.soulwing.snmp.provider.snmp4j.SessionWrapper$SynchronousRequest.get(SessionWrapper.java:250) at org.soulwing.snmp.provider.snmp4j.SessionWrapper.send(SessionWrapper.java:100) at org.soulwing.snmp.provider.snmp4j.SessionWrapper.send(SessionWrapper.java:88) at org.soulwing.snmp.provider.snmp4j.SessionWrapper.get(SessionWrapper.java:118) at org.soulwing.snmp.provider.snmp4j.GetOperation.doInvoke(GetOperation.java:48) at org.soulwing.snmp.provider.snmp4j.AbstractOperation.invoke(AbstractOperation.java:97) at org.soulwing.snmp.provider.snmp4j.Snmp4jContext.get(Snmp4jContext.java:215)
Does it give you any ideas?
from tnm4j.
I seemed to of gotten around the issue by modifying provider.snmp4j.UserTargetStrategy.
To get an idea of what I think the issue is, changes can be seen here:
komcrad@720560b
from tnm4j.
Looks reasonable. Make sure your changes use the same style (indents, etc) as the source you're changing, and submit a pull request. I'll merge it.
from tnm4j.
Looks like the transport model configuration was discarded when UserTargetStrategy
was created and separated from another class, a long time back.
from tnm4j.
Will maven central be updated with this patch?
from tnm4j.
Yes, but I need to update dependencies in the pom before I cut a new release, and didn't have time for that this morning.
from tnm4j.
I'll update this issue when I do...
from tnm4j.
Perfect! Thanks for your help.
from tnm4j.
Could you deploy a .7 and then update dependencies in a .8 patch?
from tnm4j.
Sorry for the delay in getting back to this. Had a death in our family. It wasn't unexpected, but more sudden than expected.
So I did a 1.0.7 release today. Should hit Maven Central in the next few hours.
from tnm4j.
I'm going to open a separate issue for updating dependencies.
from tnm4j.
My condolences.
I ended up deploying a fork. There's another patch I made that seems possibly toxic but it solved an issue I was having. I'll make a separate issue for that this week hopefully with a pull request.
from tnm4j.
Related Issues (20)
- OID to name resolution should find best match
- asyncwalk keeps retrying on TimeoutException HOT 2
- SNMP4J Provider support for SNMP V1 HOT 3
- Can't install with Maven HOT 4
- SNMPContext won't close. HOT 3
- SecurityProtocols.getInstance().addAuthenticationProtocol(new AuthSHA());
- SHA-256 AuthType support for SnmpV3 HOT 2
- Commercial license for tnm4j lib HOT 3
- Is this project still under development ? HOT 1
- Exposed to vulnerabilities ? HOT 1
- Update Depedencies HOT 3
- Unable to set authNoPriv security level HOT 2
- Utilize the repo to load Custom MIB file HOT 3
- java.lang.nosuchmethoderror While using in Apache NiFi HOT 9
- Update dependencies HOT 1
- Dependencies wont download. HOT 2
- pom.xml repository offline HOT 3
- Back to Apache License HOT 6
- SNMP Listener can not read trap from OIDs that are entries in a table HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tnm4j.