Citect for Windows, Version 5.xx SNMPII ... - citect.aveva… · Citect for Windows, Version 5.xx...

52
Citect for Windows, Version 5.xx SNMPII driver, User information and design

Transcript of Citect for Windows, Version 5.xx SNMPII ... - citect.aveva… · Citect for Windows, Version 5.xx...

Citect for Windows, Version 5.xx SNMPII driver, User information and design

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 2

1. USER INFORMATION...............................................................................................................3 1.1 DEVICE APPLICATION NOTES ...................................................................................................3

1.1.1 Overview ........................................................................................................................3 1.1.2 Citect SNMPII driver Support Summary..........................................................................5 1.1.3 Setup guide.....................................................................................................................5 1.1.4 Reference: Required Components....................................................................................7 1.1.5 Reference: Communications Forms.................................................................................8 1.1.6 Reference: Wiring Diagrams...........................................................................................9 1.1.7 Reference: Data Types....................................................................................................9 1.1.8 Reference: SNMP Traps................................................................................................ 10 1.1.9 Reference: An alternative SNMP Port ........................................................................... 12 1.1.10 Hints, Tips, and Frequently Asked Questions................................................................. 12

1.2 DRIVER REFERENCE .............................................................................................................. 14 1.2.1 Description................................................................................................................... 15 1.2.2 Driver generated error codes........................................................................................ 15 1.2.3 Parameters, options and settings................................................................................... 15 1.2.4 Advanced...................................................................................................................... 17

2. ANALYSIS................................................................................................................................. 18 2.1 OVERVIEW ........................................................................................................................... 18 2.2 VERSIONS OF SNMP ............................................................................................................. 19 2.3 PACKET TRANSMISSION ........................................................................................................ 19 2.4 OBJECT IDENTIFIERS ............................................................................................................. 21 2.5 DATA TYPES......................................................................................................................... 22 2.6 MANAGED OBJECTS .............................................................................................................. 23 2.7 SNMP PACKETS ................................................................................................................... 24 2.8 MICROSOFT SNMP API & SNMP MANAGEMENT API......................................................... 24

2.8.1 Management Functions................................................................................................. 24 2.8.2 Utility Functions........................................................................................................... 25

2.9 GLOSSARY............................................................................................................................ 26 3. DRIVER IMPLEMENTATION................................................................................................ 28

3.1 DEVELOPMENT RESOURCES ................................................................................................... 28 3.1.1 Contacts ....................................................................................................................... 28 3.1.2 Documents.................................................................................................................... 28 3.1.3 Software / Hardware..................................................................................................... 29

3.2 RISK AREAS .......................................................................................................................... 29 3.3 DEVELOPMENT PLAN............................................................................................................. 29 3.4 BETA TESTERS ...................................................................................................................... 29

4. APPENDIX ................................................................................................................................ 30 4.1 V1 SNMP MANUAL SETUP GUIDE.......................................................................................... 30 4.2 SNMP TIME BASED PDU GROUPING .................................................................................... 32 4.3 SNMP RELATED BUGS FIXED IN WINDOWS NT SERVICE PACKS ............................................ 33

4.3.1 Service Pack 6 .............................................................................................................. 33 4.3.2 Service Pack 5 .............................................................................................................. 34 4.3.3 Service Pack 4 .............................................................................................................. 34 4.3.4 Service Pack 3 .............................................................................................................. 38 4.3.5 Service Pack 2 .............................................................................................................. 38 4.3.6 Service Pack 1 .............................................................................................................. 39

4.4 SNMP RELATED BUGS IN WINDOWS NT (NOT FIXED)............................................................ 39 4.5 SNMP RELATED BUGS IN WINDOWS 95/98 (NOT FIXED) ........................................................ 49

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 3

1. User information Simple Network Management Protocol (SNMP) is a network management standard widely used in TCP/IP networks to monitor and control computers, routers, printers and other devices connected to a network. SNMP uses a distributed architecture consisting of managers and agents. A manager is an SNMP application that generates queries to SNMP agent applications. An agent is an SNMP application that responds to queries from SNMP manager applications. The SNMP agent is responsible for retrieving and updating local management information based on the requests of the SNMP manager. The agent also notifies registered managers when a significant event or trap occurs. The SNMP manager is realised in Citect through the SNMPII driver. On computers running Microsoft® Windows NT®, Windows 98®, or Windows 95® the SNMP agent is implemented by the SNMP service (SNMP.EXE). Every SNMP manageable device has a set of “objects” that can be read or modified via SNMP. This set of managed objects is known as a Management Information Base (MIB).

1.1 Device Application notes Detail Manufacturer - Device name Any SNMP manageable device Communications method

Ethernet UDP/IP

1.1.1 Overview Each device to be monitored or controlled by Citect must be connected to a TCP/IP network. This is illustrated in the following diagram.

PC

Citect

PC

PRINTERROUTER NETWORK

TCP/IP

Fig 1.1.1 – Device connection

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 4

All SNMP manageable devices that reside on a TCP/IP network are required to support a minimum standard set of managed objects, collectively known as MIB-II . Industry vendors such as Cisco or Microsoft, can define additional MIB’s that allow unique hardware or software services developed by the vendor to be monitored and managed by an SNMP manager. Each object in a MIB is identified by a universally unique label referred to as an object-identifier (OID). The identifier includes the object’s type (such as counter, string, gauge, or address), the object’s access level (such as read / write), size restrictions, and range information. The object name space is implemented as a multi-part, hierarchical, naming scheme. A hierarchical naming scheme can be viewed as an inverted tree with the branches pointing downward. Each point where a new branch is added is referred to as a node. This OID is internationally accepted and allows developers and vendors to create new components and resources and assign a unique OID to each new component or resource. The OID naming scheme is governed by the Internet Engineering Task Force (IETF). The IETF grants authority for parts of the name space to individual organizations, such as Microsoft. For example, Microsoft has the authority to assign the OIDs that can be derived by branching downward from the node in the MIB name tree that starts at .1.3.6.1.4.1.311. The following diagram illustrates this concept.

.1International Standards Organisation (ISO)

.3Organisation (ORG)

.6Department of Defence (DOD)

.1Internet

.1Directory

.2Mgmt

.3Experimental

.4Private

.1MIB-2

.1Enterprises

.311Microsoft

.437Cisco

.1Software

.1Systems

.2Wins

.3Dhcp

Fig 1.1.2 – OID Hierarchy Sample

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 5

SNMP programs use the OID to identify the objects on each device that can be managed by using SNMP. For example, when Citect requires information about managed-objects from some computer on the network, the SNMPII driver sends a message over the network that requests information about the object as identified by the OID. The computer that receives the message can use the OID to retrieve information from the specific object on the computer and send the information back to Citect. The OID in the hierarchy is written as a sequence of sub-identifiers beginning at the root and ending at the object. Sub-identifiers are separated with a period. For example, the OID for “sysDescr” which is a textual description of the SNMP manageable device is : .1.3.6.1.2.1.1.1.0 . This type of reference is called a scalar reference in SNMP terminology. SNMP supports repeated instances of a OID in a table. The OID in this situation has an instance number added to the OID, e.g. ifDescr 1.3.6.1.2.1.2.2.1.2 becomes 1.3.6.1.2.1.2.2.1.2.x.0 where ‘x’ can be from say 1 to 10. SNMP Redundancy Redundancy in the Citect context, is a function of the support provided in the SNMP device you are talking to. Some SNMP devices have a fixed IP address of who can talk to them (for security). In this case, only one Citect IOServer can talk to them. Redundancy is not possible. However, most SNMP devices allow anyone to talk to them provided their SNMP community name (like a password) is valid. In this case, Citect redundancy will work. For a SNMP device to support trap redundancy (i.e. to send traps to multiple places), the device must support allowing 2 or more trap IP addresses. Each trap must be sent to the primary and standby IOServer. If the SNMP device only supports one trap IP address, then the standby IOServer will NOT receive traps should the primary server be down. 1.1.2 Citect SNMPII driver Support Summary This driver will be implemented with Microsoft Windows NT SNMP API (SNMP API hereafter). The SNMP API supports SNMPv1 and SNMPv2C. To cooperate with Citect, only GET, SET and TRAP requests are used in this driver. GET_NEXT and WALK function won’t be provided. All traps will be retrieved from windows SNMP Trap service and be stored in a driver global queue for user to process. Version 2 of the driver adds trap forwarding, MIB table support and efficiency improvements. 1.1.3 Setup guide

1.1.3.1 Device Setup This section refers to the setup of the device that Citect will query via SNMP. Step 1 Connect the device to the TCP/IP network. For a PC, a network card must be installed. Step 2 If the device is a PC running Windows NT/98/95, the TCP/IP protocol must be installed and configured, as well as the SNMP service. Refer to the online help in “Control Panel” for more information.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 6

Note 1: any installed “Service Pack” must be re-installed after the TCP/IP protocol or SNMP service is installed. Note 2: if the SNMP service is installed on a PC running Windows 95, the service will not function correctly until the file: INETMIB1.DLL, is copied from the installation folder to the WINDOWS\SYSTEM folder. Step 3 The device must be configured with an IP address. Refer to the device’s hardware documentation for more information; or if the device is a PC, refer to the online help in “Control Panel”.

1.1.3.2 Citect MIB2CIT Utilty Use SNMPVARS.DBF format :

Field Name Description

INDEX A unique index number. This does not have to be sequential. This number maps to the “Tag” Address Nx number. This numeric record tag must be unique within a data type.

DEVNAME A unique descriptive name given to each Citect I/O Device, as specified in the I/O Devices form. It must not exceed 16 characters in length.

CITECT TAGNAME

The citect tag name for the object. Not to exceed 32 characters in length.

CTYPE

The Citect Data Type of the object, which can have one of the following values: LONG, REAL, STRING

Note that Tags with a Citect Data Type of STRING, are limited to a maximum length of 255 characters. For Tags with a required numeric range which goes outside the range: –2147483648 to 2147483647, you could assign a Citect Data Type of REAL.

#SNMPNAME The SNMP name for the OID object. Not to exceed 32 characters in length.

#OID The SNMP Object Identifier, e.g: .1.3.6.1.2.1.1.1.0 . Table entries will end in a “.x”

#SNMPTYPE

The Citect SNMP data type, and can have one of the following values: DA - for alphanumeric string objects(octet string processed as null-terminated string) BA - for alphanumeric string objects(octet string processed as binary string) N - for numeric objects (treat as long in Citect) NE - for enumerated numeric objects (this is equivalent to the N type but indicates that Cicode macros should be generated using the MIB2CIT.EXE utility). NE & N are the same items. R - for numeric objects(treat as real in Citect)

#R/W The readability/ write-ability of the tag, which can have one of the following values:

# This information normally comes from the MIB via MIB2CIT.EXE

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 7

R - Read Only W - Write Only RW - Read and Write

#COMMENT An optional comment, which must not exceed 48 characters in length. Any commas within this text must be removed.

SNMP_ENUMS.TXT – A comma separated file generated by the MIB2CIT utility for future Cicode use. Its format is :

SNMPNAME The SNMP name for the OID object. Not to exceed 32 characters in length.

CTYPE Citect Data Type

ENUMS Enumerated values for the OID. These are data pairs of : {number1 “Text1”}{number2 “Text2”} This data is not used by the driver

