snmpStartAgent (Function) |
Top Previous Next |
Start the publishing agent needed to use the publishing functions: snmpPublishTimeticks, snmpPublishInteger, snmpPublishString, snmpPublishOID, snmpPublishIP, snmpPublishFloat and snmpPublishDouble.
For USM connections, the read and write capable users must be set with snmpAgentUsersSet before calling this function. For TLS connections, the local certificate must be set with snmpSecurityConfig and certificates for remote devices with snmpCertSet before calling this function.
Input: EngineID : STRING The engineID of the master agent. If not set, the master agent will generate a random engineID. This is only used in SNMPv3. It is a good practice to set it, as connecting SNMPv3 agents will often need it.
Pub : STRING The public community string for read-only authentication (disabled if secure is set to TRUE). This is only used in SNMPv1/2c.
Priv : STRING The private community string for read and writable permissions (disabled if secure is set to TRUE). This is only used in SNMPv1/2c.
Network1 : STRING (Default to "") The primary network mask setting. Devices on this network have possible access to the SNMP facilities on the RTCU device. The format of this string is in the notation : x1.x2.x3.x4/y, x1 in ]0..255], x2,x3,x4 in [0..255] and y in [0..32]. F.ex.: '192.168.1.0/24'. The default empty string results in INANY_ADDR=0.0.0.0/0 being used, thus allowing all incoming requests.
Network2 : STRING (Default to "") The network mask of a second optional network to enable for possible SNMP access. Disabled if set to the empty string.
Network3 : STRING (Default to "") The network mask of a third optional network to enable for possible SNMP access. Disabled if set to the empty string.
CACert : STRING The certificate authority root certificate, used to sign the local and remote certificate. Needed for TLS connections.
UDP : DINT [1..65535] (default 161) The UDP port to operate on. Disabled if set to 0.
TCP : DINT [1..65535] (default 0) The TCP port to operate on. Disabled if set to 0.
DTLS : DINT [1..65535] (default 10161) The DTLS port to operate on. Disabled if set to 0.
TLSTCP : DINT [1..65535] (default 0) The TLSTCP port to operate on. Disabled if set to 0.
Secure : BOOL (default TRUE) If TRUE, only allow secure connections, i.e. SNMPv3.
Output: None.
Returns: INT
Declaration FUNCTION snmpStartAgent : INT;
Example: // Please see the example at Examples - SNMP Client. |