Giter Site home page Giter Site logo

snmpv3's People

Contributors

lahell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

snmpv3's Issues

Exception calling "BulkWalk" with "11" argument(s): "Request timed out after 3000-ms."

Exception calling "BulkWalk" with "11" argument(s): "Request timed out after 3000-ms."
At C:\Program Files\WindowsPowerShell\Modules\SNMPv3\1.1.2\Public\Invoke-SNMPv3Walk.ps1:139
char:5

  • [Lextm.SharpSnmpLib.Messaging.Messenger]::BulkWalk(
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : TimeoutException

image

It seems to work for short invokes, but I'm doing about 100+ invoke-snmpv3walk

SHould I be placing a pause in between the invokes?

Unable to use ip addresses

Hi, when i want to use ip addresses instead of hostnames, i receive the message unknown host. when i use the hostname (which contains the same ip address) everything is going fine. Is this something that you can fix?

Thank you in advance!

Best regards,

Remon Willems

Not working with IP
Working

Problem with octetstring encoding

Good day!
Faced with trouble walk or get oids like ipNetToMediaPhysAddress (1.3.6.1.2.1.4.22.1.2) expecting raw value data, but getting value like ?#?f?? that looks like ASCII encoding substitutes characters outside its valid range with a question mark "?"

Some OctetString string incorrectly decoded?

For OctetString values containing plain text correct output is shown:

PS C:\Users\Administrator> Invoke-SNMPv3Walk @walkRequest -OID 1.3.6.1.2.1.31.1.1.1.1

Node        OID                              Type Value
----        ---                              ---- -----
172.16.22.1 1.3.6.1.2.1.31.1.1.1.1.1  OctetString mgmt
172.16.22.1 1.3.6.1.2.1.31.1.1.1.1.2  OctetString ha
172.16.22.1 1.3.6.1.2.1.31.1.1.1.1.3  OctetString port1

But for OctetString values containing MAC addresses incorrect output is shown:

PS C:\Users\Administrator> Invoke-SNMPv3Walk @walkRequest -OID 1.3.6.1.2.1.4.22.1.2

Node        OID                                          Type Value
----        ---                                          ---- -----
172.16.22.1 1.3.6.1.2.1.4.22.1.2.1.172.16.22.2    OctetString  PV?�/
172.16.22.1 1.3.6.1.2.1.4.22.1.2.2.169.254.0.1    OctetString ?q.Bv4

PS C:\Users\Administrator> Invoke-SNMPv3Walk @walkRequest -OID 1.3.6.1.2.1.4.22.1.2

Node        OID                                         Type Value
----        ---                                         ---- -----
172.16.22.4 1.3.6.1.2.1.4.22.1.2.78.172.16.22.1  OctetString    �       ��
172.16.22.4 1.3.6.1.2.1.4.22.1.2.78.172.16.22.2  OctetString  PV?�/

Is it a bug or is it by design?

NotInTimeWindow after second GetResponse with authentication

While using authentication, the second send of GetResponse just do exactly the same whereas this should set in parameters "msgAuthoritativeEngineBoots" and "msgAuthoritativeEngineTime".

The second send should use the last report, the one returned by the the first GetResponse.
So your code is good, there's just a little mistake.

At this line:

It should be "$Reply", not "$Report"

Since the reply has been identified as a Report:

if ($Reply -is [Lextm.SharpSnmpLib.Messaging.ReportMessage])

we should use this newer report stored in $Reply

SNMPv3Set value type OctectStrings missing

Hello,

When polling a value, i often get an OctetString value back:

Node         OID                                Type Value
----         ---                                ---- -----
11.11.11.11  1.3.6.1.4.1.45391.1.1.1.2.0 OctetString GA1049

When I try to overwrite that value, the OctetString type is not available in choices:
image

Trying to push that value as string does not yield any error, but the device does not change the value (although that OID is writable).

$siteid = [Lextm.SharpSnmpLib.OctetString]::new('XY999') does not do the trick either.

Am I missing something? If not, would it be possible to add the OctetString type to the list?

Thanks :)

Catch exceptions for authentication failure?

Is there anyway to record auth failures? Id like to script a conditional statement for handling failures or successes, but it doesnt seem this can be easily stored in a variable, and the "Warning message" that gets written to the console doesnt log an entry in $error. Any ideas?

Exception calling "BulkWalk" with "11" argument(s): "Value cannot be null.

PS C:\Users\me\Desktop>> $WalkRequest = @{
    UserName   = 'myuser
    Target     = '10.52.42.15'
    OID        = '1.3.6.1.2.1.1'
    AuthType   = 'SHA1'
    AuthSecret = 'abcdefg
    PrivType   = 'AES128'
    PrivSecret = 'hijklmnop'
}

Invoke-SNMPv3Walk @WalkRequest
Exception calling "GetResponse" with "2" argument(s): "Request timed out after 3000-ms."
At C:\Program Files\WindowsPowerShell\Modules\SNMPv3\1.1.2\Public\Invoke-SNMPv3Walk.ps1:135 char:5
+     $Report = $Discovery.GetResponse($Timeout, $IPEndPoint)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TimeoutException
 
Exception calling "BulkWalk" with "11" argument(s): "Value cannot be null.
Parameter name: report"
At C:\Program Files\WindowsPowerShell\Modules\SNMPv3\1.1.2\Public\Invoke-SNMPv3Walk.ps1:139 char:5
+     [Lextm.SharpSnmpLib.Messaging.Messenger]::BulkWalk(
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException

Whatever I do. Either walk or get the same "bulk" error appears.

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.