e.g. sysID,LONG,{1 “unit1”}{2 “unit2”}{3 “unit3”} SNMP_TRAPS.TXT - A comma separated file generated by the MIB2CIT utility for future Cicode use. Its format is : SNMPNAME The SNMP trap name. Not to exceed 32 characters in length. ENTERPRISE TRAP OID

The enterprise trap OID number, e.g. 1.3.6.1.4.1.6126.2.42 where 42 is the enterprise trap number.

IP ADDRESS Of the I/O Device

COMMENT An optional comment, which must not exceed 48 characters in length. Comment will be in quotes.

VARBINDS The varbind variable names for the trap. Comma separated items.

1.1.3.3 Manual Citect Setup For integrity of the system, the tagname, data type, address and IO device must be the same between equivalent records in variable.DBF and the SNMPVARS.DBF. The address must be unique between data types. The SNMP OID field MUST be correct for the system to work. 1.1.4 Reference: Required Components

1.1.4.1 Software The Citect 5.xx SNMPII Driver will only function on a PC running Microsoft Windows NT (Server or Workstation) 4.0 or greater; Service Pack 6 or higher is recommended for NT 4.0. The SNMPII Driver WILL NOT work on a PC running Windows 98 or 95. A PC used as an SNMP host i.e. (as a Citect I/O Device) may use either Windows NT 4.0 or Windows 98/95. In this case, the TCP/IP protocol, and the SNMP service will be required. These software components are included on the Microsoft Windows NT/98/95 CD.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 8

1.1.4.2 Hardware If a PC is to be used as an SNMP host, a TCP/IP compatible network card will be required. 1.1.5 Reference: Communications Forms Boards form Field Default Allowable values Board Name This field is user defined, and is not used by the driver. Board Type SNMPII Address 0 I/O Port BLANK Interrupt BLANK Special Opt BLANK Comment This field is user defined and is not used by the driver. Ports form Field Default Allowable values Port Name This field is user defined and is not used by the driver. Port number Must be unique, but is not used in this driver. Board name Refers to the board previously defined in ‘boards’ form. Baud rate BLANK Data bits BLANK Stop bits BLANK Parity BLANK Special Opt SNMPVARS.DBF The .DBF file users to store additional tag data Comment This field is user defined and is not used by the driver. Note: the SNMPVARS.DBF must be placed in the project directory. If there is no snmpvars.dbf in the project directory, then the Port will not initialise. I/O Devices form Field Default Allowable values Name This field is user defined, and is not used by the driver. Number Must be unique1, but is not used by the driver. Address Use a valid IP address; format is:

“aaa.bbb.ccc.ddd community_string” . The community string has to be correct to ensure access to the remote agent. The IP address can also be a devicename known by the IP network. A third parameter will appear in the field which is added by the MIB2CIT utility. This 3rd argument is NOT used by the driver.

Protocol SNMPII Port name Refers to the port previously defined in ‘ports’ form. Comment This field is user defined and is not used by the driver.

1 See Citect Online Help for details on how to set up redundant I/O Devices.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 9

1.1.6 Reference: Wiring Diagrams Any standard TCP/IP network wiring. 1.1.7 Reference: Data Types

IO Device Type

Citect Tag Address Format

Citect Data Types Applicable SNMP data type

Alphanumeric (display string) objects DAn STRING

ASN_OCTETSTRING,

ASN_BITS,

ASN_OPAQUE,

ASN_IPADDRESS,

ASN_OBJECTIDENTIFIER,

Alphanumeric (binary string) objects BAn STRING

ASN_OCTETSTRING,

ASN_BITS,

ASN_OPAQUE,

Numeric objects(treat as long in Citect) Nn LONG

ASN_INTEGER, ASN_INTEGER32, ASN_UNSIGNED32, ASN_COUNTER64, ASN_COUNTER32, ASN_GAUGE32, ASN_TIMECLIDKS

Numeric objects (treat as real in Citect) Rn REAL

ASN_INTEGER, ASN_INTEGER32, ASN_UNSIGNED32, ASN_COUNTER64, ASN_COUNTER32, ASN_GAUGE32, ASN_TIMECLIDKS

Trap objects (null-terminated string) Ta STRING Trap object

Trap objects (binary string) BTa STRING

Trap object (only for ASN_OCTETSTRING, ASN_BITS, ASN_OPAQUE type value in varbinding field)

Trap forwarding (write only) TF STRING

IP address to forward a copy of the last trap to. One IP address is required per call to TF. TF can be called multiple times.

Trap Next (read & write) TN LONG

TN as read is the traps in queue, 0 for nothing. A TN write removes the current entry and gets the next.

Mutiple trap variable TNVB LONG A read of TNVB returns the number of varbinds in the trap, a write to TNVB controls which varbinds data is going to be read

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 10

or written to.

Note 1: n is from 0 to 65535, a is from 0 to 6. T0 to T6 are read and write variables. Note 2: for the sting types, the DA stands for null-terminated string and the BA stands for binary string. Null-terminated string is a string with 0x00 as end flag, but in a binary string a 0x00 may be valid content. For example <0x41><0x42><0x43><0x00><0x61><0x62><0x63>, if defined as DA, the citect will display it as “ABC” and the content from <0x61> will be truncated, if defined as BA, the citect will display it as “41424300616263”. This also applies to those ASN_OCTETSTRING type fields in a trap object, with DA replaced by T and BA replaced by BT. Whether a Tag is readable / writeable is dependent on how the SNMP object to which it corresponds is defined in the appropriate .MIB file. For the type DA, BA, N and R, the “n” represents the value of the INDEX field for a Tag’s entry in the SNMPVARS.DBF file. You should never directly modify the Tag database. All Tags should be entered using the procedure specified in the section titled Setup Guide. For each Tag, you may specify the Citect Data Type you require, however you must ensure that the selection you make is appropriate for the corresponding SNMP Object. Note that Tags with a Citect Data Type of STRING, are limited to a maximum length of 255 characters. For Tags with a required numeric range which goes outside the range –2147483648 to 2147483647, you could assign a Citect Data Type of REAL. Na & Ra Grouping Considerations – Citect will allow you to “group” enquiries together to enable greater SNMP efficiency. The user must decide which items need to be grouped together. It is recommended no more than 20 items are grouped together. This means if any one item is read, the whole group will be read. This can be a manual process or done with the Citect MIB2CIT utility. Groups should be seperated in units of 100. E.g. N0,N2,N3 then N100, N101, etc. MIB Table Support – A SNMP MIB often has tables which cover multiple instances of some device. To allow Citect to be flexible and not require hard coding, v2.0.5+ of the SNMPII driver adds TABLE support. The user maps the TAG name to the table OID number, e.g. ifMtu is 1.3.6.1.2.1.2.2.1.4 in the ifEntry Table (1.3.6.1.2.1.2.2.1) Tag Name ifMtu, OID 1.3.6.1.2.1.2.2.1.4 In Citect this is referenced to using the array notation as ifMtu[2] . This translates in the driver to 1.3.6.1.2.1.2.2.1.4.2 . The OID stored in the database will be 1.3.6.1.2.1.2.2.1.4.x . The default case is .1 or 1.3.6.1.2.1.2.2.1.4.1 . x can be between 1 and 255. 1.1.8 Reference: SNMP Traps SNMP Traps differ from other SNMP messages in one important respect. They are unsolicited messages sent by an SNMP agent when some pre-defined event has occurred. For that reason, the SNMPII driver in Citect handles traps in a slightly different way to other SNMP variables. Because there is no way of knowing in

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 11

advance how many traps will be received by Citect, it is impossible to set up Variable Tags ready for each trap. Instead, incoming traps are queued.

1.1.8.1 Trap Reading A single set of seven tags, addressed as T0, T1, …, T6, is used to read the traps one by one from the queue. These seven tags are assigned data from each trap according to the following table:

Tag Address Field of trap object assigned to Tag T0 Enterprise (device sending the trap).

Eg. 1.3.6.1.4.1.311.1.1.3.1.1 T1 IP address

Eg. 223.125.1.17 T2 2Generic type

Eg. 6 T3 Specific type (i.e. a user defined trap in

the enterprise MIB) Eg. 3 T4 Time stamp

Eg. 6336403 T5 OID of Name of the first trap varbind in

varbindings Eg. .1.3.6.1.2.1.1.5.0

T6 Value of the first trap varbind in varbindings. Eg. “Computer_1”. When writing T6, the 2nd parameter needed must be either “INTEGER”, “COUNTER”, “GUAGE”, ”TIMETICK”, ”ADDRESS”, ”STRING”

TF Forward trap to IP address. An optional trap community name can be added to the 2nd argument. E.g. “196.168.1.34 trap”

TN Trap next (read or write) TNVB Mutiple trap variable(read or write)

To read data from the next trap in the queue, a tag “TN” write is performed. Note that once a trap has been removed from the queue, the trap cannot be re-read. When no traps exist, the Tx tags are returned as nulls.

1.1.8.2 Trap Forwarding Should a trap need to be forwarded to another system, Cicode must be written to use the “TF” tag BEFORE using “TN”.. E.g. TF=”203.168.34.23”.

2 Generic type Values 0 – Cold Start 1 – Warm Start 2 – Link Down 3 – Link Up 4 – Authentication Failure 5 – egpNeighour Loss 6 – enterprise specific trap

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 12

Multiple TF’s are allowed so that several destinations can be used. If no 2nd argument is given, the default of “trap” is used to send the trap.

1.1.8.3 Trap Creation Traps can be created by writing to T0-T6 with data, then using the “TF” as before. This enables non SNMP devices to be able to generate traps via Citect. When creating a trap, T0--T4 are set to their default values, T5 and T6 are empty. Default values: T0 Enterprise: .1.2.3.6.1.311.1.1 T1 IP address: local IP address T2 GenType: 6 T3 SpecType: 0 T4 TimeStamp: time since driver was started, in 100th of seconds. When T5 is assigned a value and T6 is empty, T6 is set to "0 INTEGER" When T6 is assgned a value and T5 is empty, T5 is set to ".1.3.6.1.2.4.2.0" Note, when writing to T6, you need to describe the data type. This is documented in the previous table.

1.1.8.4 Mutiple trap If TNVB has not been read or written to, the addressed as T0, T1, …, T6, is used to read the first traps from the queue. A read of TNVB returns the number of varbinds in the trap queue. A write to TNVB controls which varbind data is going to be read or written to. 1.1.9 Reference: An alternative SNMP Port Two citect.ini parameters [snmpii] changeports2000=1 ! or enablechangeports=1 PortName.UnitName.Port=***(the default being 161) will allow alternative port to be used. In the Beta version this could be used on a win2000 platform. The status under NT4 is not guaranteed to work. Please note to enable this feature, it was necessary to ship a Win 2000 mgmtapi.dll to be placed under \citect\bin so the NT4 users did not get DLL dependency issues. The user must ensure the port isn’t used or likely to be used by other processes. 1.1.10 Hints, Tips, and Frequently Asked Questions You should be aware that there are several reported problems related to the operation of SNMP in Microsoft Windows NT4.0/98/95 environments. Some of those pertaining to Windows NT 4.0 have been fixed. If you experience problems with the use of the Citect SNMPII Driver, you should become familiar with the reported problems, bugs, fixes and work arounds currently published. See the section titled SNMP Related Bugs in Windows NT/98/95 for mode details. If the SNMP service is installed on a PC running Windows 95, the service will not function correctly until the file: INETMIB1.DLL, is copied from the installation folder to the WINDOWS\SYSTEM folder.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 13

