RE: How to convert BITS data into OCTET String

2007-06-26 Thread Jayaprakasha Guddenahalli Naganna
Treat BITS as just OCTET STRING.
Example API's for processing bits from char* variable,
Call this function by passing *val* from set_handler,
/*
 * bits -- set val
 * pos  -- which bit you want to read from set val
 */
int bit_get(const unsigned char *bits, int pos) {
unsigned intmask;
int i;

mask = 0x80;
for (i=0; i < (pos % 8); i++)
mask = mask >> 1;

return (((mask & bits[(int)(pos / 8)]) == mask) ? 1 : 0);
}

Call this function by passing *ret_val* from get_handler,
/*
 * bits -- ret value from get_handler from function
 * pos  -- which bit you want to set 
 */ 
void bit_set(unsigned char *bits, int pos) {
unsigned char  mask;
inti;

mask = 0x80;
for (i = 0; i < (pos % 8); i++)
mask = mask >> 1;

bits[pos / 8] = bits[pos / 8] | mask;
return;
} 
Example snmpset command,
Snmpset column. x 28
OR
snmpset column. b proxyServer,registrarServer

>> I suppose that numbering would be:
>> 8 7 6 5 4 3 2 1
>> - - X - X - - -
>> If these bits would be set then index 0 of the octet string should be

>> equal to: 0x28.
>> Is that correct?
[JP] yes
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Abhishek Mishra
Sent: Tuesday, June 26, 2007 11:51 AM
To: net-snmp-users@lists.sourceforge.net
Cc: Abhishek Mishra
Subject: How to convert BITS data into OCTET String

Hi,

We have a column in the table that have datatype of BITS. After
compilation of the MIB file, it is converted into a character array. I
found some information in the RFC# 3416/3417 regarding the conversion
but could not understand well how to convert BITS field into the octet
string. Following is the BITS field we are using:

SYNTAX  BITS {
  other(0),
  userAgent(1),
  proxyServer(2),
  redirectServer(3),
  registrarServer(4)
}

Now, I have to set bit 2 (proxyServer) and 4 (registrarServer) into the
octet string.
Please guide me how the conversion would actually take place.

I suppose that numbering would be:
8 7 6 5 4 3 2 1
- - X - X - - -

If these bits would be set then index 0 of the octet string should be
equal to: 0x28.
Is that correct?

Kind Regards,
-Abhishek


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Ed Ravin
This is weird.  I can't build snmptrapd on my Solaris 10 x86 box - see
below.  Had no such problems with 5.4.  netsnmphelpers.a exists
and has the entry points defined:

  # nm 
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a
 | grep -i register_null_context
  [13]| 0| 132|FUNC |GLOB |0|2  
|netsnmp_register_null_context

But when I build, it's as if it wasn't there:

/bin/sh ../libtool  --mode=link /usr/local/bin/gcc -g -O2 -Usolaris2 
-Dsolaris2=solaris2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings 
-Wcast-qual -Wno-char-subscripts -o snmptrapd snmptrapd.lo  libnetsnmptrapd.la 
-L../snmplib/.libs -L../snmplib -L../agent/.libs -L../agent 
-L../agent/helpers/.libs -L../agent/helpers -L/usr/local/ssl/lib 
-R/usr/local/ssl/lib/  ../agent/libnetsnmpmibs.la 
../agent/helpers/libnetsnmphelpers.la ../agent/libnetsnmpagent.la 
../snmplib/libnetsnmp.la  -lelf  -lnsl -lsocket 
/usr/local/bin/gcc -g -O2 -Usolaris2 -Dsolaris2=solaris2 -Wall -Winline 
-Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -o 
snmptrapd snmptrapd.o  
-L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs 
-L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs 
-L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs 
./.libs/libnetsnmptrapd.a 
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpmibs.a
 -L/usr/local/ssl/lib 
-L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib 
-L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent 
-L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers 
../agent/.libs/libnetsnmpmibs.a 
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a
 -ladm ../agent/helpers/.libs/libnetsnmphelpers.a 
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a
 ../agent/.libs/libnetsnmpagent.a /build/Su
 nOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs/libnetsnmp.a -lwrap 
-lkvm ../snmplib/.libs/libnetsnmp.a -lkstat -lcrypto -lelf -lnsl -lsocket 
-R/usr/local/ssl/lib/
Undefined   first referenced
 symbol in file
netsnmp_register_null_context   
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
netsnmp_register_old_api
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
netsnmp_init_helpers
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(snmp_vars.o)
netsnmp_get_bulk_to_next_handler
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_handler.o)
netsnmp_bulk_to_next_fix_requests   
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(master.o)
netsnmp_register_null   
/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
ld: fatal: Symbol referencing errors. No output written to snmptrapd
collect2: ld returned 1 exit status


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


RE: How to convert BITS data into OCTET String

2007-06-26 Thread Abhishek Mishra
Thanks JP. Functions you have provided are very useful.

-Abhishek

