How does snmpd know where to send a trap?

16,851

At a minimum, you need to define trapsink, trap2sink or informsink in /etc/snmp/snmpd.conf to specify the host to send SNMP traps to. You can also specify the community string and an alternate port number (if not using 162).

You can also set a trapcommunity for a default community string to be used when sending traps.

For sending v3 traps, use trapsess.

See the snmpd.conf man page for full details. See also the net-snmp snmptrap tutorial and snmptrap v3 tutorial.

Share:
16,851

Related videos on Youtube

Andy
Author by

Andy

Updated on September 18, 2022

Comments

  • Andy
    Andy over 1 year

    I'm trying to get my head around our snmpd.conf file in order to begin managing snmp with puppet. The existing file has several alarms setup for things like excessive disk space, load, etc. I'm assuming that when these conditions are reached an snmp trap is sent to the manager. However, the snmpd.conf file does not contain any manager setup or information. In other words there is no mention of a host or port where the manager runs. Thus, how does it know where to send traps? Is there some discover protocol?

  • Andy
    Andy about 11 years
    trapcommunity is defined, but none of the other options you mention are. Perhaps this is part of my confusion - I don't understand how a trapcommunity (essentially an arbitrary string) maps to a manager. There's certainly no manager listed in the file.
  • Michael Hampton
    Michael Hampton about 11 years
    Right. There should be something defined in there to specify where traps are sent to. If there isn't, then they aren't going to be sent anywhere.
  • Andy
    Andy about 11 years
    Thanks, that makes sense to me. Premature question on my part. Working through the snmp utils now to try and test directly.