Note that Trap data types can only be used on IP networks. Trap data is treated as global and stored in a queue in this driver, i.e. the Trap variable could be defined under any IO device and those trap variables with same address (such T0) will have the same value. A read will get the variable value from the first elements of the queue and writing will delete that first element from the queue. The length of the queue is only limited by available memory. The SNMPII driver WILL NOT work on a PC running Windows 98 or 95. Windows NT (Server or Workstation) 4.0 or greater is required. The latest service pack is highly recommended. However when used on Windows NT, the Citect SNMPII driver CAN communicate to PC’s running Windows 98/95 running SNMP agents. Before the first writing to a variable, at least one read must be made so that the driver can get the SNMP data type of that variable.

Screenshot of the Tag Properties Dialog from the MIB2CIT Utility

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 14

Screenshot of the Variable Tags form in Citect Project Builder

Note how the entries in the fields of the Variable Tags form correspond to the entries in the SNMPVARS.DBF file defined for the port the device is on. In particular note how the Address field is a combination of the INDEX and SNMPTYPE entries in the SNMPVARS.DBF (as can be seen from the Tag properties dialog shown above). The following picture shows how a Trap tag is set up in a Variable Tags form:

Screenshot of the Variable Tags form in Citect Project Builder

It is possible for many tags to refer to same Address tag as tags on different “I/O Device Name”s talk to different SNMP agents. Note also that the I/O Device field could be changed to refer to any other I/O device that has been set up for SNMP communications. To read traps from the queue and log them for future reference, the following logic could be followed. 1) Read Tag TN to see if it is > 0.. 2) If TN is 0 then there are no traps in the queue. Exit the process. 3) Read required data from Tag Tx (where x is any one value from 0 – 6) 4) Log the values of the Tx or store them in other variables 5) If the trap needs to be forwarded, then write Tag TF with the forwarding IP

address. 6) Write to TN to delete the current trap and move the traps in the queue forward. 7) Return to step 1 Default value of TF is 127.0.0.1

1.2 Driver reference Detail Driver name SNMP Maximum array size3 2040 bits (255 bytes)

3 Equivalent to ‘Maximum Request Length’

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 15

Max_Block 640 bits or 20 reals or integers 1.2.1 Description The Citect SNMPII driver is used to communicate via Ethernet UDP/IP to any SNMP manageable devices connected to a network. 1.2.2 Driver generated error codes Driver Error Code (Hexadecimal)

Mapped to (Generic Error Label) Meaning of Error Code

0x101 GENERIC_GENERAL_ERROR The response was too large for the agent to handle

0x102 GENERIC_BAD_PARAMETER The requested OID does not exist in supported MIB view, or is not accessible, or we attempted a write operation on a read-only MIB variable

0x103 GENERIC_BAD_PARAMETER Bad MIB variable data type specified in variable bindings

0x104 GENERIC_WRITE_PROTECT Attempted a write operation on a read-only MIB variable (this error never occurs)

0x105 GENERIC_GENERAL_ERROR An unknown error. 0x180 GENERIC_NO_MEMORY No memory could be allocated. 0x181 GENERIC_GENERAL_ERROR Could not convert an OID string

into a valid OID 1.2.3 Parameters, options and settings Standard Parameters Parameter Default Allowable values Block (bytes) 4 4 to 255. Not used. Delay (mS) 0 0 to 300 MaxPending 2 1 to 5 Polltime (mS) 1000 500 to 2000 Timeout (mS) 1000 1000. Not used. Retry Not used WatchTime (Sec) 30 0 to 128s Driver Specific Parameters Parameter Default Allowable values MaxTimeouts 1 1 to 3 of requests to SNMP API SnmpTimeout(mS) 1000 200 to 6000. Timeout internal to SNMP API SnmpRetry 1 1 to 5. Count internal to SNMP API. PDUGroupOK 20 0 to disable grouping. >1 to enable

grouping. This value cannot exceed 98 and

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 16

is recommended to be 20. ExtraDebug 0 O or 1 Extra debug statements for

determining errors. Debug flags need to be enabled.

ReturnError 0 or 1 To be used in conjunction with PDUGroupOK to isolate the variable in a group of tags that is causing an error. When this parameter is set to 1, the driver returns an error when an SNMP packet is returned with an error. When set to 0, the driver returns either the string “Bad” or the number 2898 (oxBAD).

x.y.TestOIDStr (where x is portname, y is the unitname)

Test OID String

The SNMPII driver tests the status of each Citect I/O Device by transmitting a request to read the “sysDescr” (.1.3.6.1.2.1.1.1.0) object in the device. TestOIDStr will allow alternative OID to be used for testing the status of each Citect I/O Device. An OID must end with “.0”. If the I/O device is online, it will respond by transmitting the requested data. If no response is received, then the Citect I/O Device will be considered offline.

ChangePorts2000 or EnableChangePorts

0 or 1 Default 0, Only change if you are on a Win2000 machine and you wish to change the default port.

x.y.Port (where x is portname, y is the unitname)

Any Allows the default SNMP port (the default is 161) to be changed. Your SNMP agent must be able to listen on the new port number !

ComSettingsInInclude 0 or 1 Default 0, this needs to be set to 1 IF the SNMPVARS.DBF information is going to be in Communication Settings in INCLUDE projects.

For most users, the ReturnError parameter is likely to be the only one they will use. The others relate to specialised setups. When PDUGroupOK is 0 or 1, separate SNMP packets will be generated for each item asked by the IOServer. When non zero, items in one request from IO Server will be requested in one packet to target device. NB: The target device MUST be able to support large PDU packets if PDUGroupOK is high. Some devices may crash if this value is too large. 50 worked on NT workstations but crashed a 3rd party box. Hint: When an error occurs in reading one item in a group, all items are flagged as errored. To establish which item is causing the error, set PDUGroupOK=1, so that the driver sends a separate SNMP packet for each item, and ReturnError=0, so that the driver does not return an error to the IO Server. Then the item which is causing the problem will be displayed with the value “Bad” if it a string or the value 2989 (the decimal equivalent of the hex 0xBAD) if it is numeric. Once the problem item has been located, always remember to set ReturnError back to 1, so that further errors generate #COM.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 17

1.2.4 Advanced Driver generated statistics Number Label Description 0 Rd Req Number of read requests from Citect but

excludes trap requests 1 Rd Ok Number of successful read requests 2 Wrt Req Number of write request from Citect but

excludes trap writes 3 Wrt Ok Number of successful write requests 4 Sent Packets Number of packets sent.to SNMP agent 5 PDUGroupOK Value of PDUGroupOK 6 All traps Number of received traps 7 Traps in queue Number of traps in the queue 8 Traps Rd Number of trap read requests 9 Traps Wrt Number of trap write requests When PDU grouping occurs, the packet count will be less than the number of desired reads and writes. The difference gives the developer an indication of how well the “group” feature is working. Debug messages Data Read Mon Jun 05 11:08:50 2000 02:31:28.986 StartTransmit Length 0 Mon Jun 05 11:08:50 2000 02:31:28.986 Transmit Chk 00000000 Length 0 Mon Jun 05 11:08:50 2000 02:31:28.989 Read Request Addr:2 020E75F8 1 Length 0 Mon Jun 05 11:08:50 2000 02:31:28.990 Request Finish. Thread Will Suspend. Addr:2 Length 0 Data Write Mon Jun 05 14:19:49 2000 00:23:04.493 Write Request Addr:56 020E75F8 1 Length 0 Mon Jun 05 14:19:49 2000 00:23:04.495 Request Finish. Thread Will Suspend. Addr:56 Length 0 In the above messages, the Addr:2 or Addr:56 means the variable address (index in the SNMPVARS.DBF file) is 2 or 56. The following hexadecimal string is the pointer of the corresponding DCB and the following 1 is the returned value of ResumeThread() function.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 18

2. Analysis

2.1 Overview SNMP is a request-and-response protocol. An SNMP manager sends a request to an agent. The agent replies with a response that indicates if the operation was performed successfully or if an error occurred. Each SNMP operation has its own type of message. Each of these messages is used by a management system to request that an operation be performed on managed variables maintained by an SNMP agent. There are three request and response operations: Get, GetNext, and Set. A fourth operation, Trap, is an unsolicited message sent by an agent; it therefore does not have a corresponding request message. Trap messages can be generated for changes such as host system startup, shutdown, or password violation. Trap destinations can be configured by a user, but the occurrences which generate a trap message are internally defined by the SNMP agent. [The Citect driver does NOT support the GetNext request.] SNMP uses a distributed architecture consisting of managers and agents. A manager is an SNMP application that generates queries to SNMP agent applications and receives traps from SNMP agent applications. An agent is an SNMP application that responds to queries from SNMP manager applications. The SNMP agent is responsible for retrieving and updating local management information based on the requests of the SNMP manager. The agent also notifies registered managers when significant events or traps occur. A managed node is any network device that is capable of being managed. A management node is typically a workstation or server on a network that is running one or more network management software applications. Every managed node is a member of one or more management communities; each community is identified by a human readable name called a community name, or a community string when it is encoded in an SNMP message. A node that does not belong to one or more specific communities is said to belong to all management communities. If the agent is running on the node that it is actively managing, the node is said to “support SNMP management”. If the agent is not running on the node that it is managing, then the agent is described as a proxy agent because it is managing a node that cannot locally support SNMP management, or perhaps network connectivity itself. The Microsoft SNMP service is itself a proxy agent for any manageable devices accessible by a Windows workstation, such as modems, printers, and network interface controllers. A proxy can also be used to manage software processes that are running in the Windows operating system without the processes explicitly supporting SNMP. SNMP network management itself is composed of three parts: SNMP Protocol – specifies the behaviour of the Get, GetNext, Set, and Trap operations, and defines the format of the SNMP messages exchanged by managers and agents.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 19

Structure of Management Information (SMI) – the set of rules used to specify the format used for defining managed objects that are accessed via the SNMP protocol. Management Information Base (MIB) – the map of the hierarchical order of all managed objects and how they are accessed. All management operations are performed on managed objects, also called MIB objects. Each object represents data with a specific set of attributes, and can be manipulated using Get, GetNext, or Set operations. The Trap operation is merely an event report. The MIB and the SMI are expressed using a text-based data description notation known as Abstract Syntax Notation One (ASN.1). ASN.1 notation provides an unambiguous and hardware independent description of data in an ASCII text format. Basic Encoding Rules (BER) provides the same function, but encodes messages in a binary format suitable for transmission across a network.

2.2 Versions of SNMP There are presently two major versions of SNMP: SNMPv1 and SNMPv2. SNMPv1 is a “recommended standard” protocol and part of the Internet Management Framework. SNMPv2 is intended to be an update of SNMPv1, adding several features purposely omitted from SNMPv1 to expedite its acceptance and release. SNMPv2 itself has three different types:

? ? SNMPv2u - with user based security. ? ? SNMPv2* - with user based security and additional features. ? ? SNMPv2c - without security.

