Giter VIP home page Giter VIP logo

Comments (13)

ceharris avatar ceharris commented on June 12, 2024

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.

komcrad avatar komcrad commented on June 12, 2024

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.

komcrad avatar komcrad commented on June 12, 2024

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.

ceharris avatar ceharris commented on June 12, 2024

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.

ceharris avatar ceharris commented on June 12, 2024

Looks like the transport model configuration was discarded when UserTargetStrategy was created and separated from another class, a long time back.

from tnm4j.

komcrad avatar komcrad commented on June 12, 2024

Will maven central be updated with this patch?

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

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.

ceharris avatar ceharris commented on June 12, 2024

I'll update this issue when I do...

from tnm4j.

komcrad avatar komcrad commented on June 12, 2024

Perfect! Thanks for your help.

from tnm4j.

komcrad avatar komcrad commented on June 12, 2024

Could you deploy a .7 and then update dependencies in a .8 patch?

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

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.

ceharris avatar ceharris commented on June 12, 2024

I'm going to open a separate issue for updating dependencies.

from tnm4j.

komcrad avatar komcrad commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.