Description

This article explains the meaning of the message, "SNMPD_SOCKET_FAILURE: bind_snmptrap_socket: socket failure:"

Symptoms

The following messages are logged in syslog:

Jul 12 12:39:42.184  mx240-re0 snmpd[24269]: SNMPD_SOCKET_FAILURE: bind_snmptrap_socket: socket failure: bind error on trap socket source ipv4 address 1.1.1.1, retry during send. (Can't assign requested address)
Jul 12 12:39:42.184  mx240-re0 snmpd[24269]: SNMPD_SOCKET_FAILURE: trap_io_send_trap_now: socket failure: trap_socket (not initialized)
Jul 12 12:40:42.203  mx240-e0 snmpd[24269]: SNMPD_SOCKET_FAILURE: bind_snmptrap_socket: socket failure: bind error on trap socket source ipv4 address 1.1.1.1, retry during send. (Can't assign requested address)
Jul 12 12:40:42.203  mx240-re0 snmpd[24269]: SNMPD_SOCKET_FAILURE: trap_io_send_trap_now: socket failure: trap_socket (not initialized)
Jul 12 12:41:11.710  mx240-re0 snmpd[24269]: %DAEMON-5-SNMPD_TRAP_TARGET_ADD_NOTICE: trap target is added, address : 2.2.2.2
Jul 12 12:42:42.227  mx240-re0 snmpd[24269]: %DAEMON-3-SNMPD_SOCKET_FAILURE: bind_snmptrap_socket: socket failure: bind error on trap socket source ipv4 address 1.1.1.1, retry during send. (Can't assign requested address)
Jul 12 12:42:42.227  mx240-re0 snmpd[24269]: %DAEMON-3-SNMPD_SOCKET_FAILURE: trap_io_send_trap_now: socket failure: trap_socket (not initialized)

Solution

Logs are expected when the source address of snmp trap-option is nonexistent on the node.
Like below configuration,

1.1.1.1 is set as source address for snmp trap,
==================================
snmp {
    trap-options {
        source-address 1.1.1.1;
    }
    trap-group snmp-server-1 {
        targets {
            2.2.2.2;
        }
    }
}

But there is no interface is set this address.
=================================
labroot@mx240-re0> show route 1.1.1.1 


The workaround is add this address to a existing interface, like below.
=============================================
interfaces {
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.1/32;
            }
        }
    }
}

 

Modification History

2024-07-12 : Article Created
2024-07-17:Formatted font.