snmpd threadedness

2009-05-07 Thread Robert Voigt
Hi,

I've heard that snmpd, when operating as a proxy, forwards one SET
request at a time and buffers all other requests until the SET response
arrives. 

This 'feature' would be valuable for me if it worked with all types of
requests. I need to send SNMP over a half duplex connection that
currently has no other means to negotiate who can send. 

If I proxied the requests of all managers through snmpd and it sent one
request at a time, buffering other requests until the response arrives,
this would nicely avoid collisions.

I haven't found a configuration option to get this behavior, and I
haven't looked at the source code yet. If there is an easy way to do it,
like setting the number of threads for requests to one, I'd be glad to
hear about it.

Robert

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


Agent Shutdown problem

2009-05-07 Thread sanjaykumar




Hi all, 

I am running the netsnmp 5.4.2.1 as thread 
1 : 
I am facing the problem while my application reboot so snmp thread
should also
Most of shutdown problem is occurs in mib module 
Basically when application reboot then it facing problem in "init_mib_modules()"
and it crash.
Backtrace show that most of crash come after "netsnmp_container_get_ct"
I run the valgrind and getting most of the same problem
Could anybody suggest what could be reason of this crash ???
One of Backtrace for the reference :

***
#0 0x0811f416 in netsnmp_container_get_ct (type=0x82b63e8
"udpEndpointTable") at container.c:189
#1 0x0811f489 in netsnmp_container_find_ct (type_list=0x81c57dc
"udpEndpointTable:table_container") at container.c:208
#2 0x0811f539 in netsnmp_container_find (type=0x81c57dc
"udpEndpointTable:table_container") at container.c:240
#3 0x0810c717 in _udpEndpointTable_container_init (if_ctx=0x81e6fc0)
 at udp-mib/udpEndpointTable/udpEndpointTable_interface.c:1031
#4 0x0810b9a9 in _udpEndpointTable_initialize_interface
(reg_ptr=0x82b6460, flags=0)
 at udp-mib/udpEndpointTable/udpEndpointTable_interface.c:191
#5 0x080ee798 in shutdown_table_udpEndpointTable () at
udp-mib/udpEndpointTable/udpEndpointTable.c:130
#6 0x080ee743 in shutdown_udpEndpointTable () at
udp-mib/udpEndpointTable/udpEndpointTable.c:76
#7 0x080df91f in init_mib_modules () at ./mib_module_inits.h:100
#8 0x080d5448 in snmpd (args=0x82b6498) at snmpd.c:1016
#9 0xb7d7f1b3 in start_thread () from /lib/libpthread.so.0
#10 0xb7e6103e in clone () from /lib/libc.so.6



2 :
While application shutdown "
snmp_shutdown(app_name)" getting called 
what about the " shutdown_master_agent() and
 shutdown_agent()" 
How the respective functionalities achieved by AGENT as in code it
maintained that 
it cause the broken code 
respective code for the reference : 
***
snmp_shutdown(app_name);
#ifdef SHUTDOWN_AGENT_CLEANLY /* broken code */
 /* these attempt to free all known memory, but result in double
frees */
 shutdown_master_agent();
 shutdown_agent();
#endif

**


Thanks and best regards,
Sanjay Kumar



--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
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


snmptrap - library calls

2009-05-07 Thread Vinod Nanjaiah

 Dear Experts,
 I did not find much information in net-snmp website about how to implement
 an application to send traps. Can you please give me some pointers to the
 same?

 Regards,
 Vinod

man snmptrap

Well, snmptrap can be used from command line to send traps.

But, what I am looking for is to make use of snmp library calls to generate 
traps - for example, by using send_easy_trap () or snmp_v2trap () functions.

From what I could gather I am trying to use send_easy_trap () with 2 int 
parameters.
But compilation fails on trying - gcc x.c -lnetsnmp -lnetsnmptrapd.

There doesn't seem to be any sample program available on the net for traps.

Regards,
Vinod

--
Dr. Michael Schwartzkopff
MultiNET Services GmbH
Addresse: Bretonischer Ring 7; 85630 Grasbrunn; Germany
Tel: +49 - 89 - 45 69 11 0
Fax: +49 - 89 - 45 69 11 21
mob: +49 - 174 - 343 28 75


http://www.mindtree.com/email/disclaimer.html

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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: snmptrap - library calls