SNMPv2c has the endorsement of the IETF but has no security and administration whereas both SNMPv2u and SNMPv2* had security but lack the endorsement of the IETF. There is also an SNMPv3 development effort currently underway. The creation of SNMPv3 resulted from the Internet Engineering Steering Group (IESG) mandating the formation of an SNMP advisory group to unify the concepts and mechanisms of SNMPv2u and SNMPv2* into a single protocol with strong security. At this time, only the SNMPv1 protocol has widespread usage. The SNMPv1 protocol is most likely found in every managed device and management platform that supports SNMP. This driver implements version SNMPv2c as this is the version in the Windows NT SNMP server.

2.3 Packet Transmission SNMP uses the “connectionless” UDP transport protocol. An SNMP agent must establish connectionless sessions to listen for SNMP request messages and send responses. Under Windows NT, the WinSock API is used to establish a management session by dynamically creating a socket (an end-point in a network connection) using the specific protocol port reserved for SNMP.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 20

The following figure shows the location of SNMP and its associated protocols within the OSI network layer model.

7 Application Layer Management and Agent API’s

SNMP

6 Presentation Layer ASN.1 and BER

5 Session Layer RCP and NetBIOS

4 Transport Layer TCP and UDP

3 Network Layer IP and IPX

2 Data Link Layer Ethernet, ARCNet, and Token Ring

1 Physical Layer

Fig 2.1 – SNMP and the OSI model SNMP itself is implemented by software applications residing in the application layer. SNMP requires the services of the presentation layer (ASN.1 and BER) to render management data in a form that is suitable for transportation across a network, and allows it to be correctly interpreted regardless of the type of network device that receives it. UDP/IP encompasses the transport and network layer services used with SNMP. Data is passed from one OSI layer to another in discrete blocks called protocol data units (PDU’s). A PDU is a logical designation for the data in a packet that is used by a specific OSI layer or protocol. Before data can be transported across a network, it must be passed down the network stack, and “encapsulated” using the PDU formats defined at each layer. Each PDU is placed in the envelope of the next PDU until it reaches the physical layer, where it is sent out to the network. When the message reaches its destination, it must be “decapsulated” before the data in the message can be used. The next figure shows an SNMP message encapsulated in the envelopes it would need, to be transported across an Ethernet network using UDP/IP.

EthernetFrame CRCIP

PacketUDP

DatagramSNMP

Message

Fig 2.2 – An SNMP message and its network envelopes

The outermost envelope is used to identify the data link layer mechanism, which is Ethernet. The next envelope, IP, handles the actual routing of the message from node to node across the network. The UDP envelope indicates which protocol port on the receiving host should be used to receive the message. And the SNMP

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 21

message itself is recognised not only by the port at which it is received, but also by the information it contains. Application layer processes that handle PDU’s are called “network services”, and are identified by their assigned port numbers. SNMP uses two ports: 161 and 162. Port 161 receives all SNMP request messages. If an SNMP manager wants to send an SNMP request message to an agent, it specifies port 161 as the destination port in the UDP header. The SNMP response message is sent by the agent to the same port used by the SNMP manager to send the request message. User can also use a port other than 161 to receive all SNMP request message, this only can be used on the Windows2000 platform. Port 162 is the SNMP trap port. When an SNMP agent needs to send a trap to an SNMP manager, it specifies the destination as port 162 in the UDP header. The SNMP manager understands that all messages arriving via port 162 are SNMP Trap messages.

2.4 Object Identifiers Each object in a MIB is identified by a universally unique label referred to as an object-identifier (OID). The OID includes the object’s type (such as counter, string, gauge, or address), the object’s access level (such as read / write), size restrictions, and range information. The OID is internationally accepted and allows developers and vendors to create new components and resources and assign a unique OID to each new component or resource. The object name space is implemented as a multi-part, hierarchical, naming scheme. A hierarchical naming scheme can be viewed as an inverted tree with the branches pointing downward. Each point where a new branch is added is referred to as a node. Each node is enumerated using an unsigned 32-bit integer called a sub-identifier. The OID in the hierarchy is written as a sequence of sub-identifiers beginning at the root and ending at the object. Sub-identifiers are separated with a period. For example, the OID for “sysDescr” which is a textual description of the SNMP manageable device is : .1.3.6.1.2.1.1.1.0 The following diagram illustrates a part of a MIB tree.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 22

.1International Standards Organisation (ISO)

.3Organisation (ORG)

.6Department of Defence (DOD)

.1Internet

.1Directory

.2Mgmt

.3Experimental

.4Private

.1MIB-2

.1Enterprises

.311Microsoft

.437Cisco

.1Software

.1Systems

.2Wins

.3Dhcp

Fig 2.3 – OID Hierarchy Sample

The OID naming scheme is governed by the Internet Engineering Task Force (IETF). The IETF grants authority for parts of the name space to individual organizations, such as Microsoft. For example, Microsoft has the authority to assign the OIDs that can be derived by branching downward from the node in the MIB name tree that starts at .1.3.6.1.4.1.311.

2.5 Data Types All managed objects defined under SNMP are based on the three ASN.1 UNIVERSAL types: INTEGER - A signed whole number with no specific size limit,

although most SNMP implementations define INTEGER’s to be signed or unsigned 32-bit numbers.

OCTET STRING - A sequence of octets, where each octet is defined

as an 8-bit byte. The sequence may be printable ASCII characters or arbitrary binary data.

OBJECT IDENTIFIER - Stores the location of a variable (managed object)

within a MIB. The location is stored as an array of 16-bit unsigned integers called sub-identifiers.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 23

ASN.1 allows re-definition of data types (analogous to ‘typedef’ in C), and also sub-typing, whereby explicit range restrictions can be applied.

2.6 Managed Objects Each managed object is defined in a MIB module using the OBJECT-TYPE macro as defined by SMIv1. The object may be scalar and have only a single instance, or it may be columnar and have zero or more instances. The following is the ‘sysContact’ object defined in MIB-II, and is a typical definition of a scalar MIB variable:

sysContact OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) ACCESS read-write STATUS mandatory DESCRIPTION "The textual identification of the contact person for this managed node, together with information on how to contact this person." ::= { system 4 } The ‘sysContact’ label is the name or object descriptor of the variable and OBJECT-TYPE is the macro. The attributes of the object are described by the following four clauses which are defined by OBJECT-TYPE in RFC1155. (A “Request For Comments”, or RFC is an offical specification for Internet standards. All RFC’s are created, reviewed, and updated by the Internet Activities Board (IAB), and the Internet Engineering Task Force (IETF)). The attributes are as follows: SYNTAX - is the data type of the object and includes any range restrictions. ACCESS - describes the current access mode of the object, which can be

either read-only, read-write, write-only, or not-accessible. STATUS - describes the current need and validity of the object. The possible

values are: Mandatory - must be implemented by an agent, and the values

that they contain are valid for use. Optional - may or may not be implemented by an agent. Deprecated - these objects are in transition to Obsolete status.

They have been replaced by newer objects, but the data contained may still be valid.

Obsolete - no longer supported by the MIB and should not be

implemented by an agent. DESCRIPTION - is a human-readable string that describes the purpose of the

object and how it is to be used.

MIB registration – registration value is an OBJECT IDENTIFIER(OID). So in the example, ::= { system 4 } would map the OID of sysContact to 1.3.6.1.2.1.1.4 where 1.3.6.1.2.1.1 is the location of the system group in the internet branch of the MIB naming tree.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 24

2.7 SNMP Packets SNMP managers and agents are not required to support messages of greater than 484 bytes in length. Agents implemented on very small systems may strictly abide by this rule, but most network management systems are implemented on PC workstations may handle much larger messages (typically 1500 bytes). Each request or response message may contains one or more variable bindings (varbinds). Variable bindings are so named because they bind an OID name with a value. The OID is that of a single managed object defined in a MIB. The value may be any of the ASN.1 scalar data types defined by the SMI for use with SNMP, or the ASN.1 NULL value if the value field is not used. If a value is specified, its data type must match that of the object whose OID is specified in the same binding. The size of each binding is variable. The number of bindings that may be included in any PDU is also variable, with no set limit. SNMP guarantees that the order of the varbinds in a response message will be the same as in the corresponding request message. If an operation on one of the varbinds fails, then none of the values requested are returned. Instead, the varbind list of the response message will be an exact duplicate of the request message. Thus it is very important that a system be tested without any blocking first, before “grouping” is enabled to ensure each read or write will work under normal conditions.

2.8 Microsoft SNMP API & SNMP Management API Both Windows NT and Windows 98/95 support the SNMP agent service (SNMP.EXE). Only Windows NT however, supports the Microsoft SNMP Management API (MGMTAPI), along with the SNMP Trap Service (SNMPTRAP.EXE) (for receiving traps). MGMTAPI allows both Windows applications and MS-DOS Console applications to send “GetRequest”, “GetNextRequest”, and “SetRequest” messages, and to receive “GetResponse” and trap messages. The SNMP agent service supports most, but not all objects defined by MIB-II. These objects are implemented in the file INETMIB1.DLL. SNMP manager applications developed using MGMTAPI make use of the Microsoft SNMP API (SNMPAPI) for memory allocation and data manipulation. The Microsoft SNMP API’s were still undergoing development as at November 1999. Both SNMPTRAP.EXE and MGMTAPI interface to the WinSock API for all network communications required by the manager application. 2.8.1 Management Functions The set of management functions used for implementing SNMP manager applications are located in MGMTAPI.DLL. Their prototypes are found in MGMTAPI.H. The functions are linked using MGMTAPI.LIB. The management functions are as follows:

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 25

Function Usage

SnmpMgrClose Closes a network socket connection with an agent

SnmpMgrGetTrap Retrieves buffered trap data from an agent

SnmpMgrOidToStr Converts an AsnObjectIdentifier to an OBJECT IDENTIFIER

SnmpMgrOpen Opens a network socket connection to an agent

SnmpMgrRequest Sends a Get, GetNext, or Set request to an agent

SnmpMgrStrToOid Converts an OBJECT IDENTIFIER to an AsnObjectIdentifier

SnmpMgrTrapListen Registers a management application to receive traps

SnmpMgrCtl Set an operating parameter associated with an SNMP session, this is for setting port (WIn 2000 API)

Table 2.8.1 – SNMP Management API Functions 2.8.2 Utility Functions The set of utility functions used by SNMP manager applications are prototyped in SNMP.H; the functions themselves are located in SNMPAPI.DLL, and they are linked using SNMPAPI.LIB. The utility functions are as follows: Function Usage

SnmpUtilAsnAnyCpy Copies an AsnAny variable and allocates the required storage

SnmpUtilAsnAnyFree Frees the memory allocated for an AsnAny variable

SnmpUtilDbgPrint Prints debug messages to log file

SnmpUtilMemAlloc Allocates memory

SnmpUtilMemFree Frees allocated memory

SnmpUtilMemReAlloc Reallocates memory

SnmpUtilOctetsCmp Compares two AsnOctetString variables

SnmpUtilOctetsCpy Copies an AsnOctetString variable and allocates the required storage

SnmpUtilOctetsFree Frees the memory allocated for an AsnAny variable

SnmpUtilOctetsNCmp Compares two AsnOctetString variables

SnmpUtilOidAppend Appends AsnObjectIdentifier

SnmpUtilOidCmp Compares AsnObjectIdentifier objects

SnmpUtilOidCpy Copies an AsnObjectIdentifier object

SnmpUtilOidFree Frees an allocated AsnObjectIdentifier object

