Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

API to receive SNMP traps


API to receive SNMP traps

In the "HP TCP/IP Services for OpenVMS, SNMP Programming and reference" I can find SNMP routines to implement the subagent functions get, set, etc.
Now I want to write a program (in C) to receive traps and interpret them with a MIB. I can not find any supporting routines for that. Has anyone experience with this kind of program (do not want to use TCPIP$SNMP_TRAPRCV.EXE).
Thanks in advance,
Valued Contributor
Honored Contributor

Re: API to receive SNMP traps


Why don't want to use TCPIP$SNMP_TRAPRCV service?

Anyway try this alternate
1. esnmp_init (int *socket, char *subagent_identifier )

Initializes the Extensible SNMP (eSNMP) subagent and initiates communication with the master agent.

2. esnmp_register ( subtree *subtree,
int timeout, int priority )

Requests local registration of a single MIB subtree. This indicates to the master agent that the subagent instantiates MIB variables within the registered MIB subtree.

3. esnmp_capabilities ( OID *agent_cap_id,
char *agent_cap_descr )

Adds a subagent's capabilities to the master agent's sysORTable . The sysORTable is a conceptual table that contains an agent's object resources, and is described in RFC 1907.

4. esnmp_are_you_there ( )
Requests the master agent to report immediately that it is up and functioning.

5. int esnmp_poll ( )

Processes a pending message that was sent by the master agent. it should be called after the select() call has indicated data is ready on the eSNMP socket. (This socket was returned from the call to the esnmp_init routine.)

6. esnmp_trap ( int *generic_trap,
int specific_trap,
char *enterprise,
varbind *vb )

Sends a trap message to the master agent.


Re: API to receive SNMP traps

Hi Archunan,
The interface you describe was already found by me. But this interface is not able to "catch" traps. It wil handle SNMP get and set and it is able to send a trap. The receiving and decomposing a trap is not available.
I found a solution in an own program that reads UDP messages (conform example tcpip$examples:TCPIP$UDP_SERVER_SOCK.C) and write a routine that decomposes the received messages acording the Basic Encoding Rules. It was not that hard, but I expected an API.


Re: API to receive SNMP traps

I build a solution myself. See previous reply.