Quantcast
Channel: C# Based Open Source SNMP Library for .NET and Mono
Viewing all 576 articles
Browse latest View live

New Post: Set Context Name v3

$
0
0
You will have to manually construct the SNMP v3 message via a constructor such as
public GetRequestMessage(VersionCode version, int messageId, int requestId, OctetString userName, IList<Variable> variables, IPrivacyProvider privacy, int maxMessageSize, ISnmpMessage report)
The context name can be passed via the report message. Or you can make the internal constructor public so as to fully construct the message from scratch.
internal GetRequestMessage(VersionCode version, Header header, SecurityParameters parameters, Scope scope, IPrivacyProvider privacy, byte[] length)
As setting context engine ID or context name is not necessary in most cases (they can be received via discovery), there is no simply way to set them except the ways I described above.

Regards,

Lex

New Post: Using a Sequence datatype with SendTrapV2

$
0
0
As your final data in the TRAP v2 message will be of OctetString type, you should do the following,
  1. Construct the Sequence object as above.
  2. Construct an OctetString object to embed the Sequence object, such as var stringData = new OctetString(seq.ToBytes());.
Then this OctetString object can be sent on the wire. The receiver just needs to decode it correctly so as to get the Sequence inside, such as var seq = (Sequence)DataFactory.CreateSnmpData(stringData.GetRaw());

New Post: Set Context Name v3

$
0
0
Yes, yesterday I found it.

I downloaded the last src code and I can set the context name. But in binary release (tritonmate_8.0_rc_bin) I think that it is not possible. The context name is read only.

Thanks for your reply!

Cheers.

New Post: Using a Sequence datatype with SendTrapV2

Updated Wiki: Home

$
0
0

Project Description

#SNMP (SharpSNMP) Suite is a set of free SNMP tools based on an open source library for developers who target Microsoft .NET/Xamarin Mono platforms. It's developed in C# and can be used for VB.NET, Delphi Prism, and more.

(C) 2008-2013 Malcolm Crowe, Lex Li, and other contributors.

News

Features

Microsoft .NETXamarin Mono

#SNMP Library

  • Encapsulate SNMP functions in a natural and easy-to-use API set.
  • Release under MIT/X11. (MIB related portion is released under BSD 3 Clause.)
  • Support .NET Framework 3.5 SP1, 4.0/4.5, .NET Compact Framework 3.5, Mono 2.8+, Xamarin.iOS, and Xamarin.Android.

Support for .NET Framework 2.0 and 3.0 expired on April 12, 2011. #SNMP release BigDipper (7.0) and above no longer supports these two obsolete .NET versions.

Where to Begin

Please go to Documentation section.

Training, consulting and support services are provided by Lex Li. Please send emails to support@lextm.com for further information.

Donate

Show your appreciation for this open source project and support future development,

Donate

Pro Editions

#SNMP MIB Compiler Pro and Browser Pro are enterprise specific editions of SNMP utilities that build upon #SNMP Library. They are still in an early stage of development.

MIB Compiler Pro

If you are interested in them, please participate our private beta (early access) program by joining this Google Group.

Sponsors

In the development process, we received licenses from

VisualSVNPowered by VisualSVN
JetBrains ReSharperPowered by ReSharper
NDependPowered by NDepend

Updated Wiki: Home

$
0
0

Project Description

#SNMP (SharpSNMP) Suite is a set of free SNMP tools based on an open source library for developers who target Microsoft .NET/Xamarin Mono platforms. It's developed in C# and can be used for VB.NET, Delphi Prism, and more.

(C) 2008-2013 Malcolm Crowe, Lex Li, and other contributors.

News

Features

Microsoft .NETXamarin Mono

#SNMP Library

  • Encapsulate SNMP functions in a natural and easy-to-use API set.
  • Release under MIT/X11. (MIB related portion is released under BSD 3 Clause.)
  • Support .NET Framework 3.5 SP1, 4.0/4.5, .NET Compact Framework 3.5, Mono 2.8+, Xamarin.iOS, and Xamarin.Android.

Support for .NET Framework 2.0 and 3.0 expired on April 12, 2011. #SNMP release BigDipper (7.0) and above no longer supports these two obsolete .NET versions.

Where to Begin

Please go to Documentation section.

Training, consulting and support services are provided by Lex Li. Please send emails to support@lextm.com for further information.

Donate

Show your appreciation for this open source project and support future development,

Donate

Pro Editions

#SNMP MIB Compiler Pro and Browser Pro are enterprise specific editions of SNMP utilities that build upon #SNMP Library.

MIB Compiler Pro

Sponsors

In the development process, we received licenses from

VisualSVNPowered by VisualSVN
JetBrains ReSharperPowered by ReSharper
NDependPowered by NDepend

Released: TritonMate (8.0) RC (Apr 07, 2013)

$
0
0
News: MIB Compiler Pro Early Access Program is open

Updated Release: TritonMate (8.0) RC (Apr 07, 2013)

$
0
0
News: MIB Compiler Pro Early Access Program is open

New Post: How Can I Compile again The Edited Mib file Which Has Same Name ?

$
0
0
i am using DefaultObjectRegistry in my project and the user can change the MIB file corresponding the device connected to Network.
when the user edits MIB contents and compile it again it encounters no changes in all oids .
i tried to clear or refresh the DefaultObjectRegistry by member functions such as DefaultObjectRegistry.instance.tree.refresh() and DefaultObjectRegistry.Instance.Tree.LoadedModules.Remove(MibFilePath) (this line exception accure) but i was unsuccessful
please help me
best regards

New Post: How Can I Compile again The Edited Mib file Which Has Same Name ?