SnmpUtilOidNCmp Compares N number of AsnObjectIdentifier OID sub-identifiers

SnmpUtilPrintAsnAny Prints an AsnObjectIdentifier value to the standard output

SnmpUtilVarBindCpy Makes a copy of an RFC1157VarBind object

SnmpUtilVarBindFree Frees an allocated RFC1157VarBind object

SnmpUtilVarBindListCpy Makes a copy of an RFC1157VarBindList object

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 26

SnmpUtilVarBindListFree Frees an allocated RFC1157VarBindList object

SnmpSvcGenerateTrap Generate Enterprise trap

Table 2.8.1 – SNMP Utility API Functions

2.9 Glossary API Application Programming Interface ASN.1 Abstract Syntax Notation One BER Basic Encoding Rules IETF Internet Engineering Task Force IP Internet Protocol IPX Internet Packet Exchange MIB Managament Information Base OID Object Identifier PDU Protocol Data Unit RFC Request For Comments SMI Structure of Management Information SNMP Simple Network Management Protocol TCP Transmission Control Protocol UDP User Datagram Protocol

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 27

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 28

3. Driver implementation

3.1 Development resources 3.1.1 Contacts Greg Roberts Lead Citect Driver Developer Ci Technologies Pty Ltd E-mail: [email protected] Ph : +61-2-9855-1000 3.1.2 Documents 1. Windows NT SNMP, Murray, James D., O’REILLY, 1998. 2. Citect for Windows Driver Specification – SNMP Driver, Dowideit, Sven, 20 Nov.

1996. 3. SDK Documentation: Platform SDK: Networking and Distributed Services:

Simple Network Management Protocol, Microsoft Corporation, MSDN Jul. 1998/99.

4. Windows Resource Kits: MS Windows NT Server 4.0 Resource Kit: MS Windows

NT Server 4.0 Networking Guide: Chapter 11 - Using SNMP for Network Management, Microsoft Corporation, MSDN Jul. 1998/99.

5. Windows Resource Kits: MS Windows NT Server 4.0 Resource Kit: MS Windows

NT Server 4.0 Networking Guide: Appendix C – MIB Object Types for Windows NT, Microsoft Corporation, MSDN Jul. 1998/99.

6. RFC: 1155 - Structure and Identification of Management Information for

TCP/IP-based Internets, Rose, M. & McCloghrie, K., Internet Engineering Task Force, May 1990.

7. RFC: 1157 – A Simple Network Management Protocol (SNMP), Case, J., Fedor,

M., Schoffstall, M., & Davin, J., Internet Engineering Task Force, May 1990. 8. RFC: 1213 – Management Information Base for Network Management of

TCP/IP-based Internets: MIB-II, McCloghrie, K. & Rose, M., Internet Engineering Task Force, Mar. 1991.

9. Understanding OSI Network Management, Stallings, William, Dr. Dobb’s

Journal, Dec. 93. 10. Abstract Syntax Notation One (ASN.1), Witten, Steve, Dr. Dobb’s Journal, Nov.

94. 11. Simple Network Management Protocol (SNMP) – Current Standards and Status,

Cekro, Z., Universite Libre De Bruxelles, Faculte De Sciences, Mar. 1998

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 29

3.1.3 Software / Hardware

3.1.3.1 Software The Citect 5.xx SNMPII Driver will only function on a PC running Microsoft Windows NT (Server or Workstation) 4.0; Service Pack 6 or higher is recommended. The SNMPII driver WILL NOT work on a PC running Windows 98 or 95. A PC used as an SNMP host i.e. (as a Citect I/O Device) may use either Windows NT 4.0 or Windows 98/95. In this case, the TCP/IP protocol, and the SNMP service will be required. These software components are included on the Microsoft Windows NT/98/95 CD.

3.1.3.2 Hardware If a PC is to be used as an SNMP host, a TCP/IP compatible network card will be required.

3.2 Risk areas SNMP related bugs In Windows NT.

3.3 Development plan The SNMPII Driver is to be developed in MS-Visual C++ 6.0, and its target operating platform will be Citect 5.21 running on MS-Windows NT Workstation 4.0. Users of the initial release of the driver will be required to manually enter the OID’s for each of the SNMP Objects to be monitored. It is proposed that a future version will feature an OID selection tool with some kind of graphical user interface to ease the OID selection process. This tool will use as input, the *.MIB files that are normally supplied by harware vendors of SNMP manageable devices.

3.4 Beta testers None ? ?

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 30

4. Appendix

4.1 v1 SNMP Manual setup guide Step 1 Create a new Citect Project by selecting File | New Project… from Citect Explorer, then from the Citect Project Editor, select Communication | Express Wizard to configure communications. You will then need to add entries to the “I/O Devices” form for each device to be monitored by Citect. The IP address of each device must be entered in the “Address” field of this form. After entering the IP address, leave one space, then enter the name of the SNMP management community to which the device belongs. If no specific communities are defined for the device, or you are unsure, enter “public” without the quotes. Step 2 Create Tags for the SNMP objects to be monitored. The procedure for this is as follows: (a) Using a plain text editor, such as Windows Notepad, enter the details for all the

required Tags (except Trap Tags) in the following format (using one line for each entry):

INDEX,DEVNAME,TAGNAME,CTYPE,OID,SNMPTYPE,R/W,[RZS],[RFS],[EZS],[EFS],[EUNIT],[FORMAT], [COMMENT],[{num “Text”}{num “Text” repeated}] Each field is described in the Table below.

Field Name Description

INDEX A unique index number. You must begin with 0, and increment this value for each subsequent entry.

DEVNAME A unique descriptive name given to each Citect I/O Device, as specified in the I/O Devices form. It must not exceed 16 characters in length.

TAGNAME A unique descriptive name given to each Tag, and must not exceed 32 characters in length.

CTYPE

The Citect Data Type of the object, which can have one of the following values: LONG, REAL, STRING

Note that Tags with a Citect Data Type of STRING, are limited to a maximum length of 255 characters. For Tags with a required numeric range which goes outside the range: –2147483648 to 2147483647, you could assign a Citect Data Type of REAL.

OID The SNMP Object Identifier, e.g: .1.3.6.1.2.1.1.1.0

SNMPTYPE

The Citect SNMP data type, and can have one of the following values: DA - for alphanumeric string objects(octet string processed as null-terminated string) BA - for alphanumeric string objects(octet string processed as binary string) N - for numeric objects (treat as long in Citect) NE - for enumerated numeric objects (this is equivalent to the N type but indicates that Cicode macros should be generated using the MIB2CIN.EXE utility). NE objects always have the ENUMS field[s] defined.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 31

R - for numeric objects(treat as real in Citect)

R/W

The readability/ write-ability of the tag, which can have one of the following values: R - Read Only W - Write Only RW - Read and Write

RZS RAW ZERO SCALE, an optional field. RFS RAW FULL SCALE, an optional field. EZS ENGINEERING ZERO SCALE, an optional field. EFS ENGINEERING FULL SCALE, an optional field. EUNIT ENGINEERING UNIT, an optional field. FORMAT ENGINERRING FORMAT, an optional field.

COMMENT An optional comment, which must not exceed 48 characters in length. Any commas within this text must be removed.

ENUMS Enumerated values for the OID. These are data pairs of : {number1 “Text1”}{number2 “Text2”} This data is not used by the driver

Note 1: for optional fields, the commas (,) MUST be included in each line, but DO NOT include the square brackets ( [ ] ). Note 2: for detail of DA or BA, refer to 1.1.6 Refernece: DataTypes

(b) Save the file as VARIABLE.CSV in the Citect project folder e.g.

Citect\User\SNMP\VARIABLE.CSV (c) From Citect Project Editor, select Communication | Ports, then in the “Special

Opt” field, enter the name of the file created in the previous step, i.e. VARIABLE.CSV

(d) For each tag in the file VARIABLE.CSV, fill out a Variable Tag form to reflect the

data in the CSV file (Tags | Variable Tags in Citect Project Editor). Fill in each field as follows:

Field Value Variable Tag Name The value of TAGNAME in the file VARIABLE.CSV Data Type The value of CTYPE in the file VARIABLE.CSV I/O Device Name The value of DEVNAME in the file VARIABLE.CSV Address Sn where S is the value of SNMPTYPE in the file

VARIABLE.CSV and n is the value of INDEX. Raw Zero Scale The value of RZS in the file VARIABLE.CSV Raw Full Scale The value of RFS in the file VARIABLE.CSV Eng Zero Scale The value of EZS in the file VARIABLE.CSV Eng Full Scale The value of EFS in the file VARIABLE.CSV Eng Units The value of EUNIT in the file VARIABLE.CSV Format The value of FORMAT in the file VARIABLE.CSV Comment This field is user defined and is not used by the driver (e) If SNMP traps are to be monitored, seven extra Citect Variable Tags must be

created, one for each of the Enterprise, Agent IP Address, Generic Trap Type, Specific Trap Type, and Time Stamp trap fields and one each for the OID and value of the first variable binding. See Section 1.1.8 for further details.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 32

The value in the Address field of the Variable Tag form for these tags is T0, T1, …, T6, respectively, the Data Type is STRING and the I/O Device is any valid SNMP I/O device. Step 3 Create one or more graphics pages to mimic the devices you wish to monitor and control. Note that a tag configuration utility will soon become available to simplify the tag configuration process and avoid the duplication of data required in the above steps. See the Hints and Tips (Section 1.1.10) for screen shots showing an example of a VARIABLE.CSV file and a Variable Tag form.

4.2 SNMP Time Based PDU Grouping

Should this be required, the following is the suggested logic. Citect.ini [SNMP] section

PDUGroupCount 1 1 to 20 (Group to this figure, upto GroupTime)

WriteGroupEnable 0 0 or 1 (1 to group Writes as well) PDUGroupTime (ms) 0 O to 1000 (recommended value with

grouping, 20) By default, grouping of SNMP requests will not happen. PDUGroupCount has no meaning if the PDUGroupTime is zero. A non zero time value is the time window that exists from the first request, to group requests into the SNMP packet, before sending the packet. The default settings is for one VarBind per UDP packet. Version allows VarBinds to be stacked. This stacking logic is as follows :

If PDUGroupCount <= 1 or PDUGroupTime == 0 or neither exists Use version 1.0 request handling Else If First request Add VarBind into packet If write request and WriteGroupEnable==0 Use version 1.0 request handling Else

Record Time and start a PDUGroupTime Timer Suspend thread End If Else if ( Total pkt size will exceed 1500) Send out packet, cancel timer

Reset first request tag Re-enter this logic

Else if(VarBind Count == PDUGroupCount) Add VarBind into packet Send out packet, cancel timer Reset first request tag Suspend thread

Else

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 33

Add VarBind into packet Suspend Thread

End If End If If ThreadTimer has expired Send out packet, reset first request tag, suspend thread End If

4.3 SNMP Related Bugs Fixed in Windows NT Service Packs 4.3.1 Service Pack 6

Q228543 - Policy Editor Does Not Read SNMP Communities Correctly

Applies To: Microsoft Windows NT Server version 4.0 SP4

