Defining the peripheral addresses of the SNMP driver
The SNMP data is provided by external, or internal SNMP agents configured in the chapter configuration panels of SNMP. The data is collected by SNMP managers. The collected data is mapped to DPE values in the WinCC OA database. A SNMP peripheral address has to be configured for the data points that represent the collected data. The peripheral address is configured via an address config, which is added to a data point via the PARA module. Right click on a data point in the PARA module and choose the option Insert config. The Insert config panel is opened. Choose the option periphery address and then the option SNMP from the combo box. The SNMP address config is opened:
AgentID
The AgentID corresponds to the number that was used for the configuration of an SNMP agent (when an agent was configured for a manager through the create SNMP agent panel).
OID
The OID is the SNMP object identifier from the MIB file of the agent (in case of WinCC OA the OID of the WinCC OA MIB and otherwise an OID of the MIB file of the agent (of a network device)). In case of a WinCC OA agent a WinCC OA MIB element can be selected using the MIB-Browser (...).
Add a DPE using the MIB Browser
Add the index number of the data point element from the SNMP Live Agent configuration panel, to the end of the OID chosen through the MIB-Browser. The OID should look, e.g., as follows: 1.3.6.1.4.1.13828.2.1.20.1.3.1 (the last number '1' is the data point index from the SNMP Live Agent configuration panel).
The peripheral address has the following form: Agentnumber_OID[B]. B is added to the
tables when a whole column of the table has to be read. The column (the result) has
to be configured on a dyn element. Otherwise the OID has to indicate exactly the
desired MIB element. Via the character 'B' you can represent all data point elements
of a data point instead of a single element provided via the corresponding index by
the Live Agent. All elements of the index 1.3.6.1.4.1.13828.2.1.20.1.2.idx
can be represented via 1.3.6.1.4.1.13828.2.1.20.1.2B
on a
dyn DPE.
Array queries
In addition, you can read a list of several OIDs. Therefore, you have to configure a
peripheral address for a dynamic data point element. To define the list of OIDs you
have to use the pipe character (= "|'"), e.g.
"1.3.6.1.2.1.2.2.1.10.3|1.3.6.1.2.1.2.2.1.10.7|1.3.6.1.2.1.2.2.1.10.9"
.
Each OID is mapped to the corresponding index of the dynamic data point element.
-
When reading a list of OIDs using the "|" separator, it is not allowed to include a blank!
-
The List of OIDs is restricted to 4096 characters including the separator.
-
Trailing dots ".", separators "|" or spaces are removed from the address string
-
If an address is syntactically incorrect, e.g. if it contains spaces or letters, address mapping stops at this point. No further addresses are mapped, previously mapped addresses are removed from the data point and a message is sent to the Log Viewer.
-
If a request is sent with a large number of OIDs, it is possible that the corresponding get-request will timeout or return the error that the message sent is "too large". To prevent this, the additional command ":<n>" (n = number of OIDs per request) can be set to split the request of the array addresses in multiple get-requests, e.g. the address configuration "
1.3.6.1.2.1.2.2.1.1.1|1.3.6.1.2.1.2.2.1.1.2|1.3.6.1.2.1.2.2.1.1.3:2
" queries 3 OIDs and puts a maximum of 2 OIDs into a single get request.It is up to the user to decide how many OIDs to query in a single get request. WinCC OA is not able to determine how big an answer to a request might get.
By default, the original value of the DPE is not updated if the request for one OID results in an error even though the request for the other OIDs was successful. In this case a corresponding error is displayed in the LogViewer and the last valid value is shown.
If you set the config entry [snmpdrv] arrayQueryErrorHandlingMode = 1, the driver will update the original value and replaces the values of erroneous OIDs by predefined default values. You can define the default values for the respective transformation types via the corresponding config entries (e.g. arrayQueryErrorValueVisibleString, arrayQueryErrorValueInteger32, etc.). Refer to [snmpdrv] for further information.
It depends on the used SNMP agent which values are replaced. This means either only the value of the erroneous OID or the values of all OIDs may be replaced. Some SNMP agents do not send further values if one of the OIDs is not configured. E.g.:
Request <OID1>|<OID2>|<OID3>|<OID4>
Response <value1>|<error>|<null>|<null>
In this case <error> as well as <null> are replaced by the defined default value.
Read out the Manager Table using the MIB Browser
In order to read out the manager table through MIB browser, for example, in order to read out the manager state, configure the agent as follows:
The port number must correspond to the SNMPPortNr port number of the pMon in the config file.
[pmon]
allowSNMP = "Yes"
SNMPPortNr = 4700
v1ReadCommunity = "public"
v1WriteCommunity = "public"
You can configure the address with the aid of the MIB browser.
Add the SNMP manager index from the console to the end of the OID. The OID should
look as follows: 1.3.6.1.4.1.13828.2.1.10.1.6.5
(the last number
'5' is the SNMP manager index from the console). The manager index starts with
1.
The SNMP driver offers the possibility to browse for data of an agent (OID, value of
the default transformation and data type as text and number). The internal data
point element Browse.Start of the type _SNMPV3Entity or _SNMPAgent defines
the start-OID from which the browsing should be performed. If no start-OID was
defined, the start-OID is automatically "1.3.6.1
". The results are
written to the specific internal data point element Browse.Result. For
further information see internal data points.
Subindex
The subindex has a different meaning depending on the send/receive direction. The sending of arrays is not supported in the send direction. Thus, the sub index is in this case always 0. A 64bit number is an exception. For a 64bit number the higher-order part of the number is set via the sub index 1. In the receive direction the sub index 2 always means the OID of the received value (datatype text). This is necessary when a table is read column by column, so that the individual rows can be assigned to an OID. The sub index 1 returns the higher-order part of the number in case of an Uint64. Via the sub index 0 the actual value is accessed. The elements can be polled only when the sub index is 0 (polling = the manager sends a request to the agent and the agent sends a response to the manager).
Driver number
The driver number is the number of the used SNMP manager.
Type of transformation
The data type is specified here. The data type is defined in the MIB file of the agent and has to be specified correctly. The data types are described in the chapter data types and debug levels.
Direction
The direction can be input, output or In/Out. Input means that the data is received by WinCC OA, the output again that WinCC OA provides the data for external SNMP managers. In/Out can be used to be input an output at the same time.
Receive mode:
-
Spontaneous: Traps can be received. When the traps are activated (enableTraps = "Yes" entry in the config file) the traps are represented on the internal data point of the SNMP manager (_SNMPManager.Trap). The PayloadOID shows the OID that sent the trap. The PayloadValue shows the value. Thus, this DPE always shows the trap that was received last. The incoming traps can be represented on single DPEs with configured address. Thus, create an agent with an appropriate IP address (if the agent does not exist yet) so that the received traps can be assigned. If you want to receive traps from the local agent you also have to create a data point for this agent. The port number is not considered. Configure the _address config. The trap value is shown on the PayloadValue element of the _SNMPManager data point and the OID on the PayloadOID element. Can only be used for input addresses.
-
Single query : If the receive mode is set to "Single query", a query is only then possible, when it is triggered via the internal data point _DriverCommon.SQ.
-
Polling: The agent is polled depending on the settings, periodically. All configured agents are e.g. polled cyclic every 5 minutes (depending on the settings for the poll group) for the input direction.
Agent version
Here you can specify whether this is a V1/2 agent or a V3 entity.
As already mentioned the agents are polled according to the settings of the poll group. The poll group is configured via a separate panel:
The panel allows to create or remove a poll group, specify the poll time and the synchronization time or both. The synchronization time means that the data is synchronized monthly, weekly, daily, every hour or minute. See also chapter poll groups.
MIB-Browser
The MIB-Browser allows to select the OID of a MIB element from a MIB file. It is possible to read non WinCC OA MIB files and browse them hierarchically.
MIBs
- ETM MIB
- Loads the ETM MIB file, which is delivered with WinCC OA.
- MIB file:
- The button allows you to select a MIB file and browse the file using the MIB-Browser.
Agent Browsing
- Browse / Refresh
- The "Browse / Refresh" button allows you to get a list of available MIBs from the connected SNMP agent. The MIBs will be stored inside the internal data point of the SNMP agent. See "Load" button below.
- Load
- The "Load" button allows loading the browsing results from the last "Browse / Refresh" process and browsing them using the MIB-Browser.