On Tue, 2007-06-26 at 12:30, Jayaprakasha Guddenahalli Naganna wrote:
> Treat BITS as just OCTET STRING.
> Example API's for processing bits from char* variable,
> Call this function by passing *val* from set_handler,
> /*
>  * bits   -- set val
>  * pos-- which bit you want to read from set val
>  */
> int bit_get(const unsigned char *bits, int pos) {
> unsigned intmask;
> int i;
> 
> mask = 0x80;ple API's for processing bits from char* variable,
> for (i=0; i < (pos % 8); i++)
> mask = mask >> 1;
> 
> return (((mask & bits[(int)(pos / 8)]) == mask) ? 1 : 0);
> }
> 
> Call this function by passing *ret_val* from get_handler,
> /*
>  * bits   -- ret value from get_handler from function
>  * pos-- which bit you want to set 
>  */ 
> void bit_set(unsigned char *bits, int pos) {
> unsigned char  mask;
> inti;
> 
> mask = 0x80;
> for (i = 0; i < (pos % 8); i++)
> mask = mask >> 1;
> 
> bits[pos / 8] = bits[pos / 8] | mask;
> return;
> } 
> Example snmpset command,
> Snmpset column. x 28
> OR
> snmpset column. b proxyServer,registrarServer
> 
> >> I suppose that numbering would be:
> >> 8 7 6 5 4 3 2 1
> >> - - X - X - - -
> >> If these bits would be set then index 0 of the octet string should be
> 
> >> equal to: 0x28.
> >> Is that correct?
> [JP] yes
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Abhishek Mishra
> Sent: Tuesday, June 26, 2007 11:51 AM
> To: net-snmp-users@lists.sourceforge.net
> Cc: Abhishek Mishra
> Subject: How to convert BITS data into OCTET String
> 
> Hi,
> 
> We have a column in the table that have datatype of BITS. After
> compilation of the MIB file, it is converted into a character array. I
> found some information in the RFC# 3416/3417 regarding the conversion
> but could not understand well how to convert BITS field into the octet
> string. Following is the BITS field we are using:
> 
> SYNTAX  BITS {
>   other(0),
>   userAgent(1),
>   proxyServer(2),
>   redirectServer(3),
>   registrarServer(4)
> }
> 
> Now, I have to set bit 2 (proxyServer) and 4 (registrarServer) into the
> octet string.
> Please guide me how the conversion would actually take place.
> 
> I suppose that numbering would be:
> 8 7 6 5 4 3 2 1
> - - X - X - - -
> 
> If these bits would be set then index 0 of the octet string should be
> equal to: 0x28.
> Is that correct?
> 
> Kind Regards,
> -Abhishek
> 
> 
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Net-snmp-users mailing list
> Net-snmp-users@lists.sourceforge.net
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
> 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Thomas Anders
Ed Ravin wrote:
> This is weird.  I can't build snmptrapd on my Solaris 10 x86 box - see
> below.  Had no such problems with 5.4.  netsnmphelpers.a exists
> and has the entry points defined:
> 
>   # nm 
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a
>  | grep -i register_null_context
>   [13]| 0| 132|FUNC |GLOB |0|2  
> |netsnmp_register_null_context
> 
> But when I build, it's as if it wasn't there:
> 
> /bin/sh ../libtool  --mode=link /usr/local/bin/gcc -g -O2 -Usolaris2 
> -Dsolaris2=solaris2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings 
> -Wcast-qual -Wno-char-subscripts -o snmptrapd snmptrapd.lo  
> libnetsnmptrapd.la -L../snmplib/.libs -L../snmplib -L../agent/.libs 
> -L../agent -L../agent/helpers/.libs -L../agent/helpers -L/usr/local/ssl/lib 
> -R/usr/local/ssl/lib/  ../agent/libnetsnmpmibs.la 
> ../agent/helpers/libnetsnmphelpers.la ../agent/libnetsnmpagent.la 
> ../snmplib/libnetsnmp.la  -lelf  -lnsl -lsocket 
> /usr/local/bin/gcc -g -O2 -Usolaris2 -Dsolaris2=solaris2 -Wall -Winline 
> -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -o 
> snmptrapd snmptrapd.o  
> -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs 
> -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs 
> -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs 
> ./.libs/libnetsnmptrapd.a 
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpmibs.a
>  -L/usr/local/ssl/lib 
> -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib 
> -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent 
> -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers 
> ../agent/.libs/libnetsnmpmibs.a 
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a
>  -ladm ../agent/helpers/.libs/libnetsnmphelpers.a 
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a
>  ../agent/.libs/libnetsnmpagent.a /build/
Su
>  nOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs/libnetsnmp.a -lwrap 
> -lkvm ../snmplib/.libs/libnetsnmp.a -lkstat -lcrypto -lelf -lnsl -lsocket 
> -R/usr/local/ssl/lib/
> Undefined   first referenced
>  symbol in file
> netsnmp_register_null_context   
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> netsnmp_register_old_api
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> netsnmp_init_helpers
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(snmp_vars.o)
> netsnmp_get_bulk_to_next_handler
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_handler.o)
> netsnmp_bulk_to_next_fix_requests   
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(master.o)
> netsnmp_register_null   
> /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> ld: fatal: Symbol referencing errors. No output written to snmptrapd
> collect2: ld returned 1 exit status

Interesting. FWIW, this works fine for me on Solaris/Sparc 8/9/10. Not
sure why x86 treats things differently.

Can you please try whether shuffling the order of libnetsnmpagent.[l]a
and libnetsnmphelpers.[l]a around changes things here? Also, do you have
 cc available on this box? If so, does it make a difference if you build
with cc?