Symptoms: Simple Network Management Protocol (SNMP) communities are enhanced in Windows NT 4.0 Service Pack 4 to include permissions for communities. Policy Editor (Poledit.exe) cannot read these permissions or community names correctly because of changes made in the registry to support community security. Cause: Because Policy Editor reads all of the necessary registry entries at startup and then writes all of the entries when saved, whether the entry was changed or not, the SNMP configuration information was removed from Policy Editor to prevent the SNMP communities from being written in the previous format and because the SNMP configuration is not a policy. More Information: To configure SNMP communities, use the SNMP Manager tool in Control Panel. To open SNMP Manager, in the Control Panel Network tool, click Services, and then click SNMP Services.

Q238294 - Server Comment Set with SNMP Is Not Retained After

Restart

Applies To: Microsoft Windows NT Server version 4.0 and Microsoft Windows NT Workstation version 4.0

Symptoms: If you set a server comment using Simple Network Management Protocol (SNMP), the string you set lasts only until you restart the computer or you restart the Server service. Cause: This problem occurs because the Server service is not properly preserving the server comment in the registry when you use SNMP to set the comment. More Information: You can set the server comment for the Server service by using SNMP. The object identification (OID) is .1.3.6.1.4.1.77.1.2.1.0. You can use the Snmputil.exe tool from the Windows NT 4.0 Resource Kit to set or view the value.

Q241189 - SNMP Memory Leak in Windows NT4.0 Peer-to-Peer Network

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 34

Applies To: Microsoft Windows NT Server version 4.0 and Microsoft Windows NT Workstation version 4.0 Symptoms: When you run the Simple Network Management Protocol (SNMP) service on a computer connected to a Windows NT 4.0 peer-to-peer network without a domain controller, your computer may slow down or stop responding (hang). Cause: This behavior occurs because the SMNP Lmmib2.dll call queries the domain table function, for which there are no entries in a peer-to-peer network. This behavior results in a memory leak.

4.3.2 Service Pack 5 Q196270 - SNMP Agent Leaks Memory When Queried

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; and Microsoft Windows NT Server, Enterprise Edition version 4.0 Symptoms: Severe memory leakage occurs when the SNMP agent is under stress. Also, in Perfmon, for the Network Interface Object, you may notice a random number for the first instance, instead of 1.

Cause: This problem occurs because, while processing messages, a buffer was used that was never freed. A regression in Service Pack 4 caused the network interface problem.

4.3.3 Service Pack 4 Q152079 - SNMP Traps Contain Invalid Agent ID Field

Applies To: Microsoft Windows NT Workstation versions 3.51, 4.0; Microsoft Windows NT Server versions 3.51, 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition Symptoms: The Agent ID field in SNMP traps do not contain the source computer's IP address. The IP address, which is contained in this field, is always of the form 0.0.x.y where x.y is the decimal representation of the first four hexadecimal digits of the computer's host name. Cause: If the computer has a host name which is exactly 12 characters long and consists only of valid hexadecimal characters (1-9 and A-F), then the SNMP trap generation code assumes that the host name is actually a valid IPX address and places an invalid address in the Agent ID field. More Information: To work around this problem, perform one of the following:

? ? Make sure the host name is not 12 characters. ? ? Make sure one of the characters in the host name is not a valid

hexadecimal character. Q160035 - Memory Leak in SNMP Subagents

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 35

Applies To: Microsoft Windows NT Workstation versions 3.51, 4.0; Microsoft Windows NT Server versions 3.51, 4.0 Symptoms: Some SNMP subagents may leak memory when they receive non-null ASN types in GET or GETNEXT requests. This can be observed by monitoring SNMP/Private Bytes in Performance Monitor. Cause: Most SNMP subagents don't free non-NULL variable values for GET requests.

Q169847 - SNMP SysUpTime Counter Resets After 49.7 Days

Applies To: Microsoft Windows NT Workstation versions 3.51, 4.0; Microsoft Windows NT Server versions 3.51, 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition Symptoms: When using SNMP to monitor sysuptime (system up time), the counter will be reset after 49.7 days or 4294967295 milliseconds. Cause: MIB_II.MIB (RFC 1213) specifies sysUpTime as TimeTicks. SMI.MIB (RFC 1155) defines TimeTicks as having a max value for 4294967295. This is the number of milliseconds that this counter can hold. This also corresponds to about 50 days, this is why the counter resets back to 0.

Q177868 - SnmpMgrTrapListen API Returns ERROR_SERVICE_NOT_ACTIVE Error

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: When you write applications that call the SnmpMgrTrapListen API an error number 1062 (ERROR_SERVICE_NOT_ACTIVE) may be returned if the caller is not a member of the administrators group. This error will occur whether or not the SNMP trap service is started. Cause: The SnmpMgrTrapListen API was opening the service control manager database for all access (SC_MANAGER_ALL_ACCESS) to query the status of the SNMP trap service. This level could only be granted to members of the administrators group. More Information: The SnmpMgrTrapListen API now opens the service control manager database for SC_MANAGER_ENUMERATE_SERVICE to query the status of the SNMP trap service. If the service is not started, the API will attempt to start it. The user of the API will still need to be part of the administrators group to start the service if it is not started when the API runs. Or the user can use the SetServiceObjectSecurity API to change the security for the SNMP trap service.

Q178381 - SNMP Leaks Memory If the OID Cannot Be Decoded

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 36

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: Over time, the Windows NT system responsiveness appears sluggish, and Clients may report a gradual decrease in system performance. By tracking the amount of Private Bytes for Snmp.exe, it can be observed that, over time, it increases without decreasing. This is viewable using Windows NT Performance Monitor by selecting the following counter to monitor: Object: Process Instance: SNMP Counter: Private Bytes Cause: If SNMP cannot decode an OID from a network packet, SNMP does not free up the memory, resulting in a memory leak in the Snmp.exe processes. The impact of this leak will be more evident on a system running on a network segment that receive lots of SNMP broadcast traffic.

Q182322 - SNMP Appends Garbage to Data in Response to SNMP Get

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: The SNMP service may return garbage appended to a Get response. This happens when a SNMP application tries to get the description for the network interface card (NIC). Cause: The NIC is passing back a non-null terminated string. As a result, garbage is appended to the description of the NIC.

Q186455 – Mgmtapi.dll Opens Trap Socket in Exclusive Mode

Applies To: Microsoft Windows NT Server version 4.0; Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0, Terminal Server Edition Symptoms: The Microsoft SNMP service opens the TCP/IP trap socket 162 in exclusive mode. This disallows other management tools from also opening the socket. On starting, SNMP manager software may report an error referring to socket number 162. Additionally, the SNMP management software will not be able to receive traps from SNMP hosts. Cause: The Mgmtapi.dll route SnmpMgrTrapThread opens socket 162 in exclusive mode when this socket should be opened shared.

Q186473 - You Can Delete All Records on a WINS Server Using SNMP

Applies To: Microsoft Windows NT Server version 4.0 and Microsoft Windows NT Server version 4.0, Terminal Server Edition.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 37

Symptoms: It is possible to delete entries in a WINS database using SNMP. Deleting the entries is done by sending an SNMP set packet to your WINS server running SNMP, with a command telling it to delete a specific owner. If security is not set up to accept packets only from certain sources, and someone knows your community name, the server will accept any set packets as being valid and delete the WINS owners entries.

Q189225 – LMMIB2 Unable to "Walk" from .1.3.6.1.4.1.77.1.4.4

Applies To: Microsoft Windows NT Workstation version 4.0 SP4; Microsoft Windows NT Server version 4.0 SP4; Microsoft Windows NT Server, Enterprise Edition version 4.0; Microsoft Windows NT Server version 4.0, Terminal Server Edition Symptoms: An SNMP-based application (such as SNMPUTIL) receives an Error 5 Index 1 error message from the SNMP Service when it "walks" through .1.3.6.1.4.1.77.1.4.4 in the LANMAN II MIB. Cause: This problem occurs because Lmmib2.dll does not return the correct error message.

Q189245 - Lmmib2.dll Does Not Support All Objects

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; Microsoft Windows NT Server, Enterprise Edition version 4.0; Microsoft Windows NT Server version 4.0, Terminal Server Edition Symptoms: The current implementation of Lmmib2.dll supports the following objects documented in the Lmmib2.mib file: Common group Server group Workstation group Domain group However, Lmmib2.dll does not support the following objects: common.comType server.svAuditLogSize workstation.wkstaErrorLogSize domain.domLogonDomain domain.domLogonNumber domain.domLogonTable

Q190931 - Snmptrap.exe Ignores SNMP Trap PDU Greater Than 4,096 Bytes

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: SNMP Trap service running on Windows NT will ignore any trap Protocol Data Unit (PDU) that is larger then 4,096 bytes. Cause: The buffer size for the SNMP trap is limited to 4 KB.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 38

Q190932 - SNMP Service Ignores SNMP Trap PDU Greater Than 4,096 Bytes

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: An SNMP service running on Windows NT will ignore any trap Protocol Data Unit (PDU) that is larger then 4,096 bytes. Cause: The buffer size for the SNMP service is limited to 4 KB.

Q193206 - Acquiring SNMP Info For OSPF in RRAS Hangs

Applies To: Microsoft Windows NT Server version 4.0; Microsoft Windows NT Server, Enterprise Edition version 4.0; Microsoft BackOffice Small Business Server versions 4.0, 4.0a; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: On a Windows NT Server running Routing and Remote Access server (RRAS), an application tries to get SNMP information on OSPF and it quits responding or fails to obtain the information.

Q194130 - SNMP Edit Box Drops a Character When Writing to the Registry

Applies To: Microsoft Windows NT Server version 4.0; Microsoft Windows NT Workstation version 4.0; and Microsoft Windows NT Server version 4.0, Terminal Server Edition. Symptoms: In Properties for the Simple Network Management Protocol (SNMP), when filling in the Contact and Location fields, you are permitted to input up to 256 characters. However, when you apply these changes, only 255 of these characters are saved to the registry.

4.3.4 Service Pack 3 None. 4.3.5 Service Pack 2 Q154784 - Windows NT Operating System SNMP OID Incorrect

Applies To: Microsoft Windows NT Workstation versions 3.51, 4.00; Microsoft Windows NT Server versions 3.51, 4.00. Symptoms: SNMP traps generated on Windows NT Workstation and Server provide an object ID (OID). Where you expect to find the OID designating the Microsoft operating system, Inetmib1 sets as EnterpriseOID in the SNMP trap packet the following string: 1.3.6.1.2.1.11

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 39

Also the OID length is set to a greater value than the actual length, and three more unnecessary values are always attached to the OID. Cause: Inetmib1 sets the incorrect value for EnterpriseOID and an incorrect length for the OID. More Information: When the update below is applied to the Windows NT computer, the following IDs can be used to identify the type of Windows NT computer via SNMP: 3.1.1 for workstation 3.1.2 for servers 3.1.3 domain controllers (DCs)

Q163837 – SNMP Query to Windows NT Returns Same Value for NTS and NTW