$
0
0
DefaultObjectRegistry is obsolete, and you should switch to SimpleObjectRegistry or ReloadableObjectRegistry.

For the open source edition of SharpSnmpLib.Mib, you will have to use ReloadableObjectRegistry, which allows you to reload the tree by calling Reload. All modules will have to be reloaded even if only one module is edited.

In the Pro edition of SharpSnmpLib.Mib (soon to release as a commercial product), when one module is edited, only affected modules will be reloaded, and it is automatically handled. So if you like, you can participate in the private beta,

http://www.lextm.com/2013/05/snmp-pro-private-beta-is-ready-and.html

New Post: How Can I Compile again The Edited Mib file Which Has Same Name ?

$
0
0
I use :
ReloadableObjectRegistry reloadObject =new ReloadableObjectRegistry(path);
     reloadObject.Compile(MibFilePath);
but reloadobject loadedMolules is null

Released: TritonMate (8.0) (Apr 07, 2013)

$
0
0
News: MIB Compiler Pro Early Access Program is open

Please ignore the "rc" names in the download files, as they are stable.

Updated Release: TritonMate (8.0) (Apr 07, 2013)

$
0
0
News: MIB Compiler Pro Early Access Program is open

Please ignore the "rc" names in the download files, as they are stable.

New Post: How Can I Compile again The Edited Mib file Which Has Same Name ?

$
0
0
If reloadObject.Tree.PendingModules.Count is not 0, then the modules are pending. You will have to compile all modules and their dependencies to avoid pending modules.

If both reloadObject.Tree.PendingModules.Count and reloadObject.Tree.LoadedModules.Count are 0, that means you fail to compile the MIB documents to .module files in the module folder. That must be done ahead of loading any module, by using Assembler class. In the Compiler sample you can see how this class is used to compile MIB documents to .module files.

-Lex

New Post: Multi-Threading with ISnmpMessage classes

$
0
0
Hi Lex,

You wrote in FAQs that the library is not thread safe
Is this library thread safe? : Not yet. Please use static methods in Messenger class which should be thread safe.
However in one of the older posts
https://sharpsnmplib.codeplex.com/discussions/234718
You said that ISnmpMessage classes can be used in multi-threaded environment if they are spawned and thrown away for each request. Has this changed over the past 3 years? Meaning that is it still safe to use Level-1 ISnmpMessage derived classes in a multi-threaded fashion without locking if they get spawned and thrown away each time?

New Post: Configurable EngineId, SNMPv3 Discovery and SNMP exception.

$
0
0
SNMP v3 response cache can be a nice addition to improve performance. But this cache needs to be per agent, and managed with timeout/exception in mind. I don't have any idea on how to implement it yet. BTW, it will not be only ReportMessage to be cached, but any reply from the agent should be.
In regards of caching the discovery information. Would it be an acceptable way to cache a new instance of ReportMessage for the specific agent using the information that I get in the response after calling GetResponse for that agent (for all requests regardless whether its a GetRequestMessage,GetBulkRequestMessage,SetRequestMessage...) . This approach is working however I am a bit thrown off by the fact that Messenger class requires a SnmpType for the GetNextDidscovery function implying that different information is needed for the discovery to take place. Isn't it the same information such as snmpEngineID, snmpEngineBoots etc. that is required for discovery to take place regardless of what type of SnmpV3 call is going to take place or am misunderstanding the process? To sum up the question is it acceptable to have a ReportMessage cached for any type of request for a specific agent?
(not addressing exceptional conditions & timeout in this question)

New Post: Multi-Threading with ISnmpMessage classes

$
0
0
ISnmpMessage derived classes can be viewed as the object representation of raw bytes in the packets,
  • They are designed to be immutable once constructed. (If it fails to meet this, please report a bug.)
  • Each instance should be independent of another.
And that's why I stated they can use in multi-threaded environment. Since static methods in Messenger class generate such instances under the hood, I think they are thread-safe too.

Regards,

Lex

New Post: Configurable EngineId, SNMPv3 Discovery and SNMP exception.

$
0
0
If you review the constructor of a typical SNMP v3 message, such as GetRequestMessage, you will see the report parameter used.

Using that report message is too heavy, as you can see only two sections of that message are used during construction. Thus, we should not try to cache the whole message. Ideally the cache should only cache those two sections, and the related constructors should be changed to use the cached sections. (Well, caching ISnmpMessage is still acceptable, as that's the simplest approach to achieve our goals. Further changes can be deferred).

Messenger.GetNextDiscovery was changed to add that new parameter, because that's how the RFC documents require for proper discovery. While practically it is OK to always use GET to discover an agent, we must support discovery via GET BULK, SET and so on.

We should focus on caching first, and later consider exceptions and other factors.

Regards,

Lex

New Post: SNMP and VLANs

$
0
0
Hi,

I'm new to SNMP world, I'm a confused about how it works.
What I need is get and set VLANs for a switch from HP model v1910-24G.

Where I can find the OID correct to get VLAN.
Above there is the sample code I'm using to get the data from SNMP.
var result = Messenger.Get(VersionCode.V2,
                new IPEndPoint(IPAddress.Parse("192.168.0.254"), 161),
                new OctetString("public"),
                new List<Variable> { new Variable(new ObjectIdentifier("1.3.6.1.4.1.43.45.1.2.23.1.2.1.1.1.13")) },
                60000);

foreach (var item in result)
{
    Console.WriteLine(item.Data.ToString());
}
Thanks very much everyone that could help me.

New Post: SNMP and VLANs

$
0
0
You should read HP documentation on that model or contact its support team to understand how to achieve management via SNMP.
Viewing all 576 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>