The problem is that these five symbols violate the dependency chain (see
http://www.net-snmp.org/wiki/index.php/Library_layering). We'd need to
merge libnetsnmpagent and libnetsnmphelpers to fix this, but feel like
this change is too significant for 5.4.x.


+Thomas

-- 
Thomas Anders (thomas.anders at blue-cable.de)

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Ed Ravin
On Tue, Jun 26, 2007 at 09:57:40AM +0200, Thomas Anders wrote:
> Ed Ravin wrote:
> > This is weird.  I can't build snmptrapd on my Solaris 10 x86 box - see
> > below.  Had no such problems with 5.4.  netsnmphelpers.a exists
> > and has the entry points defined:
> > 
> >   # nm 
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a
> >  | grep -i register_null_context
> >   [13]| 0| 132|FUNC |GLOB |0|2  
> > |netsnmp_register_null_context
> > 
> > But when I build, it's as if it wasn't there:
> > 
> > /bin/sh ../libtool  --mode=link /usr/local/bin/gcc -g -O2 -Usolaris2 
> > -Dsolaris2=solaris2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings 
> > -Wcast-qual -Wno-char-subscripts -o snmptrapd snmptrapd.lo  
> > libnetsnmptrapd.la -L../snmplib/.libs -L../snmplib -L../agent/.libs 
> > -L../agent -L../agent/helpers/.libs -L../agent/helpers -L/usr/local/ssl/lib 
> > -R/usr/local/ssl/lib/  ../agent/libnetsnmpmibs.la 
> > ../agent/helpers/libnetsnmphelpers.la ../agent/libnetsnmpagent.la 
> > ../snmplib/libnetsnmp.la  -lelf  -lnsl -lsocket 
> > /usr/local/bin/gcc -g -O2 -Usolaris2 -Dsolaris2=solaris2 -Wall -Winline 
> > -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -o 
> > snmptrapd snmptrapd.o  
> > -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs 
> > -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs 
> > -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs 
> > ./.libs/libnetsnmptrapd.a 
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpmibs.a
> >  -L/usr/local/ssl/lib 
> > -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib 
> > -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent 
> > -L/build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers 
> > ../agent/.libs/libnetsnmpmibs.a 
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/helpers/.libs/libnetsnmphelpers.a
> >  -ladm ../agent/helpers/.libs/libnetsnmphelpers.a 
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a
> >  ../agent/.libs/libnetsnmpagent.a /buil
 d/
> Su
> >  nOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/snmplib/.libs/libnetsnmp.a 
> > -lwrap -lkvm ../snmplib/.libs/libnetsnmp.a -lkstat -lcrypto -lelf -lnsl 
> > -lsocket -R/usr/local/ssl/lib/
> > Undefined   first referenced
> >  symbol in file
> > netsnmp_register_null_context   
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> > netsnmp_register_old_api
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> > netsnmp_init_helpers
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(snmp_vars.o)
> > netsnmp_get_bulk_to_next_handler
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_handler.o)
> > netsnmp_bulk_to_next_fix_requests   
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(master.o)
> > netsnmp_register_null   
> > /build/SunOS/netsnmp/net-snmp-5.4.1.pre3-SunOS-5.10/agent/.libs/libnetsnmpagent.a(agent_registry.o)
> > ld: fatal: Symbol referencing errors. No output written to snmptrapd
> > collect2: ld returned 1 exit status
> 
> Interesting. FWIW, this works fine for me on Solaris/Sparc 8/9/10. Not
> sure why x86 treats things differently.

It must be me treating things differently, it's happening on NetBSD 3.1
as well.  Is there perhaps some ar / ranlib step that's missing?

> Can you please try whether shuffling the order of libnetsnmpagent.[l]a
> and libnetsnmphelpers.[l]a around changes things here? Also, do you have
>  cc available on this box? If so, does it make a difference if you build
> with cc?

I only have gcc on the Solaris box.  Will try the shuffle and let
you know.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Pthread Creation

