PI_WindowsWMI.doc



WMI

Interface to the PI System

Version 1.0.0.0

Rev I

How to Contact Us

|Phone |(510) 297-5800 (main number) |

| |(510) 297-5828 (technical support) |

|Fax |(510) 357-8136 |

|E-mail |techsupport@ |

|World Wide Web | |

|Mail |OSIsoft |OSI Software, Ltd |

| |P.O. Box 727 |P O Box 8256 |

| |San Leandro, CA 94577-0427 |Symonds Street |

| |USA |Auckland 1035 New Zealand |

| | | |

| |OSI Software GmbH |OSI Software, Asia Pte Ltd |

| |Hauptstra(e 30 |152 Beach Road |

| |D-63674 Altenstadt 1 |#09-06 Gateway East |

| |Deutschland |Singapore, 189721 |

Unpublished – rights reserved under the copyright laws of the United States.

RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)

of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013

Trademark statement—PI is a registered trademark of OSIsoft, Inc. Microsoft Windows, Microsoft Windows for Workgroups, and Microsoft NT are registered trademarks of Microsoft Corporation. Solaris is a registered trademark of Sun Microsystems. HP-UX is a registered trademark of Hewlett Packard Corp.. IBM AIX RS/6000 is a registered trademark of the IBM Corporation. DUX, DEC VAX and DEC Alpha are registered trademarks of the Digital Equipment Corporation.

PI_OSIWMI.doc