Applies To: Microsoft Windows NT Workstation versions 3.51, 4.0; Microsoft Windows NT Server versions 3.51, 4.0. Symptoms: When you use an SNMP utility to obtain the system type from a computer running Windows NT, the value returned is the same for both Windows NT Server and Windows NT Workstation. The system types appear to be identical. Because Windows NT workstations and servers have different capabilities, it is necessary to differentiate between these versions of Windows NT, especially when managing a large network. In addition, it is necessary to differentiate between Windows NT Servers and Domain Controllers, since they also have different roles in the domain model. Cause: The SysObjectID field (1.3.6.1.4.1.311.1.1.3.1) returned by the computer running Windows NT is the same if the computer is running Windows NT Server or Windows NT Workstation. More Information: A change was made in Windows NT 4.0 Service Pack 2 (SP2) and Windows NT 3.51 post-SP5 to the SNMP components so that the different system types are now reported as follows: 1.3.6.1.4.1.311.1.1.3.1.1 for Windows NT Workstation 1.3.6.1.4.1.311.1.1.3.1.2 for Windows NT Servers 1.3.6.1.4.1.311.1.1.3.1.3 for Windows NT Domain Controllers

This enables the user of the SNMP utility to more precisely identify the type of Windows NT system.

4.3.6 Service Pack 1 None.

4.4 SNMP Related Bugs in Windows NT (not fixed) Q128746 - Removing SNMP leaves SNMP Counters in Performance Monitor

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 40

Applies To: Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0; Microsoft Windows NT Server versions 3.5, 3.51, 4.0 Symptoms: When you install Microsoft Simple Network Management Protocol (SNMP) under Windows NT 3.5, 3.51 and 4.0, the following objects are added to Performance Monitor: ICMP IP Network Interface TCP UDP

When you remove SNMP, the objects added to Performance Monitor during installation are not removed, and continue to be available. Cause: This behavior is by design. The objects are not removed in order to preserve the integrity of the performance monitor counters.

Q135597 - No Prompt to Restart When Adding SNMP Community Names

Applies To: Microsoft Windows NT operating system version 3.1; Microsoft Windows NT Advanced Server version 3.1; Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0; Microsoft Windows NT Server versions 3.5, 3.51, 4.0 Symptoms: When you add an SNMP Community Name the Network Settings dialog box closes without presenting the Restart dialog box. If you do not restart the computer, the SNMP Community Name information is not recognized. Resolution: To work around this problem, after adding SNMP information, shutdown and restart Windows NT or stop and restart the SNMP service in Control Panel Services.

Q146004 - SNMP Counter Values Are Unreliable in SMP Computers

Applies To: Microsoft Windows NT Server versions 3.5, 3.51, 4.0 Symptoms: Windows NT simple network management protocol (SNMP) counters, such as output queue length, may yield unlikely results in symmetric multiprocessor (SMP) computers. The SNMP counters can be viewed using Snmputil.exe from the Windows NT Resource Kit, or Performance Monitor using the Network Interface object. For example: snmputil getnext <server> public 2.2.1.21.1 Variable = interfaces.ifTable.ifEntry.ifOutQLen.2 Value = Gauge – 3749 NOTE: In normal operation, the output queue length counter should rarely rise above zero, when it does, it should return to zero very quickly. Cause: This problem occurs because Windows NT TCP/IP does not use interlocked operations to maintain its statistics counters. The SNMP counters are maintained in the TCP/IP code.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 41

In the case of output queue length, the counter is incremented every time a packet is indicated to NdisSend(), and decremented when NDIS completes the send successfully by returning a status of success, or returning status pending and later calling ARPSendComplete(). Because spinlocks are not used in this code to guarantee the integrity of the counters, SMP computers can affect the counter values during retrieval, causing unlikely values to be reported. The decision to not implement spinlocks to guarantee the integrity of the SNMP counters is based on performance concerns and will not be changed. More Information: Spinlocks were left out of the TCP/IP code for counter operations intentionally for performance reasons. This will not be fixed.

Q149080 - Err Msg in SNMPUTIL: "error on SnmpMgrRequest 40"

Applies To: Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0; Microsoft Windows NT Server versions 3.5, 3.51, 4.0; Microsoft Windows NT Resource Kit versions 3.5 and 3.51 Symptoms: The following error message appears when you use the Snmputil.exe utility in the Windows NT Resource Kit: Error on SnmpMgrRequest 40 MgmtAPI Process Detach This error occurs when the Simple Network Management Protocol (SNMP) service fails or does not start. Resolution: To correct this problem, restart the service or, if necessary, restart the computer.

Q152569 – SNMP Agent Does Not Respond After Suspend Power Is Invoked

Applies To: Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0; Microsoft Windows NT Server versions 3.5, 3.51, and 4.0; and Microsoft Windows 95. Symptoms: On a computer system that has advanced power management features or a manual power standby button (commonly found on portable computers), invoking this power feature will disable the SNMP agent. After the computer returns from the power saving mode, the SNMP agent does not respond. Cause: The SNMP agent does not reset after a power saving mode has been released. Resolution: The computer must be restarted to reinitialize the SNMP agent. If you use SNMP frequently, you may also want to disable any automatic power saving mode that is scheduled on the computer.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 42

Q158770 - SNMP Service Will Not Start with Event ID: 7024 Applies To: Microsoft Windows NT operating system version 3.1; Microsoft Windows NT Advanced Server version 3.1; Microsoft Windows NT Workstation versions 3.5, 3.51; Microsoft Windows NT Server versions 3.5, 3.51, 4.0 Symptoms: The SNMP service fails to start and displays the following message:

EVENT ID: 7024

Description: The SNMP Service terminated with service specific error 3.

Cause: One possible cause of this error is that another application may be binding to the same port as the SNMP Service. An easy way to determine if this is the problem is to change the port number that the SNMP service binds to. If this resolves the issue look, for any third-party applications that may be using the same port number. To change the port number that the SNMP service binds to, use a text editor (such as Notepad.exe) to edit the Services file located in Windows NT System32\Drivers\Etc directory. For example, # Copyright (c) 1993-1994 Microsoft Corp. #

# This file contains port numbers for well -known services as defined by # RFC 1060 (Assigned Numbers). # # Format: # # <service name> <port number>/<pro tocol> [aliases...] [#<comment>] # snmp 165/udp snmp snmp-trap 166/udp snmp

NOTE: Remember to change the values back after you are done testing. More Information: One method to determine if a service is using the same port as SNMP is to execute Netstat.exe from a command prompt using the following syntax:

netstat -an Q163595 - SNMP Entry Point not Found

Applies To: Microsoft Windows NT Server version 4.0; Microsoft Windows NT Workstation version 4.0 Symptoms: After you install the Simple Network Management Protocol (SNMP) service on your Windows NT 4.0 Service Pack 2 or later computer you may receive the following error message: SNMP Error - Entry point not found.

The procedure entry point SnmpSvcGetEnterpriseOID could not be located in the dynamic link library snmpapi.dll

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 43

Event Viewer on your Windows NT computer may also log one or more of the following event messages: Event ID : 7022 Source : Service Control Manager Description: The SNMP service hung on s tarting. -or- Event ID : 1106 Source : SNMP Description: The SNMP service is ignoring extension agent dll. C:\winnt\system32\inetmib1.dll because it is missing or misconfigured. Cause: The files you install with the SNMP service are from the original Windows NT installation media and are older than the files supplied with the service pack. Resolution: To resolve this issue, you will need to reapply the latest Windows NT service pack to update all the files. More Information: Compaq's Insight Manager is one application that requires the SNMP service to be installed and working correctly. Please use the following installation order when working with a computer that is using Insight Manager:

1. Install all required services including SNMP. 2. Before rebooting apply the latest Windows NT Service Pack. 3. Before rebooting apply the appropriate SSD from Compaq. 4. Reboot. 5. Install Insight Manager from Compaq.

Insight Manager is manufactured by Compaq Computer Corp., a vendor independent of Microsoft; we make no warranty, implied or otherwise, regarding this product's performance or reliability.

Q168451 - Cached IP Address Never Expires for SNMP Trap Destination

Applies To: Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0; Microsoft Windows NT Server versions 3.5, 3.51, 4.0 Symptoms: In the Simple Network Management Protocol (SNMP) Service Configuration, the trap destination can be entered as a host name or IP address. The host name is resolved to an IP address when the SNMP Agent loads, and is cached until the computer with the SNMP agent is restarted, or the SNMP service is stopped. This cached address is only used by SNMP; other services will do a name query to find this IP address. If the SNMP Agent is configured to send traps based on host name, and the IP address changes on the SNMP Management Station at some point after the SNMP Agent is started on the Windows NT computer, the trap would not be received. Resolution: If host names are used for trap destinations, and the IP address of a Network Management station changes, be sure to stop and restart the SNMP service on the Windows NT computer. The SNMP service

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 44

can be stopped and started by using the Services tool in Control Panel, or by typing net stop SNMP and net start SNMP at the command line. You can also use an IP address for the trap destination; and modify this address if needed.

Q169363 - DOC Err: SNMP OIDs Leave off Leading Dot

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0 Symptoms: In chapter 11 of the Windows NT 4.0 Server Resource Kit, several example OIDs for simple network management protocol (SNMP) are given without the leading dot. For example table 11.3 gives an example of: Internet MIB-II iso.org.dod.internet.mgmt.mib-2 1.3.6.1.2.1 This should be listed as: Internet MIB-II iso.org.dod.internet.mgmt.mib -2 .1.3.6.1.2.1 When you query using an incorrect oid you will receive the following error: Error: Invalid oid, x.x.x.x, specified.

When you use SNMP Monitor (Snmpmon.exe) from the Windows NT Resource Kit, SNMP monitor will simply not collect data. Resolution: To resolve this issue, use the syntax above that includes the leading dot (.)

Q170326 - SNMPUTIL Fails with "invalid oid <oid name> specified" Error Msg

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0 Symptoms: When you are using the Windows NT Server 4.0 Resource Kit utility SNMPUTIL or another simple network management protocol (SNMP) utility, the command fails with an "invalid oid <oid name> specified" error message. For example, when you attempt to perform the following "get" command, an error occurs: C:\PROGRA~1\reskit>snmputil get testmachine public system.sysDescr.0 Error: Invalid oid, system.sysDescr.0, specified. Cause: This is caused by an invalid Mib.bin file in the path. In the case of the above example, the SNMPUTIL utility uses the Mib.bin file in its current folder (which is the Mib.bin file that ships with the Windows NT Server Resource Kit), instead of the Mib.bin file in the %Systemroot%\System32 folder.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 45

Resolution: Rename all Mib.bin files in the path except the one in the %Systemroot%\system32 directory. After this is completed, the SNMP query will work successfully, as follows: C:\PROGRA~1\reskit>snmputil get testmachine public system.sysDescr.0 Variable = system.sysDescr.0

Value = OCTET STRING – Hardware: x86 Family 6 Model 1 Stepping 7 AT/AT COMPATIBLE - Software: Windows NT Version 4.0 (Build Number: 1381 Uniprocessor Free)

This behavior is by design.

Q173240 – Multihomed Agent Sends SNMP Trap with Incorrect IP Source

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0 Symptoms: When your multihomed Windows NT computer sends Simple Network Management Protocol (SNMP) traps, the IP address of the first interface is included as the originating host in the Agent ID field of the Trap Protocol Data Unit (PDU), even though the SNMP traps are being sent to the network on a different interface. Resolution: Microsoft has confirmed this to be a problem in Windows NT version 4.0. A supported fix is now available, but has not been fully regression-tested and should be applied only to systems experiencing this specific problem. Unless you are severely impacted by this specific problem, Microsoft recommends that you wait for the next Service Pack that contains this fix. Contact Microsoft Technical Support for more information. More Information: The Trap PDU is issued by an SNMP entity on behalf of a network management agent application. It is used to notify the management station of a significant event. The Agent ID field is included in the Trap PDU, and it should contain the IP address of the object generating the trap.

