...
Supported device types and versions
Communication line configuration
Communication station configuration
I/O tags configuration
Messages of Trap type receiving and processing
Browsing and reading the tree of values from script
Literature
Changes and modifications
Document revisions
Kotva | ||||
---|---|---|---|---|
|
...
Note:
If SNMP protocol needs to run in a redundant system, where two instances of KOM process are running concurrently on two different computers and the IP address cannot be positively determined in line configuration, it is suitable to choose „ANY“ or „ALL“ configuration option or to name the network addresses identically as e.g. SNMP_LAN and assign them a correct IP address in the host file of each computer. See example:
on PC1: | 192.168.0.1 | PC1, SNMP_LAN |
on PC2: | 192.168.0.11 | PC2, SNMP_LAN |
Protocol parameters on the line
Following parameters of protocol can be set on the line:
Key word | Full name | Description | Unit | Default value | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Trace Level |
| - | 1 | ||||||||||||||||||||
| Trap Enable | Enables to receive the messages of Trap type. | Boolean | False | ||||||||||||||||||||
| Trap IP Address | IP address for receiving the Trap messages. | - | ANY | ||||||||||||||||||||
| Trap Port | UDP port for receiving the Trap messages. | - | 162 |
Kotva | ||||
---|---|---|---|---|
|
...
The following station protocol parameters can be set:
Table no. 2
Key word | Full name | Description | Unit | Default value | ||||||
---|---|---|---|---|---|---|---|---|---|---|
| Wait Timeout | Timeout period for the response to the read request. | ms | |||||||
| Retry Count | Number of re-sent read requests before the read is considered to be unsuccessful and another I/O tag will be queried. | - | |||||||
| Max Error Count | Maximum count of unsuccessful read requests, until the station changes value to StCOMERR state. A successful value delivery nullifies all counters and puts the station back into StON state. | - | |||||||
| Trace Level | The same meaning as parameter Trace Level on a line, but this setting is valid for the particular station. However, the higher value of a line parameter Trace level takes precedence. Note: Debugging of incoming packets is influenced by the line parameter Trace Level because at the time of reception it is still unknown which station the packet belongs to. | - |
Kotva | ||||
---|---|---|---|---|
|
...
ASN1 value type: Specifies, the value type in SNMP agent's response. It also determines applicable conversions. The value type can be detected in MIB database (note MIB database browser is not a part of the solution). One of freely available browsers can be used and desired data format can be set. It is recommended to use java application MIB Browser (http://tl1.ireasoning.com/mibbrowser.shtml).
Possible value types:
Integer | input value - expected as signed integer number (up to 64bit *) |
Unsigned | input value - expected as unsigned integer number (up to 64bit *) |
Float | input value - expected as floating-point number (float, a longfloat) |
Textxt | input value - text string |
IP address | input sequence of bytes interpreted as sequence of numbers separated by a dot – the sequence is converted to text |
Hex text | input sequence of bytes is interpreted as sequence of hexadecimal numbers separated by colon – the sequence is converted to text |
The value types IP address and Hex text can be applied to an arbitrary input data type, which will be further handled with as sequence of bytes. E.g., the input value of text type with value "test@ipesoft.sk" can be interpreted in following ways:
...
Protocol SNMP also allows, except for cyclic value reading, to send messages about important events. This messages are called Traps.
SNMP agent sends the Traps to the configured IP address and port (by default 162) (elementary devices support to send Traps to one IP address and port, advance ones send Traps to more addresses).
The parameter Trap IP address must by configured to activate a task that receives the Traps on the port Trap port.
Trap receiving is supported in the version V1 and V2C of protocol SNMP. Default mode - one device send Traps to one version of protocol.
To receive Traps from particular device, I/O tags with following text addresses (there is no need all of them) must be configured on the station:
Text addresses of I/O tags for Traps in SNMP protocol, version V1:
I/O tag address | Data type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OID | OID of the object which generate Trap (for particular device it is constant). Note: A producer of device can be often detected from OID. | ||||||||||||
| Integer | Identifier of Trap class. Following values are defined in RFC 1157 for SNMP, version 1:
| ||||||||||||
| Integer | Specific code of message. | ||||||||||||
| TimeTicks | Time-stamp (according to RFC 1157 it means the hundreds of second that passed between the last network reinitialization of device and trap generating.
If I/O tag is Ci - Integer input, its value will be in hundreds of second, i.e. TimeTicks. The maximum value for integer value in D2000 is 2^31-1 (because the integer type is implemented as 32-bit integer with sign). I/O tag of Ci - Integer input type cannot acquire the higher values than 2^31-1. According to RFC 1157, the Time-stamp is of TimeTicks type which is a non-negative integer. It can acquire higher values than 2^31-1 which are not allowed to be written into I/O tag of Ci - Integer input type. That is why it is recommended to configure I/O tag of Ai - Analog input type. | ||||||||||||
| OID | OID of object that caused a formation of Trap or object which Trap relate to. | ||||||||||||
| Arbitrary | Value of object that caused a formation of Trap or object which Trap relate to. Note 1: Because the value is arbitrary, it is recommended to configure I/O tag of TxtI - Text input type. Otherwise, some values will not be converted (e.g. to Integer input) and value TRAP_VALUE will not be changed. | ||||||||||||
| Boolean | I/O tag which confirm the values processing. Because several couples (TRAP_OID, TRAP_VALUE) can exist in one Trap message, the correct processing by e.g. ESL script needs so that KOM process will set next couple after the first one is processed. Also the values of other input I/O tags for Trap messages should be set after signalization that previous values have been already processed. If the output I/O tag with address TRAP_CONFIRM exists, KOM process will set next couple of input I/O tag values after it is written into output I/O tag with address TRAP_CONFIRM (ESL script will execute the record as one of the last operations). The values of another I/O tags (with addresses TRAP_ENTERPRISE, TRAP_GENERIC_TRAP, TRAP_SPECIFIC_TRAP, TRAP_TIMESTAMP and TRAP_OID) will be set if it is the processing of the first couple of values (TRAP_OID, TRAP_VALUE). In case of another couples, the values of I/O tags will be the same and they will be changed during the next Trap message processing. If the output I/O tag with address TRAP_CONFIRM does not exist, the values of all input I/O tags with addresses TRAP_* will be set immediately after Trap message occurred. The values can get lost, because of existence of the several value couples in Trap message or because of new message arrival, before the user script has processed the previous values. |
Text addresses of I/O tags for Traps in SNMP protocol, version V2C:
I/O tag address | Data type | Description | ||||||
---|---|---|---|---|---|---|---|---|
TRAP_REQUEST_ID | Integer | Increment number of Trap. | ||||||
TRAP_ERROR_STATUS | Integer | Error code. Default value is zero (0) but it can acquire one of the following values (see RFC 1448):
| ||||||
TRAP_ERROR_INDEX | Integer | Extended error code (often it is 0). | ||||||
TRAP_UPTIME_OID | OID | OID of object SysUpTime.0. This item should have the value 1.3.6.1.2.1.1.3.0 according to RFC 1448. But, if the item has not get this value in the implementation, the value can be find out by I/O tag with the address TRAP_UPTIME_OID. | ||||||
TRAP_UPTIME_VALUE | TimeTicks | Value of object sysUpTime. The Note, mentioned in description of address TRAP_TIMESTAMP, is valid for this value. | ||||||
TRAP_TRAP_OID | OID | OID of object SnmpTrap.0. This item should have the value 1.3.6.1.6.3.1.1.4.1.0 according to RFC 1448 (i.e. OID of object snmpTrapOID, see RFC 1450). But, if the item has not get this value in the implementation, the value can be find out by I/O tag with the address TRAP_TRAP_OID. | ||||||
| OID | Identifier of Trap category, meaning of which corresponds to item TRAP_GENERIC_TRAP in SNMP, version V1, but it is of OID type that allows to define the error codes, specific for particular producers and devices. Meaning of standard OID, which can acquire according to RFC 1450, are following:
| ||||||
TRAP_OID | OID | The same meaning as TRAP_OID in SNMP, version V1. | ||||||
TRAP_VALUE | arbitrary | The same meaning as TRAP_VALUE in SNMP, version V1. | ||||||
TRAP_CONFIRM | Boolean | The same meaning as TRAP_CONFIRM in SNMP, version V1. |
Note 1: It will be sufficient to configure the input I/O tags with addresses TRAP_OID, TRAP_VALUE and output I/O tag with address TRAP_CONFIRM to confirm the value processing.
...
The version D2000 7.02.006 and higher supports the dynamic address change of I/O tag by TELL command SETPTADDR. This address together with I/O tag address GETNEXT_OID allow to browse and read the whole tree of values by SNMP request GetNext.
I/O tag address | Value type | Description | ||||||
---|---|---|---|---|---|---|---|---|
| TxtI - Text input | OID of next object, it is in the response on request GetNext. Only requests that have been generated as the result of address change of I/O tag by tell command SETPTADDR are taken into consideration and not the requests that have been generated as a result of cyclic reading of I/O tags. |
To read the tree of values, you should configure two input I/O tags of TxtI - Text input type. One of them has the special address GETNEXT_OID. Tell command SETPTADDR set the address of the second I/O tag.
After the address is set the KOM process will generate the request to read the I/O tag. If the request GetNext is in address (e.g. SETPTADDR M.MySnmpVariable 1.3.6.1.2.1.1 TYPE=3;RQ=1), the OID (sent with reply) will be recorded into I/O tag with address GETNEXT_OID (e.g. 1.3.6.1.2.1.1.1.0). After that, the new tell command containing this address (SETPTADDR M.MySnmpVariable 1.3.6.1.2.1.1.1.0 TYPE=3;RQ=1) can be sent and so on.
Example of ESL script that shows the browsing and reading the first 100 objects from tree starting with address 1.3.6.1.2.1.1 and recording the OID addresses and values into the structure _objlist:
...