2009-05-07 Thread Dave Shield
2009/5/7 Vinod Nanjaiah vinod_nanja...@mindtree.com:
 Well, snmptrap can be used from command line to send traps.

 But, what I am looking for is to make use of snmp library calls to
 generate traps - for example, by using send_easy_trap () or snmp_v2trap () 
 functions.

You can't - those are part of the *agent* trap API.

If you are sending notifications from a client application,
then you use the techniques for sending normal SNMP requests,
as illustrated by the code for snmptrap.


 There doesn't seem to be any sample program available on the net for traps.

apps/snmptrap.c


Dave

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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: snmptrap - library calls

2009-05-07 Thread Vinod Nanjaiah
From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com]
 Well, snmptrap can be used from command line to send traps.

 But, what I am looking for is to make use of snmp library calls to
 generate traps - for example, by using send_easy_trap () or snmp_v2trap () 
 functions.

 You can't - those are part of the *agent* trap API.

Does this mean that these can only be used from within the code of a snmp 
agent/subagent?


 If you are sending notifications from a client application,
 then you use the techniques for sending normal SNMP requests,
 as illustrated by the code for snmptrap.


 There doesn't seem to be any sample program available on the net for traps.

apps/snmptrap.c


Regards,
Vinod

http://www.mindtree.com/email/disclaimer.html

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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: snmptrap - library calls

2009-05-07 Thread Dave Shield
2009/5/7 Vinod Nanjaiah vinod_nanja...@mindtree.com:
 But, what I am looking for is to make use of snmp library calls to
 generate traps - for example, by using send_easy_trap () or snmp_v2trap () 
 functions.

 You can't - those are part of the *agent* trap API.

 Does this mean that these can only be used from within the code of a snmp 
 agent/subagent?

Yes

Dave

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


Timeout: No Response from destination-server

2009-05-07 Thread Margus Roo
Hi

I have two server-rooms (DZ-A and DZ-B)

in DZ-A there is a server called client-server and in a DZ-B there is a 
monitoring server called monitoring-server.

if i do in monitoring-server i got:
~# snmpwalk -c sw client-server -v1
Timeout: No Response from client-server
 ~#
