RE: snmptrap - library calls

2009-05-08 Thread Vinod Nanjaiah

From: dave.shi...@googlemail.com [mailto:dave.shi...@googlemail.com]
 There doesn't seem to be any sample program available on the net for traps.

apps/snmptrap.c

I used the snmptrap.c from net-snmp version 5.4.2 and this is what I observed.

1 I am able to send a generic trap once
2 the second time I try to send the trap (from within the same client 
application) it fails with the following error messages:
-- No support for requested transport domain udp
snmptrap: Unknown host (172.22.64.103) (No such file or directory)

I am unable to figure out the reason for this.
Any pointers please!

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 - 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


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