RE: thread-safe support of snmpd

This is a discussion on RE: thread-safe support of snmpd within the SNMP Coders forums, part of the Networking and Network Related category; Hello, Talking about multithreads... I wonder, how can I implement sending traps in agent, triggered from some other thread that ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-29-2005
Grasic Igor
 
Posts: n/a
Default RE: thread-safe support of snmpd


Hello,

Talking about multithreads...

I wonder, how can I implement sending traps in agent, triggered from some
other thread that listen independent events?

In other words: I have snmpd thread that reacts on snmpXXX events. Where and
how in the agent I should add code that also sends traps depending on the
external event in the system checks (periodicaly/asynchronously) some
status?

Thanks in advance,
Igor G.


Igor Grasic, Ms. D.
Development Engineer
Iskra Transmission, d. d., Ljubljana
Stegne 11, SI-1000 Ljubljana, Slovenia
phone: +386 1 5003 000
fax: +386 1 5003 500
www.iskratr.si, www.iskratr.com






From: Toth, Gregory S <gregory@bo...>
RE: thread-safe support of snmpd
2005-03-28 09:04

You can also wrap all calls to the net-snmp api with mutex"s

-----Original Message-----
From: Robert Story [mailto:rstory@fr...]
Sent: Monday, March 28, 2005 8:44 AM
To: lglyahoo-misc@ya...
Cc: net-snmp-coders@li...
Subject: Re: thread-safe support of snmpd


On Mon, 28 Mar 2005 18:38:31 +0800 (CST) lglyahoo-misc@ya...
wrote:
LMCC> Since there are at least two threads running in
LMCC> snmpd: the main thread which handles SNMP requests and the event
LMCC> listening thread, we must make sure snmpd could run thread-safely.

No, snmpd is not thread safe.

LMCC> I use callback mechanism(SNMP_CALLBACK_LIBRARY and
LMCC> SNMP_CALLBACK_SESSION_INIT) to let snmpd create a
LMCC> thread which will listen user defined events and
LMCC> update the global cache or generate traps according to the
LMCC> analysis of these events. The global cache is user defined and
LMCC> it"s used in the MIB handlers.

The only way to use snmpd in a multi-threaded application is to keep ALL
snmp functionality in ONE thread. Other threads may listen for non-snmp
related events, and notify the snmpd thread that a trap needs to be
sent, but the trap itself must be sent from the snmpd thread.

--
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive:
<http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list Net-snmp-coders@li...
https://lists.sourceforge.net/lists/...et-snmp-coders







.................................................. ......



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:20 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0