Running SNMP on windows

2012-10-29 Thread Gaelle Nsengiyumva
Hi, I am learning how to use SNMP and i found the tutorials/source code ( http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/demoapp/index.html) on your website. Am using windows 7, but I can also use a QNX server to run the program. Any directions on how to do this? Is there a particular

Re: Problems with net-snmp on cygwin

2012-10-29 Thread Bart Van Assche
On 10/29/12 17:50, Lee wrote: > On 10/29/12, Bart Van Assche wrote: >> On 10/28/12 21:51, Lee wrote: >>> On 10/28/12, Patrick Rebert wrote: Thanks for the reply, I actually did try it with semicolons. Unfortunately, the shell sees the semicolon as a command terminator, so that didn

Re: Problems with net-snmp on cygwin

2012-10-29 Thread Lee
On 10/29/12, Bart Van Assche wrote: > On 10/28/12 21:51, Lee wrote: >> On 10/28/12, Patrick Rebert wrote: >>> Thanks for the reply, I actually did try it with semicolons. >>> Unfortunately, the >>> shell sees the semicolon as a command terminator, so that didn't advance >>> the cause. >> >> It's

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 11:56, Sverre Moe wrote: > Why does this work for my 3 hard coded scalars, but not my list of scalars? > > const oid scalar_oid[] = { 1,3,6,1,4,1,45678,1,1 }; > OID_LENGTH(scalar_oid) gives value 9. > > const oid *scalar_oid = wrapper.getOid(); //Has same oid within. Returns a >

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
I'm not sure if I found a solution to my problem, but anyway netsnmp_handler_registration *handler_reg = netsnmp_create_handler_registration(buffy, handle_snmp, scalar_oid, OID_LENGTH(scalar_oid), HANDLER_CAN_RONLY); I tried to output each handler, and rootoid_len that comes from OID_LE

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 10:46, Sverre Moe wrote: > I have also tried to output the handler memory address, and its not > always unique. Don't know if it has anything to do with the problem. Hmmm as far as I can tell, this structure should be unique, but this duplication could well be a symptom of

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
Thats correct, its the netsnmp_register_scalar which returns -1. Function netsnmp_create_handler_registration returns a pointer to an netsnmp_handler_registration. I have also tried to output the handler memory address, and its not always unique. Don't know if it has anything to do with the pr

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 10:10, Sverre Moe wrote: > I have tried to seperate the registration call into two separate statements, > same result. None of these are actually failing. When I call > netsnmp_register_scalar(handler), it returns -1 which is > MIB_DUPLICATE_REGISTRATION. So the 'netsnmp_create

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
I have tried to seperate the registration call into two separate statements, same result. None of these are actually failing. When I call netsnmp_register_scalar(handler), it returns -1 which is MIB_DUPLICATE_REGISTRATION. How do I " Turn on packet dumps in the AgentX subagent" ? /Sverr

Re: Debugging SNMP

2012-10-29 Thread Dave Shield
On 29 October 2012 09:34, Sverre Moe wrote: > I have tried to manually register 3 hard coded scalars, one by one, each > with its own handler: [snip] > This works fine and snmpget returns a value. However, if I put these 3 hard > coded scalars OID in a list, iterate over that list and register

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
I have checked and there is only once instance of my subagent running. It is running as a separate process using AgentX protocol. I have tried to manually register 3 hard coded scalars, one by one, each with its own handler: int returnValue1 = netsnmp_register_read_only_scalar( netsnmp_create_

Re: Debugging SNMP

2012-10-29 Thread Sverre Moe
I have checked the contents of each elements inputted into int returnValue = netsnmp_register_read_only_scalar( netsnmp_create_handler_registration(buffy, handle_snmp, scalar_oid, OID_LENGTH(scalar_oid), HANDLER_CAN_RONLY )); For each iteration of the loop the OID and scalar name is uniq

Re: Problems with net-snmp on cygwin

2012-10-29 Thread Bart Van Assche
On 10/28/12 21:51, Lee wrote: > On 10/28/12, Patrick Rebert wrote: >> Thanks for the reply, I actually did try it with semicolons. Unfortunately, >> the >> shell sees the semicolon as a command terminator, so that didn't advance the >> cause. > > It's easier to build net-snmp with cygwin than i