Hello there, In the last problem that i have encountered, i didn't understand what was going wrong. Now I think I do. I'm using net-snmp 5.3.2 and I'm trying to send multi destiny traps from a unix based system (the agent).
In linux, net-snmp works fine and sends the multi destiny traps that I required. When I pass to the unix based system, this option gives the error that I exposed in passed mails. Back at that time, I solved the problem by altering the source code but as Dave said it was not the best way of doing it. Today I decided to dedicate some time to that unsolved issue and I realised that in linux the net-snmp uses /usr/bin/getopt function in snmp_parse_args.c and in the unix based system that function doesn't exists on the system. I also notice that net-snmp defines a getopt() function (@getopt.c) of its own but I'm having trouble in using it. Could anyone tell me if there is any flag that I can pass on configure or other option or even a faq or a manual where I can learn how to do it? (How to tell to the compiler to use the net-snmp getopt function and not the system function?!) Thanks in advance. Best Regards / Cumprimentos, Sérgio Cabaço -----Original Message----- From: Sergio Cabaço [mailto:[email protected]] Sent: segunda-feira, 9 de Março de 2009 14:47 To: Dave Shield Cc: [email protected]; [email protected] Subject: RE: Multi-destiny Traps Hi, The snmpd.conf file with i'm doing the multi destiny tests is something like this: agentaddress aaa.ddd.ddd.rrr engineID 0123456789 trapsess -v 3 -u xpto -A xpto -l noauthnopriv xxx.xxx.xxx.xxx:111 trapsess -v 3 -u ypto -A ypto -l noauthnopriv yyy.yyy.yyy.yyy:222 rwuser ... rwuser ... createUser ... createUser ... When I try to run the agent with this configuration file, for testing the traps to multi-destinies, the output presents something like this: read_config: snmpd.conf:5 examining: trapsess -v 3 -u xpto -A xpto -l noauthnopriv xxx.xxx.xxx.xxx:xxx trace: run_config_handler(): read_config.c, 498: read_config: Found a parser. Calling it: trapsess -v 3 -u ypto -A ypto -l noauthnopriv xxx.xxx.xxx.xxx:yyy trace: snmp_parse_args(): snmp_parse_args.c, 234: snmp_parse_args: starting: 10/10 trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 0 = snmpd-trapsess trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 1 = -v trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 2 = 3 trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 3 = -u trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 4 = xpto trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 5 = -A trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 6 = xpto trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 7 = -l trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 8 = noauthnopriv trace: snmp_parse_args(): snmp_parse_args.c, 236: snmp_parse_args: arg 9 = xxx.xxx.xxx.xxx:xxx trace: snmp_parse_args(): snmp_parse_args.c, 239: snmp_parse_args: ended for that runs over args Segmentation fault Without the changes made, this error stops and net-snmp executes well and sends the traps. Thanks, S.C. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield Sent: segunda-feira, 9 de Março de 2009 12:21 To: Sergio Cabaço Cc: [email protected]; [email protected] Subject: Re: Multi-destiny Traps 2009/3/9 Sergio Cabaço <[email protected]>: > I've made a change in file snmp_parse_args.c to correct a problem that I had. > The problem was notice when I tried to send multi-destiny traps using their > definitions in snmpd.conf. > Every time I've tried, an error was launched by the agent pointing to the > file mentioned above. > > The change made in the source code was this: > > While((arg=getopt(argc,.... --to--> While((arg=getopt(argc-1,.... > > > I don't know if anyone has had any similar problem or if this is the correct > manner of resolving the problem. > I was hopping that you could give me some feedback about this issue and its > resolution. I doubt very much that this is the correct fix. You say that the agent reports "an error ... pointing to the file mentioned above". What is the text of this error? What is the config setting that it's complaining about? Dave ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
