Quantcast
Channel: sharpsnmplib Forum Rss Feed
Viewing all 173 articles
Browse latest View live

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.

New Post: SNMP and VLANs

$
0
0
Thanks @lextm. I did what you recommended I found this link with some mib files

Am I on the right path?

Now I think I should use compiler to create the modules files using the mibs and after that use the browser to navigate on it. Am I right?

Thanks for all!

New Post: exception of type 'System.Net.Sockets.SocketException' occurred in System.dll

$
0
0
Dear Lex,

First, thanks for your great work on SharpSNMP ! Yes, It's really a great work for windows network developers!

I encounter an exception problem and cannot fined answers by google and this forum. So my last resort is have to ask for you help.

The error messages are as following when I try to get, use BulkWalk method, all "dot1qTpFdbPort(1.3.6.1.2.1.17.7.1.2.2.1.2)" information from a switch:
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
A first chance exception of type 'Lextm.SharpSnmpLib.Messaging.TimeoutException' occurred in SharpSnmpLib.dll
SNMPException:TimeoutException: timeout: 3000
I use" bigdipper_7.5_bin" on Win7 64bit Enterprise (IPv4/IPv6) and VS2010 English version. The exception messages does not occurs every time. But it often occurs, and, with different IP. Following is my code in which "Switches" is a type of List<Switch> variable that contains 10 "Switch" items.
            //get all switch's MAC-PortIndex table
            foreach (Switch SW in Switches)
            {
                ObjectIdentifier OID = new ObjectIdentifier("1.3.6.1.2.1.17.7.1.2.2.1.2"); //dot1qTpFdbPort
                try
                {
                    var result = new List<Variable>();
                    Messenger.BulkWalk(VersionCode.V2,
                                       new IPEndPoint(IPAddress.Parse(SW.EntIPAddr), 161),
                                       new OctetString(tbCommunity.Text),
                                       OID, result, 3000, 10,
                                       WalkMode.WithinSubtree,
                                       null, null);
                    foreach (Variable variable in result)
                    {
                        ... ...
                    }
                }
                catch (SnmpException ex)
                {
                    Console.WriteLine("SNMPException:" + ex);
                }
                catch (SocketException ex)
                {
                    Console.WriteLine("SocketException:" + ex);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("!!!Exception:" + SW.EntIPAddr.ToString() + " " + ex.ToString());
                }
Is it correlated with IPv6 or the program calls "Socket" function too fast in a "foreach" loop? Do you ever encountered this situation before ? Could you please give me some hints! Thanks again and a lot!

New Post: exception of type 'System.Net.Sockets.SocketException' occurred in System.dll

$
0
0
Looking forward to hearing from you! thanks a lot!

New Post: exception of type 'System.Net.Sockets.SocketException' occurred in System.dll

New Post: exception of type 'System.Net.Sockets.SocketException' occurred in System.dll

$
0
0
Dear Lex,

I do not think the reason is timeout. Since there is a System.Net.Sockets.SocketException occurred in System.dll before TimeoutException.

New Post: exception of type 'System.Net.Sockets.SocketException' occurred in System.dll

$
0
0
The library is open source, so please read it and see how the SocketException is caught and how the TimeoutException is generated.

New Post: Gathering Data

$
0
0
Hey guys,

I'd like to create a program that will gather data from an OID and record it into a database.

Is there a guide or a sample code that shows this method? can someone point me in the general direction of where I can start ?

Thank you

New Post: new MIB added in a MIcrosoft server Agent not recognized

$
0
0
Hi Lextm

thank you for your answer

Does the sharpSNMP API provide the functionalities to extend the agent (in this case windows agent) or in your opinion it's better to create a new agent from scratch and add the MIB to it (I saw you have created one agent in the #snmp project)

Many Thanks

Nelson73

New Post: new MIB added in a MIcrosoft server Agent not recognized

$
0
0
How to extend an agent depends on the vendor of that agent framework, which has no relationship with #SNMP.

Though #SNMP does have an agent, I don't recommend you use it, as it is very difficult to extend it.

Lex

New Post: How to identify the version of the MIB in the agent

$
0
0
Thanks for your reply Lex.

Sorry, did not mean that this is a topic for this forum. It would be a hint or help.

My application will run in places where I do not know which printers are on the network. I wonder if there is any way to find out which version of the protocol implemented by the printer without having to map all network printers.

Again, thank you.

New Post: new MIB added in a MIcrosoft server Agent not recognized

$
0
0
Hi Lextm

thanks for suggestions.
Since the device that I should monitor is a windows workstation , I guess I have to implement an extension to snmp.exe windows service. I found something that suits me, is a subagent written with C++ code (http://www.codeproject.com/Articles/9024/How-to-develop-a-SNMP-extension-agent-DLL) I implemented the extension and everything seems to work well. I added some oid in the MIB structure
BUT WHEN I TRY TO GET these new OID with #SNMP API the result is a timeout exception . So the question is: is it possible to use #sharp API ONLY with standard already crafted MIB (the RFC MIBfor ex.) or also with new custom variabiles?

many Thanks

Nelson73

New Post: new MIB added in a MIcrosoft server Agent not recognized

New Post: new MIB added in a MIcrosoft server Agent not recognized

$
0
0
Hi

I resolved the issue (there were a problem in network comunication). So in conclusion I will create my custom MIB, the subagent written in C++ will load it in the Windows server (and will create the thread that contains the listening traps) , and then I will able to set and get the MIB information using #SMNP API

Thanks again for your support

Anton

New Post: How to identify the version of the MIB in the agent

$
0
0
SNMP protocol itself does not have a good enough device discovery mechanism, so you will have to check the printers one by one with the device administrator or vendor.

New Post: How to identify the version of the MIB in the agent

$
0
0
Thanks Lex

I'll think of a way around this problem.

New Post: Sample for sending V3 Traps

$
0
0
Hi,

I was looking somewhere for an example of how to send a V3 Trap that has been encrypted with your library but I was unable to find anything.

I looked at the snmpsendtrap sample and can see how to send V1,2 traps and was hoping to be able to write something similar for sending a V3 one. But I noticed in the source for Messenger.SendTrapV2 that you do not allow VersionCode.V3 here:
if (version != VersionCode.V2)
{
   throw new ArgumentException("Only SNMP v2c is supported", "version");
}
Would you be able to provide some guidance on how to send a V3 trap using a secret key to encrypt the data? I am assuming I'll need to use an IPrivacyProvider (such as the DES one) for this but I can't easily figure out how to specify this with the Messenger class.

Regards,
Neil

New Post: Sample for sending V3 Traps

New Post: Need an option for disabling SNMP V3

$
0
0
Hi,
First of all thank you very much for the excellent library.
I am using it in one of my projects. It is nothing but a device simulator. The problem I am facing is, in the real device it supports disabling SNMP V3. But I didnt found a way to do the same using the library.
Is this feature yet to implement or am i missing something.
The version which I am using is "7.0.011003.00"
Expecting a solution soon
Sincierly
Sivaprasad
Viewing all 173 articles
Browse latest View live


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