FAQ:Agent 12

From Net-SNMP Wiki

Jump to: navigation, search

Can I use AgentX (or an embedded SNMP agent) in a threaded application?

With care.

As mentioned in the earlier "thread-safe" FAQ entry, the Net-SNMP agent (including the AgentX subagent) has not been designed for threaded operation. In particular, it makes use of various global variables without attempting to protect them against simultaneous use. This means that it is NOT safe to have SNMP or AgentX related processing in two separate threads. This also applies to handling GET (and SET) processing in one thread, and generating traps in another. This is still vulnerable to the usual threading problems.

However, as long as all of the SNMP-related activity is limited to the one thread, then there should be no reason why this cannot safely communicate with other threads within the same application, using private (thread-safe) mechanisms.

But in terms of the Net-SNMP-provided code, the agent (and AgentX subagent) should not be regarded as thread-safe.

   FAQ:Agent
   
  1. What MIBs are supported?
  2. What protocols are supported?
  3. How do I configure the agent?
  4. How do I remove a MIB from the agent?
  5. I've installed a new MIB file. Why can't I query it?
  6. How do I add a MIB to the agent?
  7. What's the difference between 'exec', 'sh' and 'pass'?
  8. What's the difference between AgentX, SMUX and proxied SNMP?
  9. What about 'dlmod' - what's that about?
  10. Which should I use?
  11. Can I use AgentX when running under Windows?
  12. Can I use AgentX (or an embedded SNMP agent) in a threaded application?
  13. How can I run AgentX with a different socket address?
  14. How can I turn off SMUX support?
  15. How can I combine two copies of the 'mib2' tree from separate subagents?
  16. What traps are sent by the agent?
  17. Where are these traps sent to?
  18. How can I send a particular trap to selected destinations?
  19. When I run the agent it runs and then quits without staying around. Why?
  20. After a while the agent stops responding, and starts eating CPU time. Why?
  21. How can I stop other people getting at my agent?
  22. How can I listen on just one particular interface?
  23. How do I configure access control?
  24. I don't understand the new access control stuff - what does it mean?
  25. How do I configure SNMPv3 users?
  26. The 'createUser' line disappears when I start the agent. Why?
  27. What's the difference between /var/net-snmp and /usr/local/share/snmp?
  28. My new agent is ignoring the old snmpd.conf file. Why?
  29. Why am I getting "Connection refused"?
  30. Why can't I see values in the UCDavis 'extensible' or 'disk' trees?
  31. Why can't I see values in the UCDavis 'memory' or 'vmstat' tree?
  32. What do the CPU statistics mean - is this the load average?
  33. How do I get percentage CPU utilization using ssCpuRawIdle?
  34. What about multi-processor systems?
  35. The speed/type of my network interfaces is wrong - how can I fix it?
  36. The interface statistics for my subinterfaces are all zero - why?
  37. Does the agent support the RMON-MIB?
  38. What does "klread: bad address" mean?
  39. What does "nlist err: wombat not found" (or similar) mean?
  40. How about "Can't open /dev/kmem"?
  41. The agent is complaining about 'snmpd.conf'. Where is this?
  42. The system uptime (sysUpTime) returned is wrong!
  43. Can the agent run multi-threaded?
Personal tools