|
|
|
|
SNMPTrapEnable (Function) In french: SNMPTrapActive Enables the interception of an SNMP trap sent by an agent. Remark: the SNMP interruption service must be installed on the computer and this service must be started. If the user is an administrator or a user with rights, the service starts automatically (except if it was explicitly disabled). // Intercept all the traps nTrapID is int nTrapID = SNMPTrapEnable("TrapProc", "", "", "")
Syntax
<Result> = SNMPTrapEnable(<WLanguage procedure> , <Agent address> , <SNMP community> , <Relevant OID>)
<Result>: Integer - Identifier of trap,
- -1 if an error occurred. ErrorInfo returns more information on the error.
<WLanguage procedure>: Procedure name WLanguage procedure that will be called whenever the SNMP agent sends a trap message (according to the requested filters). This procedure has the following format:PROCEDURE <Procedure Name>(<Address>, <Community>, <OID>, <Type>, <Value>) <Agent address>: Character string Address of agent whose traps will be received. This address can be given in the following format:- IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
- URL containing the server name (www.windev.com for example). This syntax is recommended.
This agent must be configured to send traps to the computer that runs the application. If this parameter corresponds to an empty string (""), SNMPTrapEnable will e called on the traps of any agent. <SNMP community>: Character string Name of SNMP community of traps. Used to filter the traps according to their community. If this parameter corresponds to an empty string (""), SNMPTrapEnable will be called on the traps of any community. <Relevant OID>: Character string OID affected by the traps. Used to filter the traps according to the relevant OID. If this parameter corresponds to an empty string (""), SNMPTrapEnable will be called on the traps of any OID. Remarks The WLanguage procedure will be called whenever the SNMP agent sends a trap message (according to the requested filters). This procedure has the following format: PROCEDURE <Procedure Name>(<Address>, <Community>, <OID>, <Type>, <Value>) In this code: - <Address> is a string. This parameter contains the IP address of the agent that generated the trap.
- <Community> is a string. This parameter contains the community of the agent that generated the trap.
- <OID> is an array of strings. This parameter contains the OID of the trap (in numeric format).
- <Type> is an array of integers. This parameter contains the type of the returned OID.
- <Value> is an array of strings. This parameter contains the value of the returned OID.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|