2007-06-26 Thread Dave Shield
On 25/06/07, Rajesh Balasubramanian <[EMAIL PROTECTED]> wrote:
> I would like to create a separate pthread in net-snmp due to my need.
> But I am getting the following error, have the statement pthread_create in
> snmpd.c
>
> net-snmp-5.2.3/agent/snmpd.c:1034: undefined reference to `pthread_create'
> collect2: ld returned 1 exit status


You probably need to add '-lpthread' to the linking command.

I trust that all of the SNMP processing (Net-SNMP library calls, etc)
is contained within a single thread, and that you're just using this
separate thread for your MIB-specific processing.
   Remember that the Net-SNMP agent is not designed for threaded
operation.

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: code to tftp download cisco configs.

2007-06-26 Thread Dave Shield
On 25/06/07, Ajay Chenampara <[EMAIL PROTECTED]> wrote:
> my $vb = new SNMP::Varbind([$OID,'0','6','INTEGER']);
> oidvalue=[1.3.6.1.4.1.9.9.96.1.1.1.1.14.1000], errNo=[11],
> errStr=[noCreation (that table does not support row creation)]

Try
   oidvalue=[1.3.6.1.4.1.9.9.96.1.1.1.1.14]
   my $vb = new SNMP::Varbind([$OID,'1000','6','INTEGER']);

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


[no subject]

2007-06-26 Thread Bukovan Michal
Hi everyone.

 

I have problem with net-snmp for windows. I dont know how I can launch
some program, when my smnptrap catch some message. In linux a simple
write in cnmptrapd.conf: traphandle default /dir/dir/myskript

But when I write: traphandle default c:\myskript.bat (or
c:/myskript.bat) so it do nothing. If a forward all traps, it function. 

Could you help me how I can run some batchfile script please.

 

S pozdravem / Best Regards 

Michal Bukovan 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Mike Fisher
Ed Ravin wrote:
> On Tue, Jun 26, 2007 at 09:57:40AM +0200, Thomas Anders wrote:
>> Ed Ravin wrote:
>>> This is weird.  I can't build snmptrapd on my Solaris 10 x86 box - see
>>> below.  Had no such problems with 5.4.  netsnmphelpers.a exists
>>> and has the entry points defined:
...
>> Interesting. FWIW, this works fine for me on Solaris/Sparc 8/9/10. Not
>> sure why x86 treats things differently.
> 
> It must be me treating things differently, it's happening on NetBSD 3.1
> as well.  Is there perhaps some ar / ranlib step that's missing?
> 
>> Can you please try whether shuffling the order of libnetsnmpagent.[l]a
>> and libnetsnmphelpers.[l]a around changes things here? Also, do you have
>>  cc available on this box? If so, does it make a difference if you build
>> with cc?
> 
> I only have gcc on the Solaris box.  Will try the shuffle and let
> you know.

For what it's worth, I just built on Solaris 10 x86 with no issues using 
  gcc 3.3.2.  What configure options are you using?

Mike

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Ed Ravin
On Tue, Jun 26, 2007 at 08:36:54AM -0400, Mike Fisher wrote:
> Ed Ravin wrote:
> > On Tue, Jun 26, 2007 at 09:57:40AM +0200, Thomas Anders wrote:
> >> Ed Ravin wrote:
> >>> This is weird.  I can't build snmptrapd on my Solaris 10 x86 box - see
> >>> below.  Had no such problems with 5.4.  netsnmphelpers.a exists
> >>> and has the entry points defined:
> ...
> >> Interesting. FWIW, this works fine for me on Solaris/Sparc 8/9/10. Not
> >> sure why x86 treats things differently.
> > 
> > It must be me treating things differently, it's happening on NetBSD 3.1
> > as well.  Is there perhaps some ar / ranlib step that's missing?
> > 
> >> Can you please try whether shuffling the order of libnetsnmpagent.[l]a
> >> and libnetsnmphelpers.[l]a around changes things here? Also, do you have
> >>  cc available on this box? If so, does it make a difference if you build
> >> with cc?
> > 
> > I only have gcc on the Solaris box.  Will try the shuffle and let
> > you know.

I tried it.  It worked!  Here's the edit I made to apps/Makefile:

--- apps/Makefile   2007/06/26 14:27:23 1.1
+++ apps/Makefile   2007/06/26 14:31:53
@@ -180,7 +180,7 @@
 
 # these will be set by configure to one of the above 2 lines
 TRAPLIBS   = $(TRAPDWITHAGENT) $(PERLLDOPTS)
-USETRAPLIBS= $(USEAGENTLIBS)
+USETRAPLIBS= $(MIBLIB) $(AGENTLIB) $(HELPERLIB) $(USELIBS)
 
 CPPFLAGS   = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(HELPER_INCLUDES) \
  $(MIBGROUP_INCLUDES)  $(SNMPLIB_INCLUDES) 
-I/usr/local/ssl/include 

And snmptrapd built on Solaris successful, without breaking the build of
anything else.  My NetBSD box is much slower, I only relinked snmptrapd and
snmpd and snmpwalk, so I can't say it works 100% until I restart the build
from scratch, but so far so good.

> For what it's worth, I just built on Solaris 10 x86 with no issues using 
>   gcc 3.3.2.  What configure options are you using?

These are my NetBSD flags:

--prefix=/pkg/net-snmp-5.4.1.pre3 \
--sysconfdir=/etc \
--with-zlib \
--with-openssl=/usr \
--with-pic \
--with-libwrap \
--enable-shared=no \
--localstatedir=/etc \
--without-logfile \
--with-default-snmp-version=1 \
--with-sys-contact='blah blah blah' \ 
--with-sys-location='blah blah blah blah blah' \
--with-persistent-directory=/var/net-snmp \
--with-mib-modules='ucd-snmp/disk' \
--with-dummy-values \

And Solaris:

--prefix=/pkg/net-snmp-5.4.1.pre3 \
--with-persistent-directory=/var/sma_snmp \
--with-default-snmp-version=3 \
--enable-developer=yes \
--enable-mib-config-checking \
--enable-agentx-dom-sock-only \
--datadir=/etc/sma \
--with-mibdirs=/etc/sma/snmp/mibs \
--with-mib-modules='ucd-snmp/diskio' \
--sysconfdir=/etc \
--with-zlib \
--with-libwrap \
--with-openssl=/usr/local/ssl \
--with-pic \
--enable-shared=no \
--localstatedir=/etc \
--without-logfile \
--with-sys-contact='wah wah wah' \
--with-sys-location='wah wah wah wah wah' \
--with-persistent-directory=/var/sma_snmp \
--with-dummy-values \


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


annoying Net-SNMP nits

2007-06-26 Thread Ed Ravin
Why does http://net-snmp give me a 404?  Only www.net-snmp.org works.
Not such a big deal but it would be nice to fix.  The natural thing
to try when getting a 404 is to remove the hyphen, and which of course
brings to that inexplicable pr0n site using a lookalike URL.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


RE: Conversation of seconds to DateAndTime

2007-06-26 Thread somenath.pal
Hi All,
Thanks for your kind response. I  would like to know if I there is any
method which  can convert DateAndTime to seconds .

Regards,
Somenath 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Shield
Sent: Monday, June 25, 2007 2:10 PM
To: Somenath Pal (WT01 - TES-Access Networks)
Cc: net-snmp-users@lists.sourceforge.net
Subject: Re: Conversation of seconds to DateAndTime

On 25/06/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  I need to converts seconds in to DateAndTime format.
>  Is there any function that can do this?

See 'date_n_time()'  in snmplib/snmp-tc.c

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Thomas Anders
Mike Fisher wrote:
> For what it's worth, I just built on Solaris 10 x86 with no issues using 
>   gcc 3.3.2.  What configure options are you using?

Do you build static or shared libs or both? Ed's build was failing with
--enable-shared=no which *may* make a difference.


+Thomas

-- 
Thomas Anders (thomas.anders at blue-cable.de)

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: code to tftp download cisco configs.

2007-06-26 Thread Ajay Chenampara
that did not help...
I am assuming you meant me to set the $OID as 1.3.6.1.4.1.9.9.96.1.1.1.1.14 
(without the random index number).

I got the same error 
[noCreation (that table does not support row creation)]

Ajay


Dave Shield <[EMAIL PROTECTED]> wrote: On 25/06/07, Ajay Chenampara  wrote:
> my $vb = new SNMP::Varbind([$OID,'0','6','INTEGER']);
> oidvalue=[1.3.6.1.4.1.9.9.96.1.1.1.1.14.1000], errNo=[11],
> errStr=[noCreation (that table does not support row creation)]

Try
   oidvalue=[1.3.6.1.4.1.9.9.96.1.1.1.1.14]
   my $vb = new SNMP::Varbind([$OID,'1000','6','INTEGER']);

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users



   
-
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: code to tftp download cisco configs.

2007-06-26 Thread Dave Shield
On 26/06/07, Ajay Chenampara <[EMAIL PROTECTED]> wrote:
> I am assuming you meant me to set the $OID as 1.3.6.1.4.1.9.9.96.1.1.1.1.14
> (without the random index number).

That's correct.
The second parameter to the SNMP::Varbind call is the index value.
So the first two parameters are combined to form the full OID.


> I got the same error
> [noCreation (that table does not support row creation)]

What does the router debug output look like?
What does the same debug output look like when you issue the equivalent
"snmpset" command?

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Mike Fisher
Thomas Anders wrote:
> Mike Fisher wrote:
>> For what it's worth, I just built on Solaris 10 x86 with no issues using 
>>   gcc 3.3.2.  What configure options are you using?
> 
> Do you build static or shared libs or both? Ed's build was failing with
> --enable-shared=no which *may* make a difference.

Yes, that does seem to trigger the problem when I build it.

Mike

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: code to tftp download cisco configs.

2007-06-26 Thread Ajay Chenampara
ah that makes sense...but still no luck

router debug when using the snmpset :
Jun 26 16:47:07.892: SNMP: Packet received via UDP from on 
FastEthernet0/0
Jun 26 16:47:07.892:
Incoming SNMP packet
Jun 26 16:47:07.892: v3 packet  security model: v3   security level: noauth
Jun 26 16:47:07.892: username:
Jun 26 16:47:07.892: snmpEngineID: 8009031759DF1AB0
Jun 26 16:47:07.892: snmpEngineBoots: 0 snmpEngineTime: 0
Jun 26 16:47:07.892: SNMP: Report, reqid 217343878, errstat 0, erridx 0
 internet.6.3.15.1.1.4.0 = 262
Jun 26 16:47:07.896: SNMP: Packet sent via UDP to 
Jun 26 16:47:07.900: SNMP: Packet received via UDP from on 
FastEthernet0/0
Jun 26 16:47:07.900: SNMP: Set request, reqid 217343879, errstat 0, erridx 0
 ccCopyTable.1.14.1000 = 6
Jun 26 16:47:07.908:
Incoming SNMP packet
Jun 26 16:47:07.908: v3 packet  security model: v3   security level: auth
Jun 26 16:47:07.908: username: 
Jun 26 16:47:07.908: snmpEngineID: 8009031759DF1AB0
Jun 26 16:47:07.908: snmpEngineBoots: 4 snmpEngineTime: 1046629
Jun 26 16:47:07.908: SNMP: Response, reqid 217343879, errstat 0, erridx 0
 ccCopyTable.1.14.1000 = 6
Jun 26 16:47:07.912: SNMP: Packet sent via UDP to 


router debug through the perl script :

Jun 26 16:49:49.506: SNMP: Packet received via UDP from  on 
FastEthernet0/0
Jun 26 16:49:49.506:
Incoming SNMP packet
Jun 26 16:49:49.506: v3 packet  security model: v3   security level: noauth
Jun 26 16:49:49.506: username:
Jun 26 16:49:49.506: snmpEngineID: 8009031759DF1AB0
Jun 26 16:49:49.506: snmpEngineBoots: 0 snmpEngineTime: 0
Jun 26 16:49:49.506: SNMP: Report, reqid 1631554622, errstat 0, erridx 0
 internet.6.3.15.1.1.4.0 = 263
Jun 26 16:49:49.510: SNMP: Packet sent via UDP to 
Jun 26 16:49:49.514: SNMP: Packet received via UDP from  on 
FastEthernet0/0
Jun 26 16:49:49.514: SNMP: Get request, reqid 1631554623, errstat 0, erridx 0
 ccCopyTable.1.14.3221213416 = NULL TYPE/VALUE
Jun 26 16:49:49.522:
Incoming SNMP packet
Jun 26 16:49:49.522: v3 packet  security model: v3   security level: auth
Jun 26 16:49:49.522: username: userid
Jun 26 16:49:49.522: snmpEngineID: 8009031759DF1AB0
Jun 26 16:49:49.522: snmpEngineBoots: 4 snmpEngineTime: 1046790
Jun 26 16:49:49.522: SNMP: Response, reqid 1631554623, errstat 0, erridx 0
 ccCopyTable.1.14.3221213416 = NO_SUCH_INSTANCE_EXCEPTION
Jun 26 16:49:49.530: SNMP: Packet sent via UDP to 
Jun 26 16:49:49.682: SNMP: Packet received via UDP from  on 
FastEthernet0/0
Jun 26 16:49:49.682:
Incoming SNMP packet
Jun 26 16:49:49.682: v3 packet  security model: v3   security level: noauth
Jun 26 16:49:49.682: username:
Jun 26 16:49:49.682: snmpEngineID: 8009031759DF1AB0
Jun 26 16:49:49.686: snmpEngineBoots: 0 snmpEngineTime: 0
Jun 26 16:49:49.686: SNMP: Report, reqid 1631554624, errstat 0, erridx 0
 internet.6.3.15.1.1.4.0 = 264
Jun 26 16:49:49.690: SNMP: Packet sent via UDP to 
Jun 26 16:49:49.690: SNMP: Packet received via UDP from  on 
FastEthernet0/0
Jun 26 16:49:49.694: SNMP: Set request, reqid 1631554625, errstat 0, erridx 0
 ccCopyTable.1.14.3221214536.1000 = 6
Jun 26 16:49:49.698:
Incoming SNMP packet
Jun 26 16:49:49.698: v3 packet  security model: v3   security level: auth
Jun 26 16:49:49.698: username: userid
Jun 26 16:49:49.698: snmpEngineID: 8009031759DF1AB0
Jun 26 16:49:49.698: snmpEngineBoots: 4 snmpEngineTime: 1046790
Jun 26 16:49:49.698: SNMP: Response, reqid 1631554625, errstat 11, erridx 1
 ccCopyTable.1.14.3221214536.1000 = 6
Jun 26 16:49:49.706: SNMP: Packet sent via UDP to 



Dave Shield <[EMAIL PROTECTED]> wrote: On 26/06/07, Ajay Chenampara  wrote:
> I am assuming you meant me to set the $OID as 1.3.6.1.4.1.9.9.96.1.1.1.1.14
> (without the random index number).

That's correct.
The second parameter to the SNMP::Varbind call is the index value.
So the first two parameters are combined to form the full OID.


> I got the same error
> [noCreation (that table does not support row creation)]

What does the router debug output look like?
What does the same debug output look like when you issue the equivalent
"snmpset" command?

Dave

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users



 
-
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data.

Re: code to tftp download cisco configs.

2007-06-26 Thread Ajay Chenampara
Dave,
I think it works now...
I set the OID to 

$OID = "1.3.6.1.4.1.9.9.96.1.1.1.1.14";
and 

my $vb = new SNMP::Varbind([$OID,'1000','6','INTEGER']);
my $var = $session->set($vb);

and the output is clean.


but now i need to know how to check for the response from the router and look 
for the "6" . 


Ajay Chenampara <[EMAIL PROTECTED]> wrote: Hi there,
I know im overlooking something here and i hope someone here will be able to 
point it out...
Im writing a script to download our s/w and router configs via tftp using snmp 
commands.
the snmpset command from the command prompt works, but my perl script is not. 
What am i goofing up?
As always, all help is very much appreciated!

from the unix prompt:
]$ snmpset -v3   1.3.6.1.4.1.9.9.96.1.1.1.1.14.1000 i 6
SNMPv2-SMI::enterprises.9.9.96.1.1.1.1.14.1000 = INTEGER: 6
I get the expected response of  INTEGER: 6  (the auth params are stored in 
~/.snmp/snmp.conf)


and my perl script is :
my %session_opts = (Community=> $snmp_community,
 DestHost =>  $snmp_host,
 RemotePort   => '161',
 Timeout  => '200',
Retries  =>  '5',
 Version  => $version,
 AuthProto=> $AuthProto,
 PrivProto=>  $PrivProto,
 AuthPass => $AuthPass,
 PrivPass => $PrivPass,
 SecName  => $SecName,
 SecLevel => $SecLevel,
 UseNumeric   => 1,
 UseLongNames => 1);
   my $session = new SNMP::Session(%session_opts);
my $vb = new  SNMP::Varbind([$OID,'0','6','INTEGER']);
my $var = $session->set($vb);
warn("set original vals=[$vars], oidvalue=[$OID], errNo=[$session->{ErrorNum}], 
errStr=[$session->{ErrorStr}]\n");


which i execute to get :
set original vals=[], oidvalue=[1.3.6.1.4.1.9.9.96.1.1.1.1.14.1000], 
errNo=[11], errStr=[noCreation (that table does not support row creation)]


My Router debug output is: 


Jun 25 21:35:00.408: v3 packet  security model: v3   security level: noauth
Jun 25 21:35:00.408: username:
Jun 25 21:35:00.408: snmpEngineID: 8009031759DF1AB0
Jun 25 21:35:00.408: snmpEngineBoots: 0 snmpEngineTime: 0
Jun 25 21:35:00.408: SNMP: Report, reqid 285558921, errstat 0, erridx 0
 internet.6.3.15.1.1.4.0 = 230
Jun 25 21:35:00.412: SNMP: Packet sent via UDP to 
Jun 25 21:35:00.416: SNMP: Packet received via UDP from  on  
FastEthernet0/0
Jun 25 21:35:00.416: SNMP: Get request, reqid 285558922, errstat 0, erridx 0
 ccCopyTable.1.14.1000 = NULL TYPE/VALUE
Jun 25 21:35:00.424:
Incoming SNMP packet
Jun 25 21:35:00.424: v3 packet  security model: v3   security level: auth
Jun 25 21:35:00.424: username: 
Jun 25 21:35:00.424: snmpEngineID: 8009031759DF1AB0
Jun 25 21:35:00.424: snmpEngineBoots: 4 snmpEngineTime: 977502
Jun 25 21:35:00.424: SNMP: Response, reqid 285558922, errstat 0, erridx 0
 ccCopyTable.1.14.1000 = NO_SUCH_INSTANCE_EXCEPTION
Jun 25 21:35:00.432: SNMP: Packet sent via UDP to 
Jun 25 21:35:00.584: SNMP: Packet received via UDP from  on 
FastEthernet0/0
Jun 25 21:35:00.584:
Incoming SNMP packet
Jun 25 21:35:00.584: v3 packet  security model: v3   security level: noauth
Jun 25 21:35:00.588:  username:
Jun 25 21:35:00.588: snmpEngineID: 8009031759DF1AB0
Jun 25 21:35:00.588: snmpEngineBoots: 0 snmpEngineTime: 0
Jun 25 21:35:00.588: SNMP: Report, reqid 285558923, errstat 0, erridx 0
 internet.6.3.15.1.1.4.0 = 231
Jun 25 21:35:00.592: SNMP: Packet sent via UDP to 
Jun 25 21:35:00.592: SNMP: Packet received via UDP from  on 
FastEthernet0/0
Jun 25 21:35:00.596: SNMP: Set request, reqid 285558924, errstat 0, erridx 0
 ccCopyTable.1.14.1000.0 = 6
Jun 25 21:35:00.600:
Incoming SNMP packet
Jun 25 21:35:00.600: v3 packet  security model: v3   security level: auth
Jun 25 21:35:00.600: username: 
Jun 25 21:35:00.600: snmpEngineID: 8009031759DF1AB0
Jun 25 21:35:00.600: snmpEngineBoots: 4 snmpEngineTime: 977502
Jun 25 21:35:00.600: SNMP: Response, reqid 285558924, errstat 11, erridx  1
 ccCopyTable.1.14.1000.0 = 6
Jun 25 21:35:00.608: SNMP: Packet sent via UDP to 






-
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.  
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


   
-
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Che

netbsd 3.0 and net-snmp-5.4.1.pre3, walking UCD mib hangs snmpd

2007-06-26 Thread Ed Ravin
I just built net-snmp-5.4.1.pre3 on NetBSD 3.0.  When I walk the UCD
MIB, it hangs snmpd.

In my MIB, are a couple of 'exec' extensions that run a few shell scripts.
When I walk the UCD MIB, I get this:

   UCD-SNMP-MIB::extResult.1 = INTEGER: 0
   UCD-SNMP-MIB::extResult.2 = INTEGER: 1
   UCD-SNMP-MIB::extResult.3 = INTEGER: 0
   UCD-SNMP-MIB::extResult.4 = INTEGER: 1
   UCD-SNMP-MIB::extResult.5 = INTEGER: 1
   Timeout: No Response from localhost

At this point, snmpd stops responding to all queries and begins munching
all available CPU time.  When I ktruss it I see an infinite loop like this:

  4980 net-snmpd break(0xbec8000)  = 0
  4980 net-snmpd break(0xbec8000)  = 0
  4980 net-snmpd break(0xa0ae000)  = 0
  4980 net-snmpd break(0xbed)  = 0
  4980 net-snmpd break(0xbed)  = 0
  4980 net-snmpd break(0xa0b2000)  = 0
  4980 net-snmpd break(0xbed8000)  = 0
  4980 net-snmpd break(0xbed8000)  = 0
  4980 net-snmpd break(0xa0b6000)  = 0
  4980 net-snmpd break(0xbee)  = 0
  4980 net-snmpd break(0xbee)  = 0
  4980 net-snmpd break(0xa0ba000)  = 0

And it won't die unless I "kill -9" it.

Removing the "exec" entries fixed the problem.  The "exec" entries
are a bunch of harmless tests:

  exec TestTrue /usr/bin/true
  exec TestFalse /usr/bin/false
  exec TestEcho /bin/echo hello
  exec TestFrog /usr/local/nothere/bin/frog dog
  exec TestLs /usr/bin/ls /usr/local/piffle

Any idea how to debug this further?

Note that in my environment, I can't even run "configure" successfully
without applying a bunch of patches from NetBSD's pkgsrc project.  But
I've applied the same patches in the past to 5.4 and never seen anything
like this.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: code to tftp download cisco configs.

2007-06-26 Thread Brian A. Seklecki
On Mon, 2007-06-25 at 14:37 -0700, Ajay Chenampara wrote:
> Hi there,
> I know im overlooking something here and i hope someone here will be
> able to point it out...
> Im writing a script to download our s/w and router configs via tftp
> using snmp commands.


It helps to load the MIB "CISCO-CONFIG-COPY-MIB".  Note about this
script, it should poll() ccCopyEntryRowStatus.2 before read()/write(),
but this this is blind faith.

~BAS




$ more signalIOSBackup.sh 
#!/usr/local/bin/bash

# $Id: signalIOSBackup.sh 209 2007-06-26 17:38:25Z seklecki $ 
# Brian A. Seklecki - Collaborative Fusion, Inc.

function usage() {
echo "USAGE:"
echo "  $0 [Destination IP/Hostname]"
}

if [ ! -n "${1}" ]; then
echo "Destination Radware Device Not Specified, BAILING!"
usage;
exit 1;
fi

# Options
COMMUNITY=foo

export MIBS=CISCO-CONFIG-COPY-MIB

SNMPSET="/usr/local/bin/snmpset"

SNMPOPT="-c ${COMMUNITY} -v2c "
SNMPSET="${SNMPSET} ${SNMPOPT}"

#FACILITY=pitbpa1

# Default New TFTP Destination Config
if [ -n "${2}" ]; then
TFTP_DESTINATION="$2";
else 
TFTP_DESTINATION=192.168.96.39;
fi

# first set it to CLI mode
$SNMPSET ${1} ccCopyProtocol.2 i 1 \
ccCopySourceFileType.2 i 4   \
ccCopyDestFileType.2 i 1 \
ccCopyServerAddress.2 a "${TFTP_DESTINATION}" \
ccCopyFileName.2 s "${1}.txt" \
ccCopyEntryRowStatus.2 i 4

if [ $? -ne 0 ]; then
echo "SNMP Signal to ${1} failed";
exit 1;
fi

sleep 5;

$SNMPSET ${1} ccCopyEntryRowStatus.2 i 6


---


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


SNMP canonical formats

2007-06-26 Thread Ajay Chenampara
from the link http://net-snmp.sourceforge.net/docs/perl-SNMP-README.html
the canonical formats for snmp  are as below:
but how do i set a "STRING" in that case ( to pass the tftp file name info for 
eg)

OBJECTID => dotted-decimal (e.g., .1.3.6.1.2.1.1.1)
   OCTETSTR => perl scalar containing octets,
  INTEGER => decimal signed integer (or enum),
   NETADDR => dotted-decimal,
   IPADDR => dotted-decimal,
   COUNTER => decimal unsigned integer,
   COUNTER64  => decimal unsigned integer,
   GAUGE,  => decimal unsigned integer,
   UINTEGER,  => decimal unsigned integer,
TICKS,  => decimal unsigned integer,
OPAQUE => perl scalar containing octets,
  NULL,  => perl scalar containing nothing,


"Brian A. Seklecki" <[EMAIL PROTECTED]> wrote: On Mon, 2007-06-25 at 14:37 
-0700, Ajay Chenampara wrote:
> Hi there,
> I know im overlooking something here and i hope someone here will be
> able to point it out...
> Im writing a script to download our s/w and router configs via tftp
> using snmp commands.


It helps to load the MIB "CISCO-CONFIG-COPY-MIB".  Note about this
script, it should poll() ccCopyEntryRowStatus.2 before read()/write(),
but this this is blind faith.

~BAS




$ more signalIOSBackup.sh 
#!/usr/local/bin/bash

# $Id: signalIOSBackup.sh 209 2007-06-26 17:38:25Z seklecki $ 
# Brian A. Seklecki - Collaborative Fusion, Inc.

function usage() {
echo "USAGE:"
echo "  $0 [Destination IP/Hostname]"
}

if [ ! -n "${1}" ]; then
echo "Destination Radware Device Not Specified, BAILING!"
usage;
exit 1;
fi

# Options
COMMUNITY=foo

export MIBS=CISCO-CONFIG-COPY-MIB

SNMPSET="/usr/local/bin/snmpset"

SNMPOPT="-c ${COMMUNITY} -v2c "
SNMPSET="${SNMPSET} ${SNMPOPT}"

#FACILITY=pitbpa1

# Default New TFTP Destination Config
if [ -n "${2}" ]; then
TFTP_DESTINATION="$2";
else 
TFTP_DESTINATION=192.168.96.39;
fi

# first set it to CLI mode
$SNMPSET ${1} ccCopyProtocol.2 i 1 \
ccCopySourceFileType.2 i 4   \
ccCopyDestFileType.2 i 1 \
ccCopyServerAddress.2 a "${TFTP_DESTINATION}" \
ccCopyFileName.2 s "${1}.txt" \
ccCopyEntryRowStatus.2 i 4

if [ $? -ne 0 ]; then
echo "SNMP Signal to ${1} failed";
exit 1;
fi

sleep 5;

$SNMPSET ${1} ccCopyEntryRowStatus.2 i 6


---



   
-
Got a little couch potato? 
Check out fun summer activities for kids.-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: solaris 10 x86 problem building snmptrapd 5.4.1-pre3

2007-06-26 Thread Thomas Anders
Ed Ravin wrote:
> I tried it.  It worked!  Here's the edit I made to apps/Makefile:

I've just applied a similar change to the 5.4.x SVN branch and trunk. It
will be in 5.4.1.rc1 and later.


+Thomas

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


Re: Patch to net-snmp 5.2.3-7 (debian) to provide netlink-based link state trap generation

2007-06-26 Thread Wes Hardaker

ML> My apologies ahead of time for the vintage of net-snmp that I've
ML> applied this to. The patch is relatively small, and should hopefully
ML> be easily adaptable to more recent versions.

We appreciate the submission none the less (we'd love a more recent
patch, but we will take what we can get).

Can you do me a favor and submit it to the patch database, though, so we
don't lose it: http://www.net-snmp.org/patches/
-- 
Wes Hardaker
Sparta, Inc.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users