I have a connection between monitoring-server and client-server:
15:23:00 root[load: 0@monitoring-server ~# ping client-server
PING client-server (xxx.xxx.xxx.xxx) 56(84) bytes of data.
64 bytes from client-server (xxx.xxx.xxx.xxx): icmp_seq=1 ttl=56 
time=1.23 ms
...

--- client-server ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 0.842/1.346/1.962/0.464 ms
15:26:18 root[load: 0@monitorin-server ~#

15:26:18 root[load: 0@monitoring-server ~# nmap -sU -v -p 161 
client-server

Starting Nmap 4.68 ( http://nmap.org ) at 2009-05-07 15:27 EEST
Initiating Ping Scan at 15:27
Scanning 194.106.120.83 [2 ports]
Completed Ping Scan at 15:27, 0.03s elapsed (1 total hosts)
Initiating UDP Scan at 15:27
Scanning client-server (xxx.xxx.xxx.xxx) [1 port]
Completed UDP Scan at 15:27, 0.23s elapsed (1 total ports)
Host client-server (xxx.xxx.xxx.xxx) appears to be up ... good.
Interesting ports on client-server (xxx.xxx.xxx.xxx):
PORTSTATE SERVICE
161/udp open|filtered snmp

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.322 seconds
   Raw packets sent: 4 (124B) | Rcvd: 1 (46B)
15:27:34 root[load: 0@monitoring-server ~#


15:14:16 root[load: 0@client-server ~# ps aux | grep snmpd
root 24039  0.0  0.8   8992  4248 ?SMay06   0:05 
/usr/sbin/snmpd -Lsd -p /var/run/snmpd.pid
root 26410  0.0  0.0   1712   452 pts/3S+   15:14   0:00 grep snmpd
15:14:34 root[load: 0@beast ~# netstat -ln | grep 161
udp0  0 0.0.0.0:161 
0.0.0.0:*  
15:29:31 root[load: 0@beast ~#

15:29:31 root[load: 0@client-server ~# ping monitoring-server
PING monitoring-server (xxx.xxx.xxx.xxx) 56(84) bytes of data.

--- monitoring-server ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 0.934/1.265/1.803/0.384 ms
15:30:12 root[load: 0@client-server ~#

so looks like there are no connection and firewall problems

client-server snmpd.local.conf:
com2sec local client-server sw
com2sec local xxx.xxx.xxx.xxx (-- client-server IP) sw
com2sec local monitoring-server sw


group MyRWGroup any local

view allincluded  .1   80

access MyROGroup   any   noauthexact  allnone   none
access MyRWGroup   any   noauthexact  allallnone


SNMPD is running: root 24039  0.0  0.8   8992  4248 ?S
May06   0:05 /usr/sbin/snmpd -Lsd -p /var/run/snmpd.pid
and in both servers: NET-SNMP version:  5.4.2.1


---
Any ideas?



-- 

Best regards,
Margus Roo - Delfi IT Support Team Manager
+3725148780
skype: margusja
msn: margu...@kodila.ee
homepage: http://margusja.pri.ee


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


sysUpTimeInstance vs sysUpTime.0

2009-05-07 Thread Peter Hicks
Hello

How should the retrieval of sysUpTime.0 be handled in SNMP.pm?

DISMAN-EVENT-MIB defines sysUpTime.0 as sysUpTimeInstance, which appears 
to confuse SNMP.pm, returning a VarBind without an instance:

$VAR1 = bless( [
 'sysUpTimeInstance',
 '',
 '139192193',
 'TICKS'
   ], 'SNMP::Varbind' );

Is this intended behaviour?  How should I work around it in an 
application which assumes that requesting OID 'sysUpTime' and instance 0 
will return the same OID and instance in the returned VarBind?


Peter

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


Timeout: No Response from client-server

2009-05-07 Thread Margusja
Hi

I have two server-rooms (DZ-A and DZ-B)

in DZ-A there is a server called client-server and in a DZ-B there is a 
monitoring server called monitoring-server.

if i do in monitoring-server i got:
~# snmpwalk -c sw client-server -v1
Timeout: No Response from client-server
~#
I have a connection between monitoring-server and client-server:
15:23:00 root[load: 0@monitoring-server ~# ping client-server
PING client-server (xxx.xxx.xxx.xxx) 56(84) bytes of data.
64 bytes from client-server (xxx.xxx.xxx.xxx): icmp_seq=1 ttl=56 
time=1.23 ms
...

--- client-server ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 0.842/1.346/1.962/0.464 ms
15:26:18 root[load: 0@monitorin-server ~#

15:26:18 root[load: 0@monitoring-server ~# nmap -sU -v -p 161 
client-server

Starting Nmap 4.68 ( http://nmap.org ) at 2009-05-07 15:27 EEST
Initiating Ping Scan at 15:27
Scanning 194.106.120.83 [2 ports]
Completed Ping Scan at 15:27, 0.03s elapsed (1 total hosts)
Initiating UDP Scan at 15:27
Scanning client-server (xxx.xxx.xxx.xxx) [1 port]
Completed UDP Scan at 15:27, 0.23s elapsed (1 total ports)
Host client-server (xxx.xxx.xxx.xxx) appears to be up ... good.
Interesting ports on client-server (xxx.xxx.xxx.xxx):
PORTSTATE SERVICE
161/udp open|filtered snmp

Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 0.322 seconds
  Raw packets sent: 4 (124B) | Rcvd: 1 (46B)
15:27:34 root[load: 0@monitoring-server ~#


15:14:16 root[load: 0@client-server ~# ps aux | grep snmpd
root 24039  0.0  0.8   8992  4248 ?SMay06   0:05 
/usr/sbin/snmpd -Lsd -p /var/run/snmpd.pid
root 26410  0.0  0.0   1712   452 pts/3S+   15:14   0:00 grep snmpd
15:14:34 root[load: 0@beast ~# netstat -ln | grep 161
udp0  0 0.0.0.0:161 
0.0.0.0:*  15:29:31 root[load: 0@beast ~#

15:29:31 root[load: 0@client-server ~# ping monitoring-server
PING monitoring-server (xxx.xxx.xxx.xxx) 56(84) bytes of data.

--- monitoring-server ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 0.934/1.265/1.803/0.384 ms
15:30:12 root[load: 0@client-server ~#

so looks like there are no connection and firewall problems

client-server snmpd.local.conf:
com2sec local client-server sw
com2sec local xxx.xxx.xxx.xxx (-- client-server IP) sw
com2sec local monitoring-server sw


group MyRWGroup any local

view allincluded  .1   80

access MyROGroup   any   noauthexact  allnone   none
access MyRWGroup   any   noauthexact  allallnone


SNMPD is running: root 24039  0.0  0.8   8992  4248 ?S
May06   0:05 /usr/sbin/snmpd -Lsd -p /var/run/snmpd.pid
and in both servers: NET-SNMP version:  5.4.2.1


---
Any ideas?

-- 

Best regards, Margus Margusja Roo
+3725148780
skype: margusja
msn: margu...@kodila.ee
homepage: http://margusja.pri.ee


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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: snmptrap - library calls

2009-05-07 Thread Vinod Nanjaiah

From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com] On Behalf 
Of Dave Shield

 There doesn't seem to be any sample program available on the net for traps.

apps/snmptrap.c

Thanks Dave.
I was able to successfully send a trap using the code from snmptrap.c.
But, when I try to send a trap the second time, it fails and gives the 
following error messages.

--No support for requested transport domain udp
--snmptrap: Unknown host (localhost) (No such file or directory)

What could be the reason?

Regards,
Vinod

http://www.mindtree.com/email/disclaimer.html

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


snmptrap

2009-05-07 Thread pch0317

Hello,
I have problem. I send SNMPv2 Trap message and analyse packet. But I 
don't understand some bytes.

I type:
snmptrap -v 2c -c private 127.0.0.1 5 1.3.6.1.2.1.1.1.0
and I receive:
30 43 02 01 01 04 07 70 72 69 76 61 74 65 A7 35 02 04 64 AF 4E 32 02 01 
00 02 01 00 30 27 30 0D 06 08 2B 06 01 02 01 01 03 00 43 01 05 30 16 06 
0A 2B 06 01 6F FD 02 4A AE 92 08 00 5E 00 00 00 8B 00 00 00 00


I know that:
30 43 - is a type and length of message
02 01 01 - is a type, length and snmp version (SNMPv2 here)
04 07 70 72 69 76 61 74 65 - type, length and string private
A7 35 - is it a type of message (Trap v2) and length of it
02 04 64 AF 4E 32 - is a type length and ??? Is it a number of message? 
Why its length is 4 bytes?
02 01 00 02 01 00 - is a type, length and value of error status and 
error index

30 27 - type and length
30 0D - type and length
06 08 2B 06 01 02 01 01 03 00 43 01 05 - ??? It is similar to 
1.3.6.1.2.1.1.1.0

30 16 - type and length
06 0A 2B 06 01 6F FD 02 4A AE 92 08 00 5E 00 00 00 8B 00 00 00 00 - ???

Please, help me where is ??? sign. Do I write correctly the snmptrap 
command?

Thanks
pch0317
--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
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: sysUpTimeInstance vs sysUpTime.0

2009-05-07 Thread Mike Ayers
 From: Peter Hicks [mailto:peter.hi...@poggs.co.uk] 
 Sent: Thursday, May 07, 2009 5:53 AM

 DISMAN-EVENT-MIB defines sysUpTime.0 as sysUpTimeInstance, 
 which appears 
 to confuse SNMP.pm, returning a VarBind without an instance:
 
 $VAR1 = bless( [
  'sysUpTimeInstance',
  '',
  '139192193',
  'TICKS'
], 'SNMP::Varbind' );
 
 Is this intended behaviour?  How should I work around it in an 
 application which assumes that requesting OID 'sysUpTime' and 
 instance 0 
 will return the same OID and instance in the returned VarBind?

Use numerical OIDs - they will always match.


HTH,

Mike

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


net-snmp-5.4.1-3 UCD-SNMP-MIB::memTotalFree on Win2003 question

2009-05-07 Thread Girshik, Stanley
Hello all, 

I ran into some problems with my favorite MIB on win2003, 

 

I've installed and configured net-snmp-5.4.1-3 on windows 2003 and it
seems to be working fine.

However when I try to  :

 

snmpwalk -v 3 -u myuserid -l authNoPriv -a MD5 -A mylongandvalidpassword
localhost  .1.3.6.1.4.1.2021.4.11 

 

I get

 

UCD-SNMP-MIB::memTotalFree = No Such Object available on this agent at
this OID

 

I observe this behavior on windows only, it works perfectly on RH4.

SNMP is configured correctly since it works for other MIBs.

 

Thank you 

-Stan

 

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
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: sysUpTimeInstance vs sysUpTime.0

2009-05-07 Thread Peter Hicks
Mike Ayers wrote:

 From: Peter Hicks [mailto:peter.hi...@poggs.co.uk] 
 Sent: Thursday, May 07, 2009 5:53 AM
 
 DISMAN-EVENT-MIB defines sysUpTime.0 as sysUpTimeInstance, 
 which appears to confuse SNMP.pm, returning a VarBind without
  an instance...
 
  [snip]
 
 Is this intended behaviour?  How should I work around it in an 
 application which assumes that requesting OID 'sysUpTime' and 
 instance 0 will return the same OID and instance in the returned VarBind?
 
 Use numerical OIDs - they will always match.

Ick, that's horrendously ugly and makes code very difficult to read.

What I did was to check for an instance in the returned VarBind, and if 
there's no instance, convert the OID to numeric format, lop off the last 
element (in this case, 0) and use that as the instance, then convert 
the OID back to text.

Works like a treat and I save my full-stop key and the sanity of anyone 
else looking at my code :-)


Peter

-- 
Peter Hicks | e: my.n...@poggs.co.uk | g: 0x5DA31330 | w: www.poggs.com

   A: Because it destroys the flow of the conversation
   Q: Why is top-posting bad?

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


snmptrap -v 2c

2009-05-07 Thread pch0317
Hello,
I have problem. I send SNMPv2 Trap message and analyse packet. But I 
don't understand some bytes.
I type:
snmptrap -v 2c -c private 127.0.0.1 5 1.3.6.1.2.1.1.1.0
and I receive:
30 43 02 01 01 04 07 70 72 69 76 61 74 65 A7 35 02 04 64 AF 4E 32 02 01 
00 02 01 00 30 27 30 0D 06 08 2B 06 01 02 01 01 03 00 43 01 05 30 16 06 
0A 2B 06 01 6F FD 02 4A AE 92 08 00 5E 00 00 00 8B 00 00 00 00

I know that:
30 43 - is a type and length of message
02 01 01 - is a type, length and snmp version (SNMPv2 here)
04 07 70 72 69 76 61 74 65 - type, length and string private
A7 35 - is it a type of message (Trap v2) and length of it
02 04 64 AF 4E 32 - is a type length and ??? Is it a number of message? 
Why its length is 4 bytes?
02 01 00 02 01 00 - is a type, length and value of error status and 
error index
30 27 - type and length
30 0D - type and length
06 08 2B 06 01 02 01 01 03 00 43 01 05 - ??? It is similar to 
1.3.6.1.2.1.1.1.0
30 16 - type and length
06 0A 2B 06 01 6F FD 02 4A AE 92 08 00 5E 00 00 00 8B 00 00 00 00 - ???

Please, help me where is ??? sign. Do I write correctly the snmptrap 
command?
Thanks
pch0317

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


LOGOPTS issue with log to standard output

2009-05-07 Thread Brandon Wigfield
In the man page I see the following:

-L LOGOPTS        Toggle various defaults controlling logging:
              e:   log to standard error
              o:   log to standard output

This excites me very much because I'm in a situation where it would be
advantageous for me to capture errors from STDOUT rather than from
STDERR.

If I run the command:
 snmpget -v1 -ccommString  -Lo 172.16.x.x  .1.2.3.4.5.6.7.8.9

I get back in my terminal
 Error in packet
 Reason: (noSuchName) There is no such variable name in this MIB.
 Failed object: iso.2.3.4.5.6.7.8.9

however if I run the command:
 snmpget -v1 -ccommString  -Lo 172.16.x.x .1.2.3.4.5.6.7.8.9 2 foo
I get no response at the terminal but the file foo contains the same
error message that I got above. So I am getting the error message on
STDERR and not on STDOUT as I would expect.

Am I reading the man page wrong here? Additionally I have tried this
on both linux and windows systems and because of the situation I'm in
I would prefer to have the errors emitted on STDOUT rather than STDERR
because I do not want to use the shell to do the work with the usual
21


Any help or suggestions greatly appreciated.

--
Brandon Wigfield

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
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


net-snmp dependency for SUN4u

2009-05-07 Thread Anders Wei
All:

I am trying to compile net-snmp in Sun Solaris 10 X64, but it seems it
needs support of SUN4U library.

In ucd-snmp/lmSensors.c: it includes this file:
/usr/platform/sun4u/include/sys/envctrl.h which is a part of SUN4U
support, I am using SunStudio compilers and I didn't find this library.
Even I searched a lot in GOOGLE and almost find nothing helps.

Does anyone know where to download this SUN4U package?

Thanks.



--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com___
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