- Home ›
- Technology and Research ›
- Intel Technology Journal ›
- Intel® vPro™ Technology
Intel® vPro™ Technology
Innovating Above and Beyond Standards
A Developer’s Point of View
Given that the underlying data model for manageability with Intel® Active Management Technology (Intel® AMT) is based on an object-oriented schema; it maps well to object-oriented languages such as C#*, Java*, and even object-oriented scripting languages, such as VBScript*. However, there is nothing preventing low-level programming languages from participating in Intel AMT, WS-MAN operations, by way of low-level TCP/IP or HTTP requests. There is no pragmatic reason to do this: it adds significant complexity to development; however, for illustrative purposes, we show an example of how a raw HTTP request would be structured to issue a WS-MAN command [3].
For example, building the following request and submitting it with HTTP (Figure 4) would generate a “pull” action to gather data about “CIM_AssociatedPowerManagementService.” This would correlate to both the current and most recently requested power state for the machine that is being queried. In this example, the current power state (Figure 5) is 8, which implies that the machine is currently powered off.
Figure 4: Raw HTTP request
Source: Intel Corporation, 2008
click image for larger view
Note: This is a display of HTML code and not HTML code to be executed. It’s also an image of the code, which makes it unexecutable.
Figure 5: Raw HTTP request
Source: Intel Corporation, 2008
click image for larger view
Note: This is a display of HTML code and not HTML code to be executed. It’s also an image of the code, which makes it unexecutable.
If operating at an HTTP level, one big challenge, from a developer’s perspective, is that a large amount of structure needs to be defined accurately in a WS-MAN request to comprehend and support the current CIM schema referred to by DASH standards. Similarly, parsing a WS-MAN response for the data that are needed can be quite complex as well, especially for those developers who are less familiar or experienced with CIM. Fortunately, a wide range of classes are available that can help a developer interact with WS-MAN and Intel AMT without subjecting the developer to the complexity that exists at the CIM/XML content level.
One implementation of WS-MAN is Microsoft’s WinRM* [4] implementation. WinRM encapsulates most of the complexity of WS-MAN interactions into a COM implementation that can be used for a wide variety of languages. For example, the following piece of code shows how to read the power state of the machine from C# language by using WinRM.
static public WSManClient _WinRM = new WSManClient("192.168.0.157", "admin", "passwordgoeshere", false);
static void Main(string[] args)
{
ArrayList enumSystemPowerstate = _WinRM.Enumerate(typeof(CIM_AssociatedPowerManagementServiceType));
for (IEnumerator enumObj = enumSystemPowerstate.GetEnumerator(); enumObj.MoveNext(); )
{
CIM_AssociatedPowerManagementServiceType cur = (CIM_AssociatedPowerManagementServiceType)enumObj.Current;
Console.WriteLine("SystemPowerstate is: {0}\n", cur.PowerState);
}
}
Since WinRM is COM-based, it is relatively easier to use than a scripting language such as VBScript. To get information about the power state of the machine (the raw XML result), the following simple script can be used.
Dim WSMan
Dim Session, Options
Set WSMan = CreateObject( "WSMAN.Automation" )
iFlags = WSMan.SessionFlagUseDigest Or _
WSMan.SessionFlagCredUsernamePassword Or _
WSMan.SessionFlagUTF8
Set Options = Wsman.CreateConnectionOptions
Options.Username = "admin"
Options.Password = "P@ssw0rd"
Set Session = WSMan.CreateSession("http://10.19.68.218:16992/wsman", _
iFlags, Options)
strResource = "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_AssociatedPowerManagementService"
Set objResultSet = Session.Enumerate( strResource)
Wscript.Echo objResultSet.ReadItem
In this article
- Abstract
- Introduction
- How It All Began
- The Architecture of Platforms Enabled With Intel® vPro™ Technology
- Open Manageability Architecture on Platforms Running Intel® vPro™ Technology
- ISV Ecosystem Value, Innovation Opportunities, and the Promise of Interoperability
- Innovating Beyond and on Top of Standards
- A Developer's Point of View
- Looking Ahead
- References
- Acknowledgements
- Table of Acronyms
- Authors' Biographies
