c - 在 C 中调用 send_v2trap() 发送 net-snmp INFORM

标签 c net-snmp

This tutorial解释如何在 C 中调用 send_v2trap() 发送 SNMP TRAP。

如何发送 SNMP INFORM? manpage说我可以发送 INFORM,但没有说明如何发送。

最佳答案

我自己想出来的:-)

send_v2trap(3)说:

send_v2trap() uses the supplied list of variable bindings to form an SNMPv2 trap,
which is sent to SNMPv2-capable sinks on the configured list.
An equivalent INFORM is sent to the configuredq list of inform sinks.

但没有说明这个配置列表是什么;

相反,snmpd.conf(5)解释说我应该编辑 /etc/snmp/snmpd.conf 并添加行来告诉哪些主机将收到 INFORM。例如,以下代码使 send_v2trap() 向 host1 和 host2 发送 INFORM:

informsink host1 public 162
informsink host2 public 162

关于c - 在 C 中调用 send_v2trap() 发送 net-snmp INFORM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24388409/

相关文章:

snmp - 如何在 PEN 下构建 OID 树而不是 Net-SNMP 扩展?

SNMP net-snmp 与预期的 OID 转换不同

c - 链接到库时,include 和 link 有什么区别?

c - Strcpy 函数更改不相关的共享内存数据

c - 多进程失败 - 查找最后使用的函数

在 C 中将 "ASCII decimal"转换为整数

c++ - 此 OID netsnmp 当前不存在此类实例

c - 指向自身的指针

c - SNMP代理: Could mib2c generate code for InetAddress or String type (ie something not an integer type)

c - net-snmp api 使用用户的凭据