( 2005 OSIsoft, Inc. All rights reserved

777 Davis Street, Suite 250, San Leandro, CA 94577

Table of Contents

Introduction 1

Reference Manuals 1

Supported Features 1

Diagram of Hardware Connection 3

Principles of Operation 5

WMI Architecture 5

WMI Data Model 5

Class Examples 6

Query Object Methods 7

Class Properties 8

Point Groups 8

Interface Operation 9

Installation Checklist 11

Interface Installation 13

Naming Conventions and Requirements 13

Interface Directories 14

The PIHOME Directory Tree 14

Interface Installation Directory 14

Interface Installation Procedure 14

Installing the Interface as an NT Service 14

Installing the Interface Service with PI-Interface Configuration Utility 15

Installing the Interface Service Manually 17

WBEMTest.exe 19

Map File 25

Digital States 27

PointSource 29

PI Point Configuration 31

Point Attributes 31

Tag 31

PointSource 31

PointType 31

Location1 31

Location2 31

Location3 32

Location4 33

Location5 33

InstrumentTag 33

ExDesc 33

Scan 36

Shutdown 36

Performance Point Configuration 39

I/O Rate Tag Configuration 41

Monitoring I/O Rates on the Interface Node 41

Configuring I/O Rate Tags with PI-ICU (NT-Intel) 41

Configuring I/O Rate Tags Manually 42

Configuring the PI Point on the PI Server 43

Configuration on the Interface Node 43

Startup Command File 45

Configuring the Interface with PI-ICU 45

osiwmi Interface Tab 47

Command-line Parameters 50

Sample OSIWMI.bat File 55

Windows Security 55

Interface Node Clock 59

PI Security 61

Starting / Stopping the Interface 63

Starting Interface as a Service 63

Stopping Interface Running as a Service 63

Buffering 65

Configuring Buffering with PI-ICU 65

Configuring Buffering Manually 68

Example piclient.ini File 70

Appendix A: Error and Informational Messages 71

Message Logs 71

Messages 71

Troubleshooting 72

System Errors and PI Errors 72

Appendix B: Examples 73

Win32_PingStatus (Looking at the Class) 73

Win32_PingStatus (Point Configuration) 76

PingStatus Digital State Set 76

Win32_Process (Order by Group) 78

GetObject 79

Win32_LogicalDisk (FreeSpace) 79

Compound Key 79

Object Singleton 79

Revision History 81

Introduction

Windows Management Instrumentation (WMI) exposes management information about hardware and software running on a Windows computer. The PI-WMI Interface is used to monitor and store this information in PI. A single instance of the interface can read WMI from many connected computers. This interface is uni-directional, in that it supports only reads from WMI. Outputs from the PI Server to WMI are not supported. This interface supports reading WMI on all Windows operating systems where WMI is installed. However it is recommended the interface run on a Windows 2000 machine or better.

Reference Manuals

OSIsoft

• PI Server manuals

• PI-API manual

• UniInt End User Document

Vendor

There is a considerable amount of documentation available about WMI. For the purposes of configuring this interface a good understanding of the available classes is necessary along with some understanding of WMI Query Language (WQL).

Microsoft’s MSDN Library is a comprehensive source of current information. For a general overview see:



Specific Class information:



Security Information:



Supported Features

|Feature |Support |

|Part Number |PI-IN-OS-WMI |

|Platforms |Windows 2000 or better |

|APS Connector |No |

|Point Builder Utility |No |

|ICU Control |Yes |

|PI Point Types |PI 3: Float16 / Float32 / Float64 / Int16 / Int32 / |

| |Digital / String |

| |PI 2: Real / Integer / Digital |

|Sub-second Timestamps |Yes |

|Sub-second Scan Classes |Yes |

|Automatically Incorporates PI point Attribute Changes |Yes |

|Exception Reporting |Yes |

|Outputs from PI |No |

|Inputs to PI: Scan-based / Unsolicited / Event Tags |Scan-based / Event Tags |

|Maximum Point Count |Point Count of PI Server |

|Uses PI-SDK |Yes (optional) |

|PINet to PI 3 String Support |N/A |

|* Source of Timestamps |PI Server or device |

|History Recovery |No |

|* Failover |Yes |

|* UniInt-based |Yes |

|Vendor Software Required on PI-API Node |No |

|* Vendor Software Required on Foreign Device |Maybe |

|Vendor Hardware Required |No |

|Additional PI Software Included with Interface |No |

* See paragraphs below for further explanation.

Source of Timestamps

Typically the interface will use the PI server time at the time the query was made to WMI. Alternatively, the interface can read any property of type DateTime and use it for the timestamp of the value written to PI.

Failover

The interface supports cold failover via a third-party cluster server.

UniInt-based

UniInt stands for Universal Interface. UniInt is not a separate product or file; it is an OSIsoft-developed template used by our developers, and is integrated into many interfaces, such as the PI-WMI Interface. The purpose of UniInt is to keep a consistent feature set and behavior across as many of our interfaces as possible. It also allows for the very rapid development of new interfaces. In any UniInt-based interface, the interface uses some of the UniInt-supplied configuration parameters and some interface-specific parameters. UniInt is constantly being upgraded with new options and features.

The UniInt End User Document is a supplement to this manual.

Vendor Software Required

WMI is an integrated part of the Windows Operating System and is included with Windows 2000, Windows XP and Windows 2003. It is located in the "SystemRoot\system32\wbem" folder. WMI can be downloaded for earlier versions of Windows from the Microsoft web site . Search for

“Windows Management Instrumentation (WMI) CORE 1.5 (Windows 95/98/NT 4.0)”

It is recommended that the latest service packs be installed on all operating systems.

Diagram of Hardware Connection

[pic]

Principles of Operation

WMI is Microsoft's implementation of the Web-based Enterprise Management (WEBM) Initiative. WBEM defines a set of standards deployed to provide a unified management standard within enterprise computing environments.

WMI Architecture

The WMI architecture consists of three layers. Layer one contains managed objects in the enterprise and providers of management information. Providers are COM or .NET components which monitor managed objects and expose real-time information about them to WMI. Any managed application can provide one or multiple managed objects and a provider to communicate the management information to WMI.

Layer two is the WMI infrastructure which is provided by the Windows Operating System. The WMI infrastructure consists of the "Windows Management Instrumentation" service and the WMI store (CIM repository). The Windows Management Instrumentation service is the intermediary between the providers, the consumers, and the CIM repository. Providers place information into the CIM and consumers can query for this information. The WMI service controls this flow of data and can also pass information directly between providers and consumers.

Layer three consists of management applications. These applications interact with the WMI service to read or set information about managed objects. The PI-WMI Interface works within this layer.

WMI Data Model

Each managed object is represented in the CIM by a class. A class describes the available properties, methods, and associations of a managed object. An instance of a class describes a managed object at a point in time. Each class is associated with a namespace in the CIM repository.

Properties

Properties are information about an instance of a class. Properties may be local or inherited.

Methods

Methods are actions that may be performed on a class instance. Methods are not supported in this interface.

Qualifiers

Qualifiers provide additional qualifying information about the class, the property, or the method.

Class Examples

To better understand the WMI data model and how it relates to this interface, the properties of the Win32_Process class and example values for an instance of this class are described below. This class, part of the root/cimv2 namespace, provides information about processes on this computer. A client can read from the CIM repository an instance of this class for each process running on the machine. These instances in the repository are created by a WMI provider, in this case the CIMWin32 provider.

|Win32_Process |

|Property |Example Value |

|Caption |cscript.exe |

|CommandLine |cscript.exe temp_script.vbs |

|CreationClassName |Win32_Process |

|CreationDate |20050104165548.869957+480 |

|CSCreationClassName |Win32_ComputerSystem |

|CSName |LOMBARDI |

|Description |cscript.exe |

|ExecutablePath |\WINDOWS\system32\cscript.exe |

|ExecutionState | |

|Handle |5664 |

|HandleCount |135 |

|InstallDate | |

|KernelModeTime |156250 |

|MaximumWorkingSetSize |1413120 |

|MinimumWorkingSetSize |204800 |

|Name |cscript.exe |

|OSCreationClassName |Win32_OperatingSystem |

|OSName |Microsoft Windows XP Professional| |

| |C:\WINDOWS|\Device\Harddisk0\Partition 1 |

|OtherOperationCount |331 |

|OtherTransferCount |3312 |

|PageFaults |1505 |

|PageFileUsage |4063232 |

|ParentProcessId |3604 |

|PeakPageFileUsage |4063232 |

|PeakVirtualSize |57737216 |

|PeakWorkingSetSize |5967872 |

|Priority |8 |

|PrivatePageCount |4063232 |

|ProcessId |5664 |

|QuotaNonPagedPoolUsage |5680 |

|QuotaPagedPoolUsage |49384 |

|QuotaPeakNonPagedPoolUsage |5680 |

|QuotaPeakPagedPoolUsage |49384 |

|ReadOperationCount |111 |

|ReadTransferCount |309062 |

|SessionId |0 |

|Status | |

|TerminationDate | |

|ThreadCount |7 |

|UserModeTime |468750 |

|VirtualSize |57737216 |

|WindowsVersion |5.1.2600 |

|WorkingSetSize |5967872 |

|WriteOperationCount |2 |

|WriteTransferCount |144 |

The simplest way the interface can use this class is to periodically poll WMI for a specific instance of this class and send the value of a single property to a PI point.

For example, a query of WMI might be for an instance of Win32_Process where the Description property is cscript.exe and the value of the WorkingSetSize property is sent to a PI point. This is suitable if the name of the process is known. Alternatively, another query might be for logging the process name of any process where the working set size has exceeded some value. In this case, Win32_Process could be polled for all instances where the WorkingSetSize > 100000000 so the value of the description property is sent to a PI point.

Similarly with the Win32_LogicalDisk class, a specific instance of Win32_LogicalDisk may be selected where DeviceID is equal to ”C” or an instance may be selected depending on some criteria, e.g. Win32_LogicalDisk where FreeSpace < 10000 and the drive name is sent to PI.

Query Object Methods

The PI-WMI Interface uses the Windows COM API for WMI to read objects from WMI. The following query methods are available to request the WMI object of interest:

GetObject

This is the simplest method of retrieving a single object. GetObject is used when the instance of the object can be exactly specified. For example, use GetObject to get Win32_LogicalDisk.DeviceID=’C’. The value of one or more properties of this object may be sent to PI.

ExecQuery

This method queries WMI with WMI Query Language (WQL) where the syntax is similar to SQL. ExecQuery is useful when more than one object can be returned or when choosing an object using some criteria. For example, the WQL query

Select * from Win32_LogicalDisk where FreeSpace < 1000000 will return all Win32_LogicalDisk instances where the FreeSpace property is less than 1000000.

High Performance Refresh

Some WMI providers support a high performance interface in which the client directly accesses an object property from the provider. Once a property is read from the provider, the property can be “refreshed” without the overhead of communicating through the WMI service. The Performance Counter Classes are one example where a High Performance Provider is available.

Class Properties

Each Class property has a defined data type. Typically these are String, Integer (8-, 16-, 32- or 64-bit signed or unsigned), Real, Boolean, DateTime, Object, or Array. When writing to a PI point, the PI-WMI Interface will attempt to convert a property value to the type of the PI point.

Conversions are made for the property types Boolean, DateTime, and Array. The type Boolean is converted to an integer (0=False, 1=True) when the PI point’s PointType is numeric or digital. If the PI point’s PointType is String, the Boolean value is converted to the string “True” or “False.” DateTime values are converted depending on the interface startup parameter /dt. Properties of type array are converted to comma-separated strings based on Location3. Properties of type Object are not supported. A further conversion can be made on a property value via a Map file. (See the Map File section for more information.) This provides a one-to-one conversion between property values and the values sent to PI.

Note: When passing a value of a property to WMI, for example in a WQL query, care must be taken to enclose strings in single quotation marks (‘).

Point Groups

It is possible to read more than one property from a single instance of an object. Also, a single query may return more than one instance of an object.

Points with identical queries to the same namespace will be grouped together so that only one query is made to WMI. Each point in this point group then reads its value from the properties of the object or objects returned by the query.

Where more than one class instance is expected to be returned from an ExecQuery, points can be configured so that either all returned instances are written to a single PI point or each returned instance is distributed to a PI point within a group. In the latter case, the returned instances are ordered in the interface using the OrderBy keyword and distributed depending on the points’ Location3 value. In the event a greater number of class instances are returned by the query than there are PI points configured in the OrderBy group, the additional instances will be discarded. An example of point grouping is given in Appendix B: Win32_Process.

Interface Operation

The interface is scan-based. Each scan class is defined in the interface startup parameters. PI points are grouped by scan classes using the points’ Location4 attribute.

When a point is loaded in the interface either on startup or from a point update, the interface first checks to see if a point, already loaded in this scan class, has the same namespace and query as the new point. If this is the case, the new point is added to the existing point’s query (point) group. If there is no existing point group, a new one is made for this new point. Each point group is further sorted so that all point groups for the same namespace are placed in a single namespace list.

This interface is multi-threaded. Queries to WMI are made within a thread pool where each namespace list is submitted to the thread pool whenever its scan is due. In the event a namespace list submitted to the thread pool has not completed by the time its next scan becomes due, the interface will skip the scan for this namespace list. For this reason, it is advisable that queries that are expected to take a long time to complete are not grouped with queries that are expected to be quick. This can be achieved by grouping the points in different scan classes.

Note: The standard UniInt performance summary has little relevance to this interface. The interface will write its own performance summary at 8-hour intervals, if any namespace lists are skipped.

When a new point group is created in the interface, the interface attempts to connect this point group to the WMI namespace on the required computer. If a connection is not able to be established, the interface will periodically retry the connection using the time specified by /recTime. Points that are not connected will have the system digital state I/O Timeout written to them. During a scan, points that are not connected will be skipped. If, during a scan, an error is returned from the query, the interface will write the system digital state Failed to the point to indicate a failure. Failures that indicate a connection problem will close this connection to the WMI service. Other failure types will not force a disconnection and will continue to query WMI each scan. Messages detailing the specifics of the error will be logged in the PIPC.log file.

|Failure Code |System State |Comment |

| |Written to PI | |

|ACCESS_DENIED |Failed | |

|INVALID_CLASS |Failed | |

|INVALID_PARAMETER |Failed | |

|INVALID_OBJECT_PATH |Failed | |

|INVALID_QUERY |Failed | |

|FAILED |Failed |Generic failure |

|TIMED_OUT |Failed |See /tmOut |

|SHUTTING_DOWN |I/O Timeout |Will force a disconnect |

|TRANSPORT_FAILURE |I/O Timeout |Will force a disconnect |

|NOT_AVAILABLE |I/O Timeout |Will force a disconnect |

On startup, the interface tries to connect to all point groups before scanning will commence.

Installation Checklist

For those users who are familiar with running PI data collection interface programs, this checklist helps get the PI-WMI Interface running. For those not familiar with PI interfaces return to this section after reading the rest of the manual in detail.

1. Install the PI-Interface Configuration Utility. (This also installs PI-SDK and PI-API.)

2. Verify that PI-API and PI-SDK are installed and can connect to the PI server

3. Install the interface.

4. Create the Map File.

5. Define digital states for digital points. If a custom state is to be used for Null values, add this state to the system digital state set.

6. Choose a point source. If PI 2 home node, create the point source.

7. Configure PI points.

Location1 Interface instance.

Location2 Output format.

Location3 Order-by group number.

Location4 Scan class.

Location5 Not used.

ExDesc Query and Property to send to PI.

InstrumentTag Namespace.

8. Configure I/O Rate tag.

9. Configure the interface using the PI-ICU utility or edit startup command file manually. It is recommended that PI-ICU be used whenever possible.

10. Set interface node clock

11. Set up security.

12. Start the interface without buffering.

13. Verify data, check PIPC.log file for error messages.

14. Stop interface, start buffering, start interface.

Interface Installation

OSIsoft recommends that interfaces be installed on PI Interface Nodes instead of directly on the PI Server node. A PI Interface Node is any node other than the PI Server node where the PI Application Programming Interface (PI-API) has been installed (see the PI-API manual). With this approach, the PI Server need not compete with interfaces for the machine’s resources. The primary function of the PI Server is to archive data and to service clients that request data.

After the interface has been installed and tested, Bufserv should be enabled on the PI Interface Node. (Once again, see the PI-API manual.) Bufserv is distributed with the PI-API. It is a utility program that provides the capability to store and forward events to a PI Server, allowing continuous data collection when communication to the PI Server is lost. Communication will be lost when there are network problems or when the PI Server is shut down for maintenance, upgrades, backups, or unexpected failures.

In most cases, interfaces on PI Interface Nodes should be installed as automatic services. Services keep running after the user logs off. Automatic services automatically restart when the computer is restarted, which is useful in the event of a power failure. The

PI-WMI Interface connects to remote computers using its Windows user credentials. For this reason it is necessary to set the Windows service to run under an appropriate user account.

The guidelines are different if an interface is installed on the PI Server node. In this case, the typical procedure is to install the PI Server as an automatic service and interfaces as manual services that are launched by site-specific command files when the PI Server is started. Interfaces that are started as manual services are also stopped in conjunction with the PI Server by site-specific command files. Bufserv can be enabled on the PI Server node so that interfaces on the PI Server node do not need to be started and stopped in conjunction with PI, but it is not standard practice to enable buffering on the PI Server node. See the UniInt End User Document for special procedural information.

Naming Conventions and Requirements

In the installation procedure below, it is assumed that the name of the interface executable is PIOSIWMI.exe and that the startup command file is called PIOSIWMI.bat.

It is customary for the user to rename the executable and the startup command file when multiple copies of the interface are run. For example, one would typically use PIOSIWMI_1.exe and PIOSIWMI_1.bat for interface number 1, PIOSIWMI_2.exe and PIOSIWMI_2.bat for interface number 2, and so on. When an interface is run as a service, the executable and the command file must have the same root name because the service looks for its command-line arguments in a file that has the same root name.

Interface Directories

The PIHOME Directory Tree

The PIHOME directory tree is defined by the PIHOME entry in the pipc.ini configuration file. This pipc.ini file is an ASCII text file, which is located in the WinNT directory. A typical pipc.ini file contains the following lines:

[PIPC]

PIHOME=c:\pipc

The above lines define the \pipc directory as the root of the PIHOME directory tree on the C: drive. OSIsoft recommends using \pipc as the root directory name. The PIHOME directory does not need to be on the C: drive.

Interface Installation Directory

Place all copies of the interface into a single directory. The suggested directory is:

PIHOME\interfaces\OSIWMI\

Replace PIHOME with the corresponding entry in the pipc.ini file.

Interface Installation Procedure

The PI-WMI Interface setup program uses the services of the Microsoft Windows Installer. Windows Installer is a standard part of Windows 2000. When running on Windows NT 4.0 systems, the PI-WMI Interface setup program will install the Windows Installer itself, if necessary. To install, run the OSIWMI_x.x.x.x.exe installation kit.

Installing the Interface as an NT Service

The PI-WMI Interface service can be created, preferably, with the PI-Interface Configuration Utility, or can be created manually.

Installing the Interface Service with PI-Interface Configuration Utility

The PI-Interface Configuration Utility provides a user interface for creating, editing, and deleting the interface service:

[pic]

Service Configuration

Service Name

The Service to Add box shows the name of the current interface service. This service name is obtained from the interface executable.

Display Name

The Display Name text box shows the current Display Name of the interface service. If there is currently no service for the selected interface, the default Display Name is the service name with a “PI-” prefix. Users may specify a different Display Name. OSIsoft suggests that the prefix “PI-” be appended to the beginning of the interface to indicate that the service is part of the OSI suite of products.

Service Type

The Service Type indicates whether the interface service will start automatically or need to be started manually on reboot.

• If the Auto option is selected, the service will be installed to start automatically when the machine reboots.

• If the Manual option is selected, the interface service will not start on reboot, but will require someone to manually start the service.

• If the Disabled option is selected, the service will not start at all.

Generally, interface services are set to start automatically.

Dependencies

The Installed services list is a list of the services currently installed on this machine. Services upon which this Interface is dependant should be moved into the Dependencies list using the [pic] button. For example, if API Buffering is running, then “bufserv” should be selected from the list at the right and added to the list on the left. To remove a service from the list of dependencies, use the [pic] button, and the service name will be removed from the “Dependencies” list.

When the PI Interface is started as a service, the services listed in the dependency list will be verified as running or an attempt will be made to start them. If the dependent service(s) cannot be started for any reason, the PI interface service will not run.

Note: Please see the PI Log and Operating System Event Logger for messages that may indicate the cause for any server not running as expected.

[pic] - Add Button

To add a dependency from the list of Installed services, select the dependency name, and click the Add button.

[pic] - Remove Button

To remove a selected dependency, highlight the service name in the Dependencies list, and click the Remove button.

The full name of the service selected in the Installed services list is displayed below the Installed services list box.

Create

The Create button adds the displayed service with the specified Dependencies and with the specified Startup Type.

Remove

The Remove button removes the displayed service. If the service is not currently installed, or if the service is currently running, this button will be grayed out.

Start or Stop Service

To Start or Stop an interface service, use the Start button [pic] and a Stop button [pic] on the ICU toolbar. If this interface service is not currently installed, these buttons will remain grayed out until the service is added. If this interface service is running, the Stop button is available. If this service is not running, the Start button is available.

The status of the Interface service is indicated in the lower portion of the PI-ICU dialog.

[pic]

Installing the Interface Service Manually

One can get help for installing the interface as a service at any time with the command:

PIOSIWMI.exe –help

Change to the directory where the PIOSIWMI.exe executable is located. Then, consult the following table to determine the appropriate service installation command.

|NT Service Installation Commands on a PI Interface Node or a PI Server node |

|with Bufserv implemented |

|Manual service |PIOSIWMI.exe –install –depend “tcpip bufserv” |

|Automatic service |PIOSIWMI.exe –install –auto –depend “tcpip bufserv” |

|Automatic service with service |PIOSIWMI.exe –serviceid x –install–auto –depend “tcpip bufserv” |

|id | |

|NT Service Installation Commands on a PI Interface Node or a PI Server node |

|without Bufserv implemented |

|Manual service |PIOSIWMI.exe –install –depend tcpip |

|Automatic service |PIOSIWMI.exe –install –auto –depend tcpip |

|Automatic service with service |PIOSIWMI.exe –serviceid x –install –auto –depend tcpip |

|id | |

When the interface is installed as a service on the PI Server node and when Bufserv is not implemented, a dependency on the PI network manager is not necessary because the interface will repeatedly attempt to connect to the PI Server until it is successful.

Note: Interfaces are typically not installed as automatic services when the interface is installed on the PI Server node.

Check the Microsoft Windows NT services control panel to verify that the service was added successfully. One can use the services control panel at any time to change the interface from an automatic service to a manual service or vice versa.

WBEMTest.exe

WMI provides a test utility in the system32\WBEM directory called wbmetest.exe. This utility can be used to test queries that have failed in the interface. To run type wbemtest from the “Run” command in the Windows Start menu.

The WBEMTest Help file is a good source of useful WMI-related information.

Below are the specific steps to reproduce the Query methods the PI-WMI Interface uses to retrieve class instances.

[pic]

Select Connect… to connect to a remote machine with the same settings as the interface.

[pic]

Here we connect to WMI namespace CIMV2 on remote machine mic.

If connecting to the local machine, WMI will not permit user credentials to be passed. In this case, log onto the local machine with the same account under which the interface runs.

[pic]

Select the Connect button to complete the connection.

GetObject Query

To test a GetObject query select the Open Instance button shown on the screen above and enter the exact same query the interface is using. If placeholders are used in the query, then the query the interface uses can be obtained from the PIPC.log file. This is printed out when the point is loaded and when the point-level debug flag is set, for each query the interface makes.

[pic]

Click OK to return the object instance for this query.

[pic]

This is the object instance for this query

WQL Query

To test a WQL query select the Query… button on the Window Management Instrumentation Tester form and enter the exact same query the interface is using. Again the PIPC.log file is a good place to find the query.

[pic]

Select Apply to return the Classes.

[pic]

These are the Classes returned from the Query in the previous screenshot.

HP Query

To test a High Performance Refresh query select the Create Refresher… button on the Window Management Instrumentation Tester form.

[pic]

Select Add to add a new refresher object.

[pic]

Win32_PerfRawData_PerfProc_Process.Name=‘WINWORD’ is the object path. Select Add Object.

Note: Enum Refresher objects are not supported in this version of the

PI-WMI Interface.

[pic]

Refresh the object by clicking the Refresh button. Double-click on the object to see the result of the refresh.

Map File

There may be cases where the property value returned from the object needs to be modified before being sent to the PI server. The Map file provides a means to make a one-to-one substitution for the property value before the value is sent to PI. The map file is of the form:

[section]

Property Value1, Substituted Value1,comment (optional)

Property Value2, Substituted Value2,comment (optional)



For example, the Win32_PingStatus Class has a property StatusCode (see Appendix B). The appropriate Map File would have a section

[Win32_PingStatus_StatusCode]

0, Success

11001, Buffer Too Small

11002, Destination Net Unreachable

11003, Destination Host Unreachable

11004, Destination Protocol Unreachable

11005, Destination Port Unreachable

11006, No Resources

11007, Bad Option

11008, Hardware Error

11009, Packet Too Big

11010, Request Timed Out

11011, Bad Request

11012, Bad Route

11013, TimeToLive Expired Transit

11014, TimeToLive Expired Reassembly

11015, Parameter Problem

11016, Source Quench

11017, Option Too Big

11018, Bad Destination

11032, Negotiating IPSEC

11050, General Failure

Note: The efficient way to store the above values would be in a PI point of PointType Digital with a state set configured with the above states. In this case the substituted value could be either the state number or the state name (see the example in Appendix B), using the state number would provide a smaller load on the interface.

Each section header is denoted by the square bracket ‘[ ]’ characters, comment lines are started with the # character. In the above example an integer is mapped to a string, that is, the property value is an integer; this is converted to a string value before being sent to PI. Only string and integer types are supported in a map file. If the interface is unable to convert a property value via the map file, the interface will write the system digital state Failed to the point.

A special character, “?”, is available to denote “all other values.” Thus, to create a map where 0=Success and anything else=Fail, use:

[Status]

0, Success

?, Fail

The keyword is available to denote a substitution for Null or empty values. For example, the Win32_PingStatus_StatusCode section could contain:

11032, Negotiating IPSEC

11050, General Failure

, Host Not Found

Values in the map file must be either string or integer types. If each value in the substituted value column is able to be successfully interpreted as an integer, the interface will send these values to PI as numbers. If one value in the substituted values column is not a number, the interface will send each value as a string.

Digital States

For more information regarding Digital States, refer to the Data Archive Manuals.

PI 2 Home Node

Digital states are defined by running the Digtl Stat display from the PI menu. The states must be contiguous for each status type and may be anywhere within the Digital State Table outside of the range 193 – 320, which is reserved for OSIsoft. The digital states need to be defined prior to point configuration. The digital state sets described in the PI 3 sections below should be entered into the PI 2 Digital State Table.

For more information, see the DA manual.

PI 3 Home Node

Digital State Sets

PI digital states are discrete values represented by strings. These strings are organized in PI as digital state sets. Each digital state set is a user-defined list of strings, enumerated from 0 to n to represent different values of discrete data. For more information about PI digital tags and editing digital state sets, see the PI Server manuals.

Any class property that has a discrete number of possible values can be stored in PI as a digital tag. Each digital tag is associated with a user defined digital state set on the PI server.

When the interface loads a point with PointType Digital, the interface will attempt to convert the objects property value to a state in the tag’s state set. If the object property is a numeric type the value is interpreted as an offset into the point’s state set, the state number. If the property type is a string then an exact, case insensitive, match with the tags digital states will be attempted.

System Digital State Set

Similar to digital state sets is the system digital state set. This set is used for all tags, regardless of type to indicate the state of a tag at a particular time. For example, if the interface receives bad data from an interface point, it writes the system digital state bad input to PI instead of a value. The system digital state set has many unused states that can be used by the interface and other PI clients.

The interface requires the system digital states I/O Timeout and Failed to be present in the system state set, if these states are not present they may be added at any position in the set.

In addition the user may choose a system state for the interface to use when the property value read is a Null value.

PointSource

The PointSource is a single, unique character that is used to identify the PI point as a point that belongs to a particular interface. For example, one may choose the letter W to identify points that belong to the PI-WMI Interface. To implement this, one would set the PointSource attribute to W for every PI point that is configured for the PI-WMI Interface. Then, if one uses /ps=W on the startup-command line of the PI-WMI Interface, the interface will search the PI point database upon startup for every PI point that is configured with a PointSource of W. Before an interface loads a point, the interface performs further checks by examining additional PI point attributes to determine whether a particular point is valid for the interface. For additional information, see the /ps argument.

Case-sensitivity for PointSource Attributes

The PointSource character is not case sensitive. That is, /ps=W and /ps=w are equivalent.

PI 2 Server Nodes

The following point source characters are reserved on PI 2 systems and cannot be used as the point source character for an interface: C, ?, @, Q, T. Also, if one does not specify a point source character when creating a PI point, the point is assigned a default point source character of L. Therefore, it would be confusing to use L as the point source character for an interface.

Before a PI point with a given point source can be created, the point source character must be added to the PI 2 point source table. For example, if point source W is not defined in the PI 2 point source table, a point with a point source of W cannot be created. This prevents the user from accidentally creating a point with an incorrect point source character.

Defining a Point Source Character in the PI 2 Point Source Table

1. Enter PI by typing the following command from a VMS command prompt:

@pisysexe:pi

2. Select the PointSrc option from the menu.

3. Select New from the menu.

4. Assign a point source next to the Code: field. Also, assign minimum and maximum values for the Location1 to Location5 attributes.

| |Location1 |Location2 |Location3 |Location4 |Location5 |

|Minimum |0 |0 |0 |-20000000 |-20000000 |

|Maximum |20000000 |3 |20000000 |200 |20000000 |

5. Select “Save” from the menu.

PI 3 Server Nodes

No point source table exists on a PI 3 Server, which means that points can be immediately created on PI 3 with any point source character. Several subsystems and applications that ship with PI 3 are associated with default point source characters. The Totalizer Subsystem uses the point source character T, the Alarm Subsystem uses G and @, Random uses R, RampSoak uses 9, and the Performance Equations Subsystem uses C. You can either not use these point source characters or change the default point source characters for these applications. Also, if one does not specify a point source character when creating a PI point, the point is assigned a default point source character of L. Therefore, it would be confusing to use L as the point source character for an interface.

PI Point Configuration

The PI point is the basic building block for controlling data flow to and from the PI Server. A single point is configured for each measurement value that needs to be archived. Use the point attributes below to define what data to transfer.

Point Attributes

Tag

A Tag is a label or name for a point. Any tag name can be used in accordance to the normal PI point naming conventions.

PointSource

The PointSource is a single, unique character that is used to identify the PI point as a point that belongs to a particular interface. For additional information, see the /ps command-line argument and the “Point Source” section.

PointType

Object property types do not need to correspond to the PI PointType. For example, integer property types can be sent to floating point or digital PI tags. Similarly, a floating-point property value can be sent to integer or digital PI tags, although the values will be truncated. String property types to numeric type points are supported however care must be taken to ensure the interface can successfully make this conversion. Numeric property types will be converted to string data types if required.

PI 3 Server Nodes

Float16, float32, float 64, int16, int32, digital and string, PointTypes are supported on PI 3 Servers. For more information on the individual point types, see the PI Server manuals.

PI 2 Server Nodes

Scaled real, full-precision real, integer, and digital point types are supported on PI 2 Servers. For more information on the individual point types, refer to the Data Archive (DA) section of PI System Manual I.

Location1

Location1 indicates to which copy of the interface the point belongs. The value of this attribute must match the /id startup parameter.

Location2

Location2 determines the format of the data the interface writes to string points. The interface supports reading more than one property from a single point. Also more than one object may be returned from a WQL query. Location2 is used to configure how these values are combined. The following examples demonstrate the possible formats.

Output Type -- One Instance is Returned from the Query Object

|Loc2 |ExDesc |Output for String Tags |

|0 |Property=Caption |Notepad.exe |

|1 |Property=Caption |Caption=Notepad.exe |

|0 |Property=Caption; |Notepad.exe|5664 |

| |Property=ProcessId | |

|1 |Property=Caption; |Caption=Notepad.exe|ProcessId=5664 |

| |Property=ProcessId | |

Output Type -- Two Instances are Returned from WQL Query

with No Order-by Grouping

|Loc2 |Loc3 |ExDesc |Output for String Tags |Comment |

|0 |0 |Property=Caption |Notepad.exe |Two values written to PI |

| | | |explore.exe | |

|1 |0 |Property=Caption |Caption=Notepad.exe |Two values written to PI |

| | | |Caption=explore.exe | |

|0 |0 |Property=Caption; |Notepad.exe|5664 |Two values written to PI |

| | |Property=ProcessId |explore.exe|321 | |

|1 |0 |Property=Caption; |Caption=Notepad.exe| |Two values written to PI |

| | |Property=ProcessId |ProcessId=5664 | |

| | | |Caption=explore.exe| | |

| | | |ProcessId=321 | |

|2 |0 |Property=Caption; |Notepad.exe|5664; |One value written to PI |

| | |Property=ProcessId |explore|321 | |

|3 |0 |Property=Caption |Caption=Notepad.exe; |One value written to PI |

| | | |Caption=explore.exe | |

Numeric and Digital PointType points do not support multiple properties. Location2 is not used for these types of points.

Location3

Queries that return more than one object instance from a single query can be configured to distribute the returned instances across a number of PI points. Points with identical scan class, namespace, and query will be grouped so a single query will be made to WMI (a “point group”). Points within a point group that have Location3 greater than zero, have the property value of a single instance written to them (an “order-by group”). Internally the interface sorts all returned instances from the single query and distributes them to each point in this group, depending on their Location3 value. That is, the first sorted value is written to the point with Location3=1, the second with Location3=2 and so on. The interface does not enforce that each returned instance is written to a point. Thus it is valid to configure five points in an order-by group and have 100 instances returned from a query. In this case only the top five sorted instances will be written to PI. Likewise, if only three instances were returned from the query, only the first three points in the order-by group will have a value written to them. It is required that an order-by group has a single point with Location3=1. It is the Property, TS, and OrderBy keywords in this single point’s ExDesc that is used for the entire order-by group.

It is not permitted to have a Location2 value of other than zero and Location3 greater than 0 (an “order-by group”). In this case the interface will reject the point and the system state “Configure” will be written to the point.

Location4

Scan-based Inputs

Location4 defines the scan class for the PI point. The scan class determines the frequency at which input points are scanned for new values. For more information, see the description of the /f flag in the section called “Startup Command File”.

Location5

Location5 is not used in this interface. Location5 is reserved for future versions of the interface.

InstrumentTag

For a PI 3 Server, the InstrumentTag is limited to 32 characters if the interface does not have the PI-SDK enabled and to 1024 characters if the PI-SDK is enabled. For a PI 2 Server, the InstrumentTag attribute is limited to 32 characters.

The InstrumentTag defines the computer and namespace where the managed object is located. The Hostname can be either the name of the computer or its IP address. Acceptable formats for the CIMv2 namespace on a computer called Numbat are:

Host=Numbat; NameSpace=root\CIMV2

or

\\Numbat\root\CIMV2

or

\\192.168.50.60\root\CIMV2

The Host and Namespace keywords can alternatively be included in the point’s ExDesc.

Note: When connecting to the machine the interface is running on, it is usual in WMI to use the period “.” character in place of the machine name. That is, to connect to root\CIMV2 on the local machine use \\.\root\CIMV2

ExDesc

This is the extended descriptor attribute. For a PI 3 Server, the extended descriptor is limited to 80 if the interface does not have the PI-SDK enabled and to 1024 characters if the PI-SDK is enabled. For a PI 2 Server, the extended descriptor is limited to 80 characters.

The extended descriptor is used to pass point-specific parameters to the interface using the Keyword=Parameter syntax. Keyword / parameters are separated by a comma “;” character. A valid point requires one of the query methods (GetObject=, WQL=, or HP=) and at least one Property parameter. Valid keywords are given in the table below.

|Keyword |WMI Query Method |Comment |

|GetObject= |GetObject |Class name and instance of the object |

|WQL= |ExecQuery |WQL query to retrieve one or more object instances |

|HP= |High Performance Refresh |Class name and instance of an object that has a high|

| | |performance provider |

|Property= |All |The property of the object whose value we write to |

| | |PI. The Property keyword is the only keyword that |

| | |can be used multiple times in one point. |

|TS= |GetObject, ExecQuery |A property of the object that is of type DateTime, |

|(Optional) | |This property value will be used as the timestamp of|

| | |the value written to PI |

|OrderBy= |ExecQuery (Location3=1) |Order by (Ascending). Property used to sort objects |

|(Optional) | |in an order-by group. Property type must be a number|

| | |or a string, other types are not supported. Strings |

| | |will be converted to uppercase ASCII then sorted by |

| | |ASCII value. Note: the order-by master point is the |

| | |point in an order-by group with its Location3=1, The|

| | |Property, TS and OrderBy keyword are read from this |

| | |point. If no OrderBy keyword is found, the order-by |

| | |group is ordered by the value to be written to PI |

|OrderByDec= |ExecQuery |Order by (Descending). Property used to sort objects|

|(Optional) |(Location3=1) |in an order-by group. (See above) |

|tmOut= |GetObject, ExecQuery |The query timeout (overrides the interface default) |

|(Optional) | | |

|recTime= |GetObject, ExecQuery |Reconnection Time (overrides the interface default) |

|(Optional) | | |

|db |All |Point Group debugging. The interface will write the |

|(Optional) | |result of each query to the PIPC.log file. Care |

| | |should be taken as this file can become large. |

tmOut and RecTime apply to the point group th

Note: tmOut and RecTime apply to the point group for this point. In the case where several points in a point group have different values for these keywords, the interface will use the highest value from any point in the point group. Likewise, db applies to a point group, not the point itself. If at least one point in a point group has the db keyword, then point group debugging is set.

Query Examples

GetObject Example

GetObject=Win32_LogicalDisk.DeviceID="C";Property=FreeSpace

ExecQuery Example

WQL=Select * from Win32_LogicalDisk where FreeSpace < 1000000; Property=Caption; Property=FreeSpace

High Performance Refresh Example

HP= Win32_PerfRawData_PerfProc_Process.Name="OUTLOOK"; Property=Workingset

Placeholders

Placeholders can be used in a query to dynamically assign a value at run time. Placeholders are denoted using the # character. Supported placeholders are:

|Placeholder |Used with |Comment |

|#SST:Tag# |GetObject=, WQL= |The current snapshot time of the PI point (Tag). If Tag is not |

| | |specified, the point’s own snapshot time. The snapshot time is |

| | |converted to a WMI DateTime string. |

|#SSV:Tag# |GetObject=, WQL= |The current snapshot value of the PI point (Tag). If Tag is not|

| | |specified, the point’s own snapshot value. |

|#LET# |GetObject=, WQL= |Last Execution Time. The interface machine time the query was |

| | |last called. On interface startup, this is time the interface |

| | |was started. |

When a “TWWhen a “Tag” is specified, the interface reads the current snapshot time/value from PI each time the query is scheduled. If no “Tag” is specified, the interface only reads the snapshot time/value at startup and keeps a local copy of the snapshot time/value, updated whenever a new good value is written to PI. (A failed query will not update this time/value.) Queries with Placeholders can still form a point group. In the case where the placeholder type has no “Tag” specified, the local copy of the snapshot time/value is the last value sent to any point in this point group.

For example:

WQL=Select * from Win32_Process where CreationDate> '#SST# '; TS= CreationDate; Property=Caption

Note: The CreationDate Property is of type DateTime. In WMI this is a string representation of time and thus is enclosed in single quotes ('). Please refer to the Microsoft documentation on the WMI DateTime format.

Performance Points

For UniInt-based interfaces, the extended descriptor is checked for the string “PERFORMANCE_POINT”. If this character string is found, UniInt treats this point as a performance point. See the section called “Performance Points.”

Note: Configuring Performance Points for this interface is not recommended.

Trigger-based Inputs

For trigger-based input points, a separate trigger point must be configured. An input point is associated with a trigger point by entering a case-insensitive string in the extended descriptor (ExDesc) PI point attribute of the input point of the form:

keyword=trigger_tag_name

where keyword is replaced by “event” or “trig” and trigger_tag_name is replaced by the name of the trigger point. There should be no spaces in the string. UniInt automatically assumes that an input point is trigger-based instead of scan-based when the keyword=trigger_tag_name string is found in the extended descriptor attribute.

An input is triggered when a new value is sent to the Snapshot of the trigger point. The new value does not need to be different than the previous Snapshot value to trigger an input, but the timestamp of the new value must be greater than (more recent than) or equal to the timestamp of the previous value.

Scan

By default, the Scan attribute has a value of 1, which means that scanning is turned on for the point. Setting the scan attribute to 0 turns scanning off. If the scan attribute is 0 when the interface starts, SCAN OFF will be written to the PI point. If the scan attribute is changed from 1 to 0 while the interface is running, SCAN OFF will also be written to the PI point after the point edit is detected by the interface.

There is one other situation, which is independent of the Scan attribute, where UniInt will write SCAN OFF to a PI point. If a point that is currently loaded by the interface is edited so that the point is no longer valid for the interface, the point will be removed from the interface, and SCAN OFF will be written to the point. For example, if the PointSource of a PI point that is currently loaded by the interface is changed, the point will be removed from the interface and SCAN OFF will be written to the point.

Shutdown

PI 3 Server Nodes

The shutdown attribute is used only if the server node is a PI 3 system.

The Shutdown attribute is 1 (true) by default. The default behavior of the PI Shutdown subsystem is to write the SHUTDOWN digital state to all PI points when PI is started. The timestamp that is used for the SHUTDOWN events is retrieved from a file that is updated by the Snapshot Subsystem. The timestamp is usually updated every 15 minutes, which means that the timestamp for the SHUTDOWN events will be accurate to within 15 minutes in the event of a power failure. For additional information on shutdown events, refer to PI Server manuals.

Note: The SHUTDOWN events that are written by the PI Shutdown subsystem are independent of the SHUTDOWN events that are written by the interface when the /stopstat=Shutdown command-line argument is specified.

One can disable SHUTDOWN events from being written to PI when PI is restarted by setting the Shutdown attribute to 0 for each point. Alternatively, one can change the default behavior of the PI Shutdown Subsystem to write SHUTDOWN events only for PI points that have their Shutdown attribute set to 0. To change the default behavior, edit the \PI\dat\Shutdown.dat file, as discussed in PI Server manuals.

Bufserv

It is undesirable to write shutdown events when Bufserv is being used. Bufserv is a utility program that provides the capability to store and forward events to a PI Server, allowing continuous data collection when the Server is down for maintenance, upgrades, backups, and unexpected failures. That is, when PI is shut down, Bufserv will continue to collect data for the interface, making it undesirable to write SHUTDOWN events to the PI points for this interface.

PI 2 Server Nodes

The Shutdown attribute is not used if the server node is a PI 2 system. For information on configuring shutdown events for PI 2, see Data Archive (DA) section 4.2.3 of PI System Manual I.

Performance Point Configuration

A Performance Point is a UniInt feature that measures the time the interface takes to complete a scan. In this interface, the time to complete the scan is just the time the interface takes to submit the list of point groups to the thread pool and has little bearing on load of the interface. Performance Points should not be created for this interface.

I/O Rate Tag Configuration

An I/O Rate point can be configured to receive 10-minute averages of the total number of exceptions per minute that are sent to PI by the interface. An exception is a value that has passed the exception specifications for a given PI point. Since 10-minute averages are taken, the first average is not written to PI until 10 minutes after the interface has started. One I/O Rate tag can be configured for each copy of the interface that is in use.

Monitoring I/O Rates on the Interface Node

For NT and UNIX nodes, the 10-minute rate averages (in events/minute) can be monitored with a client application such as ProcessBook.

Configuring I/O Rate Tags with PI-ICU (NT-Intel)

The PI-Interface Configuration Utility (PI-ICU) provides a user interface for creating and managing IORates Tags.

[pic]

PI-ICU currently allows for one I/O Rate tag to be configured for each copy of the interface that is in use. Some interfaces allow for multiple I/O Rates tags.

Enable IORates for this Interface

The Enable IORates for this interface check box enables or disables IORates for the current interface. To disable IORates for the selected interface, uncheck this box. To enable IORates for the selected interface, check this box.

Tag Status

The Tag Status column indicates whether the IORates tag exists in PI. The possible states are:

• Created – This status indicates that the tag exist in PI

• Not Created – This status indicates that the tag does not yet exist in PI

• Deleted – This status indicates that the tag has just been deleted

• Unknown – This status indicates that the ICU is not able to access the PI Server

In File

The In File column indicates whether the IORates tag listed in the tag name and the event counter is in the IORates.dat file. The possible states are:

• Yes – This status indicates that the tag name and event counter are in the IORates.dat file

• No – This status indicates that the tag name and event counter are not in the IORates.dat file

Event Counter

The Event Counter correlates a tag specified in the iorates.dat file with this copy of the interface. The command line equivalent is /ec=x, where x is the same number that is assigned to a tag name in the iorates.dat file.

Tagname

The tag name listed under the Tagname column is the name of the IORates tag.

Snapshot

The Snapshot column holds the snapshot value of the IORates tag, if the IORates tag exists in PI. The Snapshot column is updated when the IORates/Status Tags tab is clicked, and when the interface is first loaded.

Right Mouse Button Menu Options

Create

Create the suggested IORates tag with the tag name indicated in the Tagname column.

Delete

Delete the IORates tag listed in the Tagname column.

Rename

Allows the user to specify a new name for the IORates tag listed in the Tagname column.

Add to File

Adds the tag to the IORates.dat file with the event counter listed in the Event Counter Column.

Search

Allows the user to search the PI Server for a previously defined IORates tag.

Configuring I/O Rate Tags Manually

There are two configuration steps.

1. Configuring the PI Point on the PI Server

2. Configuration on the Interface Node

Configuring the PI Point on the PI Server

PI 2 Server Nodes

A listing of the I/O Rate Tags that are currently being monitored can be obtained with the command:

@PISysDat:

PI 3 Server Nodes

Create an I/O Rate Tag with the following point attribute values.

|Attribute |Value |

|PointSource |L |

|PointType |float32 |

|Compressing |0 |

|ExcDev |0 |

Configuration on the Interface Node

For the following examples, assume that an appropriate PI point, WMI_IORate, is configured on the server.

1. Edit/Create a file called iorates.dat in the PIHOME\dat directory. The PIHOME directory is defined either by the PIPCSHARE entry or the PIHOME entry in the pipc.ini file, which is located in the \WinNT directory. If both are specified, the PIPCSHARE entry takes precedence.

Since the PIHOME directory is typically C:\PIPC, the full name of the iorates.dat file will typically be C:\PIPC\dat\iorates.dat.

Add a line in the iorates.dat file of the form:

WMI_IORate, x

where WMI_IORate is the name of the I/O Rate Tag and x corresponds to the first instance of the /ec=x flag in the startup command file. X can be any number between 2 and 34 or between 51 and 200, inclusive. To specify additional rate counters for additional copies of the interface, create additional I/O Rate tags and additional entries in the iorates.dat file. The event counter, /ec=x, should be unique for each copy of the interface.

2. Set the /ec=x flag on the startup command file of the interface to match the event counter in the iorates.dat file.

The interface must be stopped and restarted in order for the I/O Rate tag to take effect. I/O Rates will not be written to the tag until 10 minutes after the interface is started.

Startup Command File

For NT, command file names have a .bat extension. The NT continuation character (^) allows one to use multiple lines for the startup command. The maximum length of each line is 1024 characters (1 kilobyte). The number of flags is unlimited, and the maximum length of each flag is 1024 characters.

Configuring the Interface with PI-ICU

Note: PI-ICU requires PI 3.3 or greater.

The PI-Interface Configuration Utility provides a graphical user interface for configuring PI interfaces. If the interface is configured by the PI-ICU, the batch file of the interface (PIOSIWMI.bat) will be maintained by the PI-ICU and all configuration changes will be kept in that file. The procedure below describes the necessary steps for using PI-ICU to configure the PI-WMI Interface.

From the PI-ICU menu, select Interface, New, and then Browse to the appropriate executable. The executable file will be PIOSIWMI.exe. Then, enter values for Point Source and Interface ID# and optionally the Interface name as displayed in the ICU. A window such as the following results:

[pic]

“Interface name as displayed in the ICU (optional)” will have PI- pre-pended to this name and it will be the display name in the services menu.

Click on Add.

You should then see a display such as the following:

[pic]

Note that in this example the Host PI System is localhost, which means that the interface will be configured to communicate with the local PI Server. However, if you want the interface to communicate with a remote PI Server, you can do this by selecting ‘Connections…’ item from PI-ICU menu and make it your default server. If you do not see the remote node in the list of servers, you can add that in.

Once you add the interface to PI-ICU, near the top of the main PI-ICU screen, the Interface Type should be osiwmi. If not, use the drop-down box to change the Interface Type to be osiwmi.

Click on Apply to enable the PI-ICU to manage this copy of the PI-WMI Interface.

[pic]

The next step is to make selections in the interface-specific tab (i.e. “osiwmi”) that allows you to enter values for the startup parameters that are particular to the

PI-WMI Interface.

The PI-WMI ICU control has 2 tabs. A yellow text box indicates that an invalid value has been entered, or that a required value has not been entered.

The next screenshot shows the Conversion and Debug tab.

[pic]

Since the PI-WMI Interface is a UniInt-based interface, in some cases the user will need to make appropriate selections in the UniInt tab. This tab allows the user to access UniInt features through the PI-ICU and to make changes to the behavior of the interface.

If you want to set up the interface as a Windows Service, you can do that by using the Service tab. This tab allows you to configure the interface to run as a service as well as to start and stop the interface. You can also run the interface interactively from the PI-ICU. To do that go to menu, select the Interface item and then Start Interactive.

For more detailed information on how to use the above-mentioned and other PI-ICU tabs and selections, please refer to the PI-Interface Configuration Utility User Manual. In the next section we will describe the selections that are available from the osiwmi tab. After you have made your selections on the PI-ICU GUI, you will need to press the Apply button in order for PI-ICU to make these changes to the interface’s startup file.

osiwmi Interface Tab

Since the startup file of the PI-WMI Interface is maintained automatically by PI-ICU, you should use the osiwmi tab to configure the startup parameters and not make changes in the file manually. The following is the description of interface configuration parameters used in the PI-ICU Control and corresponding manual parameters.

Conversion and Debug Tab

[pic]

1. Map filename

The FileName of the MAP file; used to map object parameter values to send to PI. The command-line equivalent is /mapfilename=filename and is an optional parameter.

2. Conversion method

This specifies the conversion method for a DateTime property to a PI point value. See the section /dt in the Command-line Parameters section for more details. The command-line equivalent is /dt=n and is an optional parameter with a default value of 0.

3. Null value digital system state

This is the system digital state to write to PI when a property value is Null. The command-line equivalent is /NDS=state and is an optional parameter.

4. Debug

These individual debug levels can be combined by checking the individual boxes. The combined value will be displayed in the Debug level: text box. Informational messages from the different sections of the interface can be combined by adding the debug level values. See the section /db in the Command-line Parameters section for more information. The command-line equivalent is /db=n and is an optional parameter with a default value of 0.

5. Additional Parameters

In the space provided the user can enter any additional parameters that are not available through PI-ICU.

Tuning Tab

[pic]

1. Thread count

This specifies the number of available threads in the thread pool. The command-line equivalent is /tc=nn and is an optional parameter with a default value of 10.

2. Reconnect time

This specifies the time in seconds to wait before retrying a failed connection. The command-line equivalent is /recTime=nn and is an optional parameter with a default value of 120.

3. Query timeout

This specifies the time in milliseconds the WMI server is given to respond to the query. The command-line equivalent is /tmOut=nn and is an optional parameter with a default value of 10000.

4. Synchronous query method

This allows the use of synchronous query methods. It is only available for GetObject and ExecQuery. The command-line equivalent is /sync and is an optional parameter.

5. Authentication

This sets the authentication on each connection. All four switches must all be set to a valid value. Refer to the section Security for the valid values to use in these parameters.

6. Security token

This modifies the interfaces security token to have the passed privilege. Refer to the section Security for more details. The command-line equivalent is /sst=Privilege and is an optional parameter.

7. Additional Parameters

In the space provided the user can enter any additional parameters that are not available through PI-ICU.

Command-line Parameters

Command-line arguments can begin with a / or with a -. For example, the /ps=W and

–ps=W command-line arguments are equivalent.

|Parameter |Description |

|/AunSvc=nn |Authentication. Sets the authentication on each connection. All four switches must all be|

|/AuzSvc=nn |set to valid value. See the section Security for the valid values to use in these |

|/AunLvl=nn |parameters. |

|/AuImpLvl=nn | |

|Optional | |

|/db=nn |Debug messages are useful if the interface appears to be behaving in an unexpected |

|Optional |manner. The following values set the interface to write debug messages at different |

| |stages of the interface operation, values can be summed together to set multiple debug |

| |levels. |

| |1. Point Loading/Grouping. |

| |2. Communicating with WMI (Connection information) |

| |4. Query / Property Value information |

| |Point-level debugging is also available (see ExDesc) |

|/dt=nn |Conversion method for a DateTime property to a PI point value. |

|Default=0 |0. No conversion, write DateTime in WMI string format |

| |1. Convert to seconds from 1-Jan-70 UTC time |

| |2. Convert to PI Time String (UTC) e.g. 7-Jan-05 12:20:00 (UTC) |

| |3. Convert to PI Time String (interface time zone) |

|/ec=x |The first instance of the /ec flag on the command line is used to specify a counter |

|Optional |number, x, for an I/O Rate point. If x is not specified, then the default event counter |

| |is 1. Also, if the /ec flag is not specified at all, there is still a default event |

| |counter of 1 associated with the interface. If there is an I/O Rate point that is |

| |associated with an event counter of 1, each copy of the interface that is running without|

| |/ec=x explicitly defined will write to the same I/O Rate point. This means that one |

| |should either explicitly define an event counter other than 1 for each copy of the |

| |interface or one should not associate any I/O Rate points with event counter 1. |

| |Configuration of I/O Rate points is discussed in the section called “I/O Rate Tag |

| |Configuration.” |

|/f=SS |The /f flag defines the time period between scans in terms of hours (HH), minutes (MM), |

|or |and seconds (SS). The scans can be scheduled to occur at discrete moments in time with an|

|/f=SS,SS |optional time offset specified in terms of hours (hh), minutes (mm), and seconds (ss). If|

|or |HH and MM are omitted, then the time period that is specified is assumed to be in |

|/f=HH:MM:SS |seconds. |

|or |Each instance of the /f flag on the command line defines a scan class for the interface. |

|/f=HH:MM:SS, |There is no limit to the number of scan classes that can be defined. The first occurrence|

|hh:mm:ss |of the /f flag on the command line defines the first scan class of the interface; the |

| |second occurrence defines the second scan class, and so on. PI points are associated with|

|Required |a particular scan class via the Location4 PI point attribute. For example, all PI points |

| |that have Location4 set to 1 will receive input values at the frequency defined by the |

| |first scan class. Similarly, all points that have Location4 set to 2 will receive input |

| |values at the frequency specified by the second scan class, and so on. |

| |Two scan classes are defined in the following example: |

| |/f=00:01:00,00:00:05 /f=00:00:07 |

| |or, equivalently: |

| |/f=60,5 /f=7 |

| |The first scan class has a scanning frequency of 1 minute with an offset of 5 seconds, |

| |and the second scan class has a scanning frequency of 7 seconds. When an offset is |

| |specified, the scans occur at discrete moments in time according to the formula: |

| |scan times = (reference time) + n(frequency) + offset |

| |where n is an integer and the reference time is midnight on the day that the interface |

| |was started. In the above example, frequency is 60 seconds and offset is 5 seconds for |

| |the first scan class. This means that if the interface was started at 05:06:06, the first|

| |scan would be at 05:06:10, the second scan would be at 05:07:10, and so on. Since no |

| |offset is specified for the second scan class, the absolute scan times are undefined. |

| |The definition of a scan class does not guarantee that the associated points will be |

| |scanned at the given frequency. If the interface is under a large load, then some scans |

| |may occur late or be skipped entirely. See the section called “Performance Point |

| |Configuration” for more information on skipped or missed scans. |

| |Sub-second Scan Classes |

| |One can also specify sub-second scan classes on the command line such as |

| |/f=0.5 /f=00:00:00.1 |

| |where the scanning frequency associated with the first scan class is 0.5 seconds and the |

| |scanning frequency associated with the second scan class is 0.1 of a second. |

| |Similarly, sub-second scan classes with sub-second offsets can be defined, such as |

| |/f=0.5,0.2 /f=1,0 |

| |Wall Clock Scheduling |

| |Scan classes that strictly adhere to wall clock scheduling are now possible. This feature|

| |is available for interfaces that run on NT and/or UNIX. Previously, wall clock scheduling|

| |was possible, but not across daylight savings time. For example, /f=24:00:00,08:00:00 |

| |corresponds to 1 scan a day starting at 8 AM. However, after a Daylight Savings Time |

| |change, the scan would occur either at 7 AM or 9 AM, depending upon the direction of the |

| |time shift. To schedule a scan once a day at 8 AM (even across daylight savings time), |

| |one should use /f=24:00:00,00:08:00,L. The ,L at the end of the scan class tells UniInt |

| |to use the new wall clock scheduling algorithm. |

|/host=host:port |The /host flag is used to specify the PI Home node. Host is the IP address of the PI |

|Required |Sever node or the domain name of the PI Server node. Port is the port number for TCP/IP |

| |communication. The port is always 5450 for a PI 3 Server and 545 for a PI 2 Server. It is|

| |recommended to explicitly define the host and port on the command line with the /host |

| |flag. Nevertheless, if either the host or port is not specified, the interface will |

| |attempt to use defaults. |

| |Defaults: |

| |The default port name and server name is specified in the pilogin.ini or piclient.ini |

| |file. The piclient.ini file is ignored if a pilogin.ini file is found. Refer to the |

| |PI-API manual for more information on the piclient.ini and pilogin.ini files. |

| |Examples: |

| |The interface is running on a PI Interface Node, the domain name of the PI 3 home node is|

| |Marvin, and the IP address of Marvin is 206.79.198.30. Valid /host flags would be: |

| |/host=marvin |

| |/host=marvin:5450 |

| |/host=206.79.198.30 |

| |/host=206.79.198.30:5450 |

|/id=x |This interface uses the /id flag to identify a particular interface copy number that |

|Required |corresponds to an integer value that is assigned to the points Location1. For this |

| |interface, one should use only numeric characters in the identifier. For example, |

| |/id=1 |

|/MapFile= |The FileName of MAP file; used to map object parameter values to values to send to PI see|

|filename |Map File |

|Optional |Default file name is .\WMI_ValueMap.txt |

|/NDS=state |Null Digital State. This is the system digital state to write to PI when a property value|

|Optional |is Null |

|/PISDK=x |The /pisdk flag can be used to enable or disable the PI-SDK. Use /pisdk=1 to enable the |

|Optional |PI-SDK. Use /pisdk=0 to disable the PI-SDK. If a particular interface requires the |

| |PI-SDK, then the PI-SDK will always be enabled and the /pisdk flag will be ignored. |

|/ps=x |The /ps flag specifies the point source for the interface. X is not case sensitive and |

|Required |can be any single character. For example, /ps=P and /ps=p are equivalent. |

| |The point source that is assigned with the /ps flag corresponds to the PointSource |

| |attribute of individual PI points. The interface will attempt to load only those PI |

| |points with the appropriate point source. |

|/q |When the /q flag is present, Snapshots and exceptions are queued When the /q flag is |

|Optional |present, Snapshots and exceptions are queued before they are sent to the PI Server node. |

| |The maximum queue size is close to 4000 bytes. However the queue is flushed between scans|

| |if it is not filled. |

|/recTime=# |Time (Seconds) to wait before retrying a failed connection. The interface will always try|

|Optional |to connect each point both when the point is loaded by the interface, or immediately |

|Default=120 |after a points connection has been closed. If this connection fails the interface will |

| |wait recTime time for each subsequent connection attempt. |

|/sTk=Privilege |/sTk Sets a privilege on the interfaces security token to have the passed privilege. See |

|Optional |Security. |

|/stopstat |If the /stopstat flag is present on the startup command line, then the digital state Intf|

|or |shut will be written to each PI point when the interface is stopped. |

|/stopatat= |If /stopstat=digstate is present on the command line, then the digital state, digstate, |

|digstate |will be written to each PI point when the interface is stopped. For a PI 3 Server, |

|Default: |digstate must be in the system digital state table. For a PI 2 Server, where there is |

|/stopstat= |only one digital state table available, digstate must simply be somewhere in the table. |

|”Intf shut” |UniInt uses the first occurrence in the table. |

|Optional |If neither /stopstat nor /stopstat=digstate is specified on the command line, then no |

| |digital states will be written when the interface is shut down. |

| |Examples: |

| |/stopstat=”Intf shut” |

| |The entire parameter is enclosed within double quotes when there is a space in digstate. |

|/sync |Use synchronous query methods. Only available for GetObject and ExecQuery methods. |

|Optional | |

|/TC=# |The number of available threads in the thread pool. Default 10 |

|Default=10 | |

|Optional | |

|/tmOut=nn |Query TimeOut (milliseconds) This is the time the WMI server is given to respond to the |

|Default=10000 |query. Use this if you see “Timed Out” in the PIPC.log file for failed queries. Can be |

| |overridden with tmOut=nn in the PI point’s ExDesc |

Note: The UniInt End User Document includes details about other command line parameters, which may be useful.

Sample OSIWMI.bat File

The following is an example file:

rem===============================================================

rem Sample startup command file for the PI-WMI Interface to the PI System

rem===============================================================

rem

rem Required Parameters

rem /f=#:#:#,#:#:# Scan class frequency and offset

rem /host=:port# PI server host name and port #

rem /id=n Interface identification number

rem /ps=x Point source character

rem

rem Recommended Parameters

rem /ec=n Event counter for I/O rate tag

rem

rem Optional Parameters (Authentication)

rem If used, CoSetProxyBlanket is called with the following four arguments

rem /AuImpLvl=nn dwImpLevel

rem /AunLvl=nn dwAuthnLevel

rem /AunSvc=nn dwAuthnSvc

rem /AuzSvc=nn dwAuthzSvc

rem Optional Parameters (others)

rem /db=nn Enable debug messages

rem 1 (Point Load)

rem 2 (Communication)

rem 4 (Query)

rem /dt=nn DateTime conversion

rem 0 (no conversion)

rem 1 (UTC seconds)

rem 2 (UTC date)

rem 3(Local date)

rem /MapFile="fileName" Map-File filename and path

rem /NDS="system State" System state for Null values

rem /recTime=nn Time to wait between connection attempts, seconds

rem /sTk="token" Set token on interface process

rem /sync Use synchronous query methods

rem /TC Thread pool count

rem /tmOut=nn Query timeout (milliseconds)

rem

rem Sample startup command line

.\PIOSIWMI.exe /ps=W /id=1 /host=pimachine:5450 /stopstat="Intf Shut" /f=60 /f=600

Windows Security

The interface default Windows Security settings will, in most cases, be sufficient to allow access to the WMI servers and classes on a Windows domain. The option is provided, however, to alter the security context of the interface. This is achieved by calling CoSetProxyBlanket on the connection to each WMI service. It is beyond the scope of this manual to provide a detailed discussion of Windows security, however of interest are these settings:

Authentication

This is the means by which the interface proves its identity over DCOM to the other process, ultimately the WMI provider. The type of authentication is specified by the RPC_C_AUTHN_LEVEL_xxx values. For example, LEVEL_CONNECT, allows the

PI-WMI Interface to prove its identity only on connection. With LEVEL_CALL the identity of the Interface is proved on each call to WMI.

Impersonation

This specifies the limitation on the client of how it behaves with the interface’s security context. RPC_C_IMP_LEVEL_IMPERSONATE allows the WMI and the providers to perform tasks on the Interface’s behalf on the machine where the WMI service is running. RPC_C_IMP_LEVEL_DELEGATE allows WMI to further pass the interface’s security token on to another machine.

To explicitly set the interface’s security context, each of the attributes, dwAuthnSvc, dwAuthzSvc, dwAuthnLevel, and dwImpLevel, must be set. Use the command-line parameters AunSvc, AuzSvc, AunLvl and AuImpLvl as described below.

|dwAuthnSvc (AunSvc=) |Number |

|RPC_C_AUTHN_NONE |0 |

|RPC_C_AUTHN_DCE_PRIVATE |1 |

|RPC_C_AUTHN_DCE_PUBLIC |2 |

|RPC_C_AUTHN_DEC_PUBLIC |4 |

|RPC_C_AUTHN_GSS_NEGOTIATE |9 |

|RPC_C_AUTHN_WINNT |10 |

|RPC_C_AUTHN_GSS_SCHANNEL |14 |

|RPC_C_AUTHN_GSS_KERBEROS |16 |

|RPC_C_AUTHN_MSN |17 |

|RPC_C_AUTHN_DPA |18 |

|RPC_C_AUTHN_MQ |100 |

|RPC_C_AUTHN_DEFAULT |0xFFFFFFFF |

|dwAuthzSvc (AuzSvc=) |Number |

|RPC_C_AUTHZ_NONE |0 |

|RPC_C_AUTHZ_NAME |1 |

|RPC_C_AUTHZ_DCE |2 |

|RPC_C_AUTHZ_DEFAULT |0xFFFFFFFF |

|dwAuthnLevel (AunLvl=) | |

|RPC_C_AUTHN_LEVEL_DEFAULT |0 |

|RPC_C_AUTHN_LEVEL_NONE |1 |

|RPC_C_AUTHN_LEVEL_CONNECT |2 |

|RPC_C_AUTHN_LEVEL_CALL |3 |

|RPC_C_AUTHN_LEVEL_PKT |4 |

|RPC_C_AUTHN_LEVEL_PKT_INTEGRITY |5 |

|RPC_C_AUTHN_LEVEL_PKT_PRIVACY |6 |

|dwImpLevel (AuImpLvl=) |Number |

|RPC_C_IMP_LEVEL_DEFAULT |0 |

|RPC_C_IMP_LEVEL_ANONYMOUS |1 |

|RPC_C_IMP_LEVEL_IDENTIFY |2 |

|RPC_C_IMP_LEVEL_IMPERSONATE |3 |

|RPC_C_IMP_LEVEL_DELEGATE |4 |

Modifying the Security Token

Some classes require special security privileges to access instance data. For example, the Win32_NTEventLog Class requires that the SeSecurityPrivilege be set to access events in the Event Log, security log. The interface security token can be adjusted to have this privilege set by the command-line parameter /sTk=SeSecurityPrivilege. The required privilege can be determined by checking for the EnumPrivileges Qualifier in each class. The Interface only supports one security token modifier. Typically, only token, SeSecurityPrivilege will be required. However the full list of supported privileges can be found in the winnt.h on the Interface computer.

Interface Node Clock

The correct settings for the time and time zone should be set in the Date/Time control panel. If local time participates in Daylight Savings, from the control panel, configure the time to be automatically adjusted for Daylight Savings Time. The correct local settings should be used even if the interface node runs in a different time zone than the PI Server node.

Make sure that the TZ environment variable is not defined. The currently defined environment variables can be listed by going to Start | Settings | Control Panel, double clicking on the system icon, and selecting the environment tab on the resulting dialog box. Also, make sure that the TZ variable is not defined in an autoexec.bat file. When the TZ variable is defined in an autoexec.bat file, the TZ variable may not appear as being defined in the System control panel even though the variable is defined. Admittedly, autoexec.bat files are not typically used on NT, but this does not prevent a rogue user from creating such a file and defining the TZ variable unbeknownst to the System Administrator.

PI Security

If the home node is a PI 3 Server, the PI Firewall Database and the PI Proxy Database must be configured so that the interface is allowed to write data to the PI Data Archive. See “Modifying the Firewall Database” and “Modifying the Proxy Database” in the PI Server manuals.

Note that the Trust Database, which is maintained by the Base Subsystem, replaces the Proxy Database used prior to PI version 3.3. The Trust Database maintains all the functionality of the proxy mechanism while being more secure.

See “Trust Login Security” in the chapter “PI System Management” of the PI Universal Data Server System Management Guide.

If the interface cannot write data to a PI 3 Server because it has insufficient privileges, a –10401 error will be reported in the pipc.log file. If the interface cannot send data to a PI2 Server, it writes a –999 error. See the section “Appendix A: Error and Informational Messages”.

Starting / Stopping the Interface

This section describes starting and stopping the interface once it has been installed as a service. See the UniInt End User Document to run the interface interactively.

[pic]

Starting Interface as a Service

If the interface was installed a service, it can be started from PI-ICU, the services control panel or with the command:

PIOSIWMI.exe –start

To start the interface service with PI-ICU, use the [pic] button on the PI-ICU toolbar.

A message will be echoed to the screen informing the user whether or not the interface has been successfully started as a service. Even if the message indicates that the service started successfully, make sure that the service is still running by checking in the services control panel. There are several reasons that a service may immediately terminate after startup. One is that the service may not be able to find the command-line arguments in the associated .bat file. For this to succeed, the root name of the .bat file and the .exe file must be the same, and the .bat file and the .exe file must be in the same directory. If the service terminates prematurely for whatever reason, no error messages will be echoed to the screen. The user must consult the pipc.log file for error messages. See the section “Appendix A: Error and Informational Messages,” for additional information.

Stopping Interface Running as a Service

If the interface was installed a service, it can be stopped at any time from PI-ICU, the services control panel or with the command:

PIOSIWMI.exe –stop

The service can be removed by:

PIOSIWMI.exe –remove

To stop the interface service with PI-ICU, use the [pic] button on the PI-ICU toolbar.

Buffering

For complete information on buffering, please refer to the PI-API Installation Instruction.

PI Interface Node buffering consists of a buffering process which runs continuously on the local node, a PI-API library whose calls can send data to this buffering process, and a utility program for examining the state of buffering and controlling the buffering process.

Note: Change the Local Security Policy on Windows XP.

1. Open "Administrative Tools" from the control panel.

2. Open "Local Security Policy" from administrative tools.

3. Browse to "Security Options" under "Local Policies."

4. Double click on "System Objects: Default owner for objects created by members of the Administrators group."

5. Change the dropdown from "Object Creator" to "Administrators group."

The behavior of Bufserv should now be the same on XP as it was for NT4 and 2000.

Configuring Buffering with PI-ICU

Buffering is enabled through the PI-Interface Configuration Utility’s Tools>API Buffering… menu. Unless buffering is explicitly enabled, the PI-API will not buffer data, sending data directly to the home node.

The API Buffering… dialog allows the user to view and configure the parameters associated with the API Buffering (bufserv) process. The user can start and stop the API Buffering process from the Service tab:

[pic]

Service Tab

The Service tab allows for some API Buffering service configuration. For further configuration changes, use the Services applet.

Service Name

The Service name displays the name of the API Buffering Service.

Display Name

The Display name displays the full name associated with the API Buffering service.

Log On As

Log on as indicates the Windows user account under which the API Buffering service is setup to start automatically on reboot, or manually.

Password

Password is the name of the password for the Windows user account entered in the Log on as: above.

Confirm password

You must reenter the password again to verify you have typed it correctly both times.

Dependencies

The Dependencies lists the Windows services on which the API Buffering service is dependent.

Dependent Services

The Dependent services area lists the Windows services that depend on bufserv to function correctly.

Start / Stop Service

The Start / Stop buttons allow for the API Buffering service to be started and stopped. If the service is not created, this box will show Not Installed.

After a change is made to any of the settings on the Settings tab, the OK button must be clicked to save these settings, and then the service must be stopped and restarted for the changes to be picked up by bufserv.

Service Startup Type

The Startup Type indicates whether the API Buffering service is setup to start automatically on reboot or manually on reboot, or is disabled.

• If the Auto option is selected, the service will be installed to start automatically when the machine reboots.

• If the Manual option is selected, the interface service will not start on reboot, but will require someone to manually start the service.

• If the Disabled option is selected, the service will not start at all.

Generally, the API Buffering service is set to start automatically.

Create/Remove Service

The Create / Remove buttons allow for the creation or removal of the API Buffering service. Clicking the Create button will cause the service to be created using the Log on as and passwords given. Once the service is created the Start / Stop buttons will be activated.

Settings Tab

The Settings tab allows for configuration of the 7 configurable settings used by API Buffering. Default values are used if no other value is provided.

[pic]

Enable Buffering

Enables the API Buffering feature.

Maximum File Size

Maximum buffer file size in kilobytes before buffering fails and discards events. Default value is 100,000. Range is 1 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Send Rate

Send rate is the time to wait between sending up to MAXTRANSFEROBJS to the server (milliseconds). Default value is 100. Range is 0 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Primary Memory Buffer Size

Primary memory buffer size is the size in bytes of the Primary memory buffer. Default value is 32768. Range is 64 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Secondary Memory Buffer Size

Secondary memory buffer size is the size in bytes of the Secondary memory buffer. Default value is 32768. Range is 64 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Max Transfer Objects

Max transfer objects is the maximum number of events to send between each SENDRATE pause. Default value is 500. Range is 1 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Pause Rate

When buffers are empty the buffering process will wait for this number of seconds before attempting to send more data to the home node. Default value is 2. Range is 0 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Retry Rate

When the buffering process discovers the home node is unavailable it will wait this number of seconds before attempting to reconnect. Default value is 120. Range is 0 to 2,000,000.

The Use Default button places the default value into the text box. To keep this value, click the Apply button.

Max Theoretical Send Rate

This is the theoretical max send rate which is calculated like this:

max = MAXTRANSFEROBJS / SENDRATE * 1000

Default value is 5000. This value is automatically calculated for the user and can not be changed.

There are no additional steps needed to install buffering after installing the PI-API. The delivered PI-API library supports both buffered and un-buffered calls.

Configuring Buffering Manually

Buffering is enabled through the use of a configuration file, piclient.ini. Unless this file is modified to explicitly enable buffering, the PI-API will not buffer data, sending data directly to the home node.

There are no additional steps needed to install buffering after installing the PI-API. The delivered PI-API library supports both buffered and un-buffered calls.

Note: When buffering is configured to be on, the bufserv process must be started before other programs using the PI-API, so that these programs can access the shared buffering resources. Any program that makes a connection to a PI Server has this requirement even if it does not write to PI.

Configuration of buffering is achieved through entries in the piclient.ini file. The file is found in the dat subdirectory of the PIHOME directory (typically c:\Program Files\pipc\dat). This file follows the conventions of Microsoft Windows initialization files with sections, keywords within sections, and values for keywords. All buffering settings are entered in a section called [APIBUFFER]. To modify settings, simply edit the piclient.ini file in a text editor (Notepad) to the desired values.

The following settings are available for buffering configuration:

|Keywords |Values |Default |Description |

|BUFFERING |0,1 |0 |Turn off/on buffering. OFF = 0, ON = 1, |

|PAUSERATE |0 – 2,000,000 |2 |When buffers are empty the buffering process will wait for|

| | | |this long before attempting to send more data to the home |

| | | |node (seconds) |

|RETRYRATE |0 – 2,000,000 |120 |When the buffering process discovers the home node is |

| | | |unavailable it will wait this long before attempting to |

| | | |reconnect (seconds) |

|MAXFILESIZE |1 – 2,000,000 |100,000 |Maximum buffer file size before buffering fails and |

| | | |discards events. (Kbytes) |

|MAXTRANSFEROBJS |1 – 2,000,000 |500 |Maximum number of events to send between each SENDRATE |

| | | |pause. |

|BUF1SIZE |64 – 2,000,000 |32768 |Primary memory buffer size. (bytes) |

|BUF2SIZE |64 – 2,000,000 |32768 |Secondary memory buffer size. (bytes) |

|SENDRATE |0 – 2,000,000 |100 |The time to wait between sending up to MAXTRANSFEROBJS to |

| | | |the server (milliseconds) |

In addition to the [APIBUFFER] section, the [PISERVER] section may be used to define the default PI server and an optional time offset change that may occur between the client and server.

|Keywords |Values |Default |Description |

|DSTMISMATCH |0 – 2,000,000 |0 |The time that the server and client local time |

| | | |offset is allowed to jump. Typically, 3600 if the |

| | | |nodes are in time zones whose DST rules differ |

| | | |(seconds) |

Example piclient.ini File

On Windows the default server information is stored in the pilogin.ini file so the piclient.ini would only have the [APIBUFFER] section. The BUFFERING=1 indicates that buffering is on. The MAXFILESIZE entry in Kbytes of 100000 allows up to 100 Megabytes of data storage. Do not use commas or other separators in the numeric entries. The retry rate is set to 600 seconds meaning wait 10 minutes after losing a connection before retrying.

A piclient.ini file might look like:

[APIBUFFER]

BUFFERING=1

MAXFILESIZE=100000

; The PI-API connection routines have a 1 minute default timeout.

RETRYRATE=600

Appendix A:

Error and Informational Messages

A string NameID is pre-pended to error messages written to the message log. Name is a non-configurable identifier that is no longer than 9 characters. ID is the interface instance, the /id parameter on the startup command line.

Message Logs

Messages are written to PIHOME\dat\pipc.log at the following times:

• When the interface starts many informational messages are written to the log. These include the version of the interface, the version of UniInt, the command-line parameters used and the number of points.

• As the interface retrieves points, messages are sent to the log as each point is added to the interface. If the interface detects a problem with a points configuration, a message detailing this problem will be in the log

• Additional messages to monitor the workings of the interface are available by specifying db=nn on the command line or by setting point level debugging

Messages

Point Load

Informational messages are written to the log when a PI point is added or removed from the interface. If the interface has a problem loading a point the system state Configure is written to the point and a message will be written to log indicating the reason the point failed to load.

Connection

When each point group connects or loses a connection to the WMI service a message will be written to the log. For example

• PI-OSIWMI 5> Connection> Namespace '\\test2\root\cimv2' Connected (Success).for PointGroup (NS=\\TEST2\ROOT\CIMV2:GTOBJ=WIN32_LOGICALDISK.DEVICEID='C:')

Scanning

When a point or point group has a problem retrieving values from WMI a message will be written to the log. If the problem continues the interface will suppress messages from this point group or point so as not to flood the log file with repeated messages. Some examples are

• PI-OSIWMI 2> Failed getting object in PointGroup (NS=\\PERTHLAPTOP\ROOT\CIMV2:EXQY=SELECT * FROM WIN32_PROCESS WHERE WORKINGSETSIZE >'10000') Error: GetNextObject failed with timeout: Error HRESULT 0x40004 : Timed out: Will retry next scan

Try changing the timeout for the interface or this point group.

• PI-OSIWMI 5> Failed getting object in PointGroup (NS=\\.\ROOT\CIMV2:EXQY=SELECT * FROM WIN32_RABBIT WHERE EARS>10) Error: GetNextObject failed with Error: Error HRESULT 0x80041010 : Invalid class: Will retry next scan

Here the query has failed for this point group, all point in this point group will have failed written to them. We can use the point group name to see the namespace we are querying and the query we are using. There is no WIN32_Rabbit calss in root\cimv2. Use CIM Studio or wbemtest.exe to fix the query.

• PI-OSIWMI 5> Tag WMITest22(20958) Failed to get property (Fred) for String point. PointGroup (NS=\\.\ROOT\CIMV2:EXQY=SELECT * FROM WIN32_PROCESS WHERE CREATIONDATE >'#LET#') Error : Object Get failed: Error HRESULT 0x80041002 : Not found

Here a single point in this point group has failed. After the point group made the query, each point in the group gets property values from the objects returned. Here Tag WMITest22 failed to get the property “fred” from the object (as this property does not exist in this type of object). “Failed” will be written to this point.

Troubleshooting

If a PI point fails to get a good value, point level debugging can be enabled by adding the keyword db to the points Exdesc, Point level debugging will write to the log the exact query the interface makes to WMI and the result returned by the WMI service. This query can then be checked using CIM Studio or wbemtest.exe.

If the interface as a whole is not behaving as expected then the interface level debugging should be set (see command line parameter /db).

In either case it is not advised to leave the interface running with debug levels set as this may cause the log file to grow rapidly and affect the performance of the interface.

System Errors and PI Errors

System errors are associated with positive error numbers. Errors related to PI are associated with negative error numbers.

Error Descriptions on NT and Unix

On NT and UNIX, descriptions of system and PI errors can be obtained with the pidiag utility:

NT: \PI\adm\pidiag –e error_number

UNIX: /PI/adm/pidiag –e error_number

Appendix B:

Examples

The following example uses WMI CIM Studio to look at available classes. WMI CIM Studio is available for download from Microsoft as part of the WMI Administrative Tools package:

After installation, WMI CIM Studio can be started from the Start – Programs-WMI menu. After connecting to the desired namespace, classes are listed in the left-hand frame. The namespace can be searched for individual classes. A selected class appears in the right-hand frame showing available properties.

Win32_PingStatus (Looking at the Class)

The Win32_PingStatus WMI class represents the values returned by the standard ping command. More information on ping can be found in RFC 791.

Connect to root\cimv2 and select the Win32_PingStatus Class. The Win32_PingStaus class is a dynamic class (to see this, right click on the class in the right hand pane and select “Object Qualifiers…”) so you can not select all instances in CIM studio, rather an instance will need to be created.

[pic]

To create an instance of this class click the “WQL Queries” [pic] button and enter the following Query:

Select * from Win32_PingStatus Where Address='’

Click Execute. You can use any host name or IP here.

[pic]

The returned instance is listed in the right-hand frame. Right-click on this instance and select “Go to object.”

Win32_PingStatus (Point Configuration)

Two Properties of the Win32_PingStatus class look useful to monitor with the interface, the StatusCode and the ResponseTime. Details of these class properties can be obtained from the Microsoft documentation. In the following example we configure two tags to monitor the ping status between a remote API node (API_01) and the PI server (PI). Note that it is not necessary to have the interface on either machine.

|Point Attribute |Value |

|Tag |Ping1Status |

|InstrumentTag |\\API_01\root\CIMV2 |

|ExDesc |WQL=Select * from Win32_PingStatus Where Address= ‘PI ‘; Property=StatusCode; Map= |

| |Win32_PingStatus_StatusCodes |

|PointType |Digital |

|DigitalSet |PingStatus |

|Point Attribute |Value |

|Tag |Ping1Response |

|InstrumentTag |\\API_01\root\CIMV2 |

|ExDesc |WQL=Select * from Win32_PingStatus Where Address= ‘PI ‘; Property=ResponseTime |

|PointType |Int32 |

PingStatus Digital State Set

The interface needs to be installed and run under an account with permission to connect to the WMI service on the machine API_01.

Ping1Status uses a map file to map to the digital state set PingStatus, the status code meanings are shown below. The digital state set PingStatus will need to be created on the server to match the meanings of the StatusCode, which is an integer value.

|StatusCode Value|Meaning |Digital State |Digital State Name |

| | |Offset | |

|0 |Success |0 |Success |

|11001 |Buffer Too Small |1 |Buffer Too Small |

|11002 |Destination Net Unreachable |2 |Destination Net Unreachable |

|11003 |Destination Host Unreachable |3 |Destination Host Unreachable |

|11004 |Destination Protocol Unreachable |4 |Destination Protocol Unreachable |

|11005 |Destination Port Unreachable |5 |Destination Port Unreachable |

|11006 |No Resources |6 |No Resources |

|11007 |Bad Option |7 |Bad Option |

|11008 |Hardware Error |8 |Hardware Error |

|11009 |Packet Too Big |9 |Packet Too Big |

|11010 |Request Timed Out |10 |Request Timed Out |

|11011 |Bad Request |11 |Bad Request |

|11012 |Bad Route |12 |Bad Route |

|11013 |TimeToLive Expired Transit |13 |TimeToLive Expired Transit |

|11014 |TimeToLive Expired Reassembly |14 |TimeToLive Expired Reassembly |

|11015 |Parameter Problem |15 |Parameter Problem |

|11016 |Source Quench |16 |Source Quench |

|11017 |Option Too Big |17 |Option Too Big |

|11018 |Bad Destination |18 |Bad Destination |

|11032 |Negotiating IPSEC |19 |Negotiating IPSEC |

|11050 |General Failure |20 |General Failure |

| |Host Not Found |21 |Host Not Found |

For simplicity, the exact same Digital State Name as the meaning of the status code has been used and the states are in order of the status code values, although this is not required. Although a Map file section that maps the Status Code Value to the Digital Number is required. The section should be:

[Win32_PingStatus_StatusCodes]

0,0

11001, 1

11002, 2

11003, 3

11004, 4

11005, 5

11006, 6

11007, 7

11008, 8

11009, 9

11010, 10

11011, 11

11012, 12

11013, 13

11014, 14

11015, 15

11016, 16

11017, 17

11018, 18

11032, 19

11050, 20

,21

Win32_Process (Order by Group)

We can use this class to log the top three processes in regard to WorkingSetSize.

|Point Attribute |Value |

|Tag |TopWorkingSet_1 |

|InstrumentTag |\\PI\root\CIMV2 |

|Location2 |1 |

|Location3 |1 |

|ExDesc |WQL=select * from win32_Process; Property=Caption; |

| |Property=workingSetsize;orderbydec=workingSetsize |

|PointType |string |

|Point Attribute |Value |

|Tag |TopWorkingSet_1 |

|InstrumentTag |\\PI\root\CIMV2 |

|Location2 |1 |

|Location3 |2 |

|ExDesc |WQL=select * from win32_Process; Property=Caption; |

| |Property=workingSetsize;orderbydec=workingSetsize |

|PointType |string |

|Point Attribute |Value |

|Tag |TopWorkingSet_3 |

|InstrumentTag |\\PI\root\CIMV2 |

|Location2 |1 |

|Location3 |3 |

|ExDesc |WQL=select * from win32_Process; Property=Caption; |

| |Property=workingSetsize;orderbydec=workingSetsize |

|PointType |string |

GetObject

Win32_LogicalDisk (FreeSpace)

Get the disk free space from drive C

|Point Attribute |Value |

|Tag |DiskFreeSpace |

|InstrumentTag |\\PI\root\CIMV2 |

|Location2 |0 |

|Location3 |0 |

|ExDesc |GetObject=Win32_LogicalDisk.DeviceID='C:';Property=FreeSpace |

|PointType |Float32 |

Compound Key

Some GetObject queries may require a compound key For Example:

GetObject=Win32_UserAccount.Domain='MyDomain',Name='user'

Object Singleton

Classes that are a type Singleton are restricted to only have one instance, use the @ notation to select the singleton instance.

GetObject=Win32_PerfFormattedData_Tcpip_UDP=@

Revision History

|Date |Author |Comments |

|4-Jan-05 |MDymond |Initial Document from Skeleton Version 1.15 |

|6-Sep-05 |RCPhan |Add ICU section |

|12-Oct-05 |Janelle |Formatting changes, put the command line parameters in |

| | |alphabetical order. Fixed headers and footers. |

|14-Oct-05 |MDymond |Clarified /PISDK in ExDesc and InstrumentTag. Updated to new |

| | |executable name PI OSIWMI |

|24-Oct-05 |Chrys |Version 1.0.0.0 Rev F: Interface name is PI-WMI; formatting |

| | |changes; fixed grammatical errors; |

|4-Nov-05 |MDymond |Version 1.0.0.0 Rev G: There was some ambiguity with the term |

| | |Method, made clearer. Changed placeholder text. |

|4-Nov-05 |Chrys |Version 1.0.0.0 Rev H: Fixed some typos and updated TOC. |

|11-Nov-06 |PChow |Version 1.0.0.0 Rev I: Removed reference to incorrect command line|

| | |parameter /to in Appendix A. |

| | | |

| | | |

| | | |

| | | |

-----------------------

6

5

3

1

2

4

3

5

4

1

2

Service installed or uninstalled

Status of the Interface Service

Status of the ICU

7

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download