Q183864 - Windows NT 4.0 Resource Kit Perfm.bat Error

Applies To: Microsoft Windows NT Server version 4.0; Microsoft Windows NT Workstation version 4.0 Symptoms: When running the Perfm.bat batch file from the Windows NT resource kit to install SNMP Performance Monitor Agent Extensions, you may receive the error: Unable to open 'C:\NTRESKIT\LMMIB2MIB'

Also, the Mib.bin file created by this batch file is incorrectly only 23 bytes and Snmputil.exe queries may not work properly. Cause: The batch Perfm.bat file supplied with the Windows NT resource kit to automatically install SNMP Performance Monitor Agent Extensions has various typos and errors that cause it to fail.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 46

Resolution: The following batch file, if run from the NTReskit directory at an MS-DOS prompt inside of Windows NT, should create the correct Mib.bin file and add the Performance Counter Agent Extensions correctly: @echo off echo "Creating perfmib....." @echo on perf2mib perfmib.mib perfmib.ini memory 1 memory processor 2 CPU "Network Segment" 3 net PhysicalDisk 4 disk @echo off echo "Compiling perfmib" @echo on mibcc -omib.bin -n -t -w2 SMI.MIB LMMIB2.MIB mib_ii.mib perfmib.mib @echo off echo "Stopping snmp service" @echo on net stop snmp @echo off echo "Saving old mib to mib.old...." @echo on move %systemroot%\system32\mib.bin %systemroot%\system32\mib.old @echo off echo "Copying perfmib files from NTResKit to s ystem32" @echo on copy perfmib.dll %systemroot%\system32\perfmib.dll copy perfmib.ini %systemroot%\system32\perfmib.ini copy mib.bin %systemroot%\system32\mib.bin @echo off echo "Registering new Mibs" @echo on regini perfmib.reg @echo off echo "Restarting SNMP Service" @echo on net start snmp NOTE: If the SNMP Service causes an access violation when it restarts, restart the computer. More Information: To test the results of the batch file above, try the following command using the Snmputil.exe utility from the Windows NT resource kit:

SNMPUTIL get <agent> <community> .iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0

The results should look similar to the following:

>snmputil get <agent / computernmae> <communtiy> .iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0 Variable = .iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0 Value = INTEGER - 757760

The above example is the "memory free" OID.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 47

Q185208 - Compaq CPM v1.10 Causes 100% Processor Usage in SNMP

Applies To: Microsoft Windows NT Server version 4.0; Microsoft Windows NT Workstation version 4.0 Symptoms: A computer running Windows NT Server or Workstation with Compaq's Power Management Service version 1.10 installed but not enabled, may experience 100 percent processor usage in the SNMP process. Resolution: To work around this problem, enable the Compaq Power Management Service v1.10 to allow the processor usage for the SNMP service to return to normal operating levels. To resolve this problem, upgrade the Compaq Power Management Service v1.10 to version 1.20. More Information: The third-party products discussed here are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

Q194169 - SNMP Process Object Returns the Incorrect Value

Applies To: Microsoft Windows NT Server version 4.0 Symptoms: The Object Identifier (OID) for the Process Instance Name counter does not return the correct value when sending an SNMP Get or Walk. Also, when walking the process OID tree when there are multiple processes with the same name, the SNMP walk will go into an endless loop. More Information: Performance Monitor objects can be created by using the Perfmib utilities from the Windows NT 4.0 Resource Kit. The following steps can be used to create a Management Information Base (MIB), which exposes the Performance Monitor process objects: 1. From an MS-DOS prompt, run the Perfmib.reg utility from the Windows NT 4.0 Resource Kit. This will create the appropriate registry entries for the Perfmib.dll extension agent. 2. Build a Perfmib.mib and a Perfmib.ini file using the Per2mib.exe utility from the Windows NT 4.0 Resource Kit. For example, from an MS-DOS prompt, run the following command: perf2mib perfmib.mib perfmib.ini process 300 proc This creates a Perfmib.mib file and a Perfmib.ini file. These files are used to expose the performance monitor process instance object. 3. Stop the SNMP service by doing either of the following: - From an MS-DOS prompt, run the following command: net stop SNMP -or- - Stop SNMP by using the Services utility in Control Panel.

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 48

4. Rename the mib.bin file, found in the System32 folder, to mib.old. 5. Compile a new mib.bin file, which will include the perfmib.mib file created earlier in step 2, by performing the following steps:

a. From an MS-DOS prompt, set the default folder to t he Windows NT 4.0 Resource Kit folder (for example, type: CD %ntreskit%).

b. Run the following command: mibcc -n o%ntreskit%\mib.bin -t -w2 smi.mib lmmib2.mib mib_ii.mib perfmib.mib 6. Copy the following files from the Windows NT 4.0 Resource Kit folder (%ntreskit%) to the System32 folder (%SystemRoot% \System32 folder): Mib.bin Perfmib.bin Perfmib.ini Perfmib.dll 7. Start the SNMP service by doing either of the following: - From an MS-DOS prompt, run the following command: net start SNMP -or- - Start SNMP by using the Services utility in Control Panel. After the new MIB that contains the performance monitor process instant objects is created, it can be tested by using the Snmputil.exe utility found in the Microsoft Windows NT 4.0 Resource Kit. To test the MIB do the following: 1. From an MS-DOS prompt, run the following command to change your default to the resource kit directory: CD %ntreskit% 2. Use the Snmputil utility to walk the process OID tree: Run the following command: Snmputil walk localhost public .1.3.6.1.4.1.311.1.1.3.1.1.300.1.1 Results: If there are two processes with the same name, the utility will loop indefinitely. As long as there are not two processes with the same name, the utility will successfully walk the tree but it will not display the process instance name (.1.3.6.1.4.1.311.1.1.3.1.1.300.1.2); this value will be skipped.

Q195336 - Resource Kit Perfmib.dll Cannot Read Some SNMP Counters

Applies To: Microsoft Windows NT Workstation version 4.0; Microsoft Windows NT Server version 4.0

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 49

Symptoms: After installing the Perf2Mib utility from the Windows NT Resource Kit, SNMP queries to various Performance Monitor Object Counters return a value of zero. Cause: The Perfmib.dll does not handle object instances correctly. Resolution: A new version of Perfmib.dll that resolves this problem is available on: "ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/<Platform>

Please note that the Perf2Mib utility has been removed from the Resource Kit as of Supplement2 and, consequently, future issues concerning the tool will not be addressed. More Information: Using Perf2mib.exe, the Performance Monitor MIB Builder Tool, developers can create new ASN.1 syntax MIBs for their applications, services, or devices that use Performance Monitor counters. Administrators can then track performance of these components by using any system-management program that supports SNMP. This tool also creates a .mib file that can be used by an SNMP-based management console to perform SNMP requests for the performance data in question and, thus, to monitor performance remotely. This allows all performance data available through the HKEY_PERFORMANCE_DATA registry key to be exposed through SNMP.

4.5 SNMP Related Bugs in Windows 95/98 (not fixed) The following bugs have not been fixed at the time of this release. Q152569 – SNMP Agent Does Not Respond After Suspend Power Is Invoked

Applies To: Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0; Microsoft Windows NT Server versions 3.5, 3.51, and 4.0; and Microsoft Windows 95. Symptoms: On a computer system that has advanced power management features or a manual power standby button (commonly found on portable computers), invoking this power feature will disable the SNMP agent. After the computer returns from the power saving mode, the SNMP agent does not respond. Cause: The SNMP agent does not reset after a power saving mode has been released. Resolution: The computer must be restarted to reinitialize the SNMP agent. If you use SNMP frequently, you may also want to disable any automatic power saving mode that is scheduled on the computer.

Q159565 – SNMP Agent Does Not Respond After Returning from Suspend Mode

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 50

Applies To: Microsoft Windows 95 OEM Service Release versions 2, 2.1

Symptoms: When you are using Advanced Power Management features and the computer returns from Suspend mode, SNMP Agent may not respond when you attempt to administer the computer with SNMP network management software.

Cause: SNMP Agent is not compatible with Advanced Power Management.

Resolution: When the computer returns from Suspend mode, quit and restart Snmp.exe. To do so, type the following lines at a command prompt, pressing ENTER after each line:

snmp -close snmp Q159567 - Windows 95 SNMP Agent Allows Only Read-Only Access

Applies To: Microsoft Windows 95 Symptoms: When you attempt to change the string value of the sysContact, sysName, or sysLocation object on a Windows 95-based computer using an SNMP manager (such as Hewlett-Packard OpenView), you may receive the following error message:

SNMP error - sysContact read only (OV3122) Cause: The Windows 95 SNMP agent allows only read-only access for the sysContact, sysName, and sysLocation objects. Resolution: WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall Windows 95. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. NOTE: For information about how to edit the registry, view the Changing Keys And Values online Help topic in Registry Editor (Regedit.exe). Note that you should make a backup copy of the registry files (System.dat and User.dat) before you edit the registry. Use Remote Registry Editor to set the values listed below for the sysContact, sysName and sysLocation fields. The sysName object is not exposed by System Policy Editor (Poledit.exe). sysContact OBJECT-TYPE

SYNTAX DisplayString (SIZE (0..255)) ACCESS read-write STATUS mandatory DESCRIPTION

"The textual identification of the conta ct person for this managed node, together with information how on to contact this person."

::= { system 4 }

Registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SNMP\RFC1156Agent\SysContact

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 51

sysName OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) ACCESS read-write STATUS mandatory DESCRIPTION "An administratively assigned name for this managed node. By convention, this is the node's fully qualifi ed domain name." ::= { system 5 }

Registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName

sysLocation OBJECT-TYPE

SYNTAX DisplayString (SIZE (0..255)) ACCESS read-write STATUS mandatory DESCRIPTION "The physical location of this node (e.g., 'telephone closet, 3rd floor')." ::= { system 6 }

Registry key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SNMP\RFC1156Agent\SysLocation More Information: The values for the SNMP objects sysContact, sysName, and sysLocation are documented in the Internet MIB-II definition in RFC 1158.

Q188202 - Err Msg: A Required .DLL File, SNMPAPI.DLL, Was Not Found

Applies To: Microsoft Windows 98 Symptoms: When you install the Microsoft Simple Network Management Protocol (SNMP) agent on a computer using Microsoft Client for NetWare Networks, the SNMP agent may not start and you may receive the following error message:

A required .DLL file, SNMPAPI.DLL, was not found. Cause: This behavior can occur because the Snmpapi.dll file is not installed with the Microsoft Client for NetWare Networks. Resolution: To resolve this issue, install the Microsoft SNMP Agent. To do so, use the following steps: 1. Click Start, point to Settings, click Control Panel, and then double-click Network. 2. Click Add, click Service, click Have Disk, type the path to the

Tools\Reskit\Netadmin\SNMP folder on your Windows 98 CD-ROM, and then click OK. For example, if your CD-ROM drive letter is D, the path would be:

d:\Tools\Reskit\Netadmin\SNMP

Citect for Windows, V5.xx SNMP Driver

© Copyright 1999 Ci Technologies Page: 52

NOTE: If you are prompted to specify the location of additional files, specify the path to the Windows 98 source files on a network share, or on the Windows 98 compact disc.