CIMOM programming

CIM object manager (CIMOM) programming provides the opportunity to handle multiple connections from multiple sources while maintaining security. CIM clients connect to the CIMOM with a user name and password and then start methods to run commands.

The creation of a CIM client requires a suitable framework such as the Java WBEM Service project and the SBLIM CIM Client for Java. There are also implementations in other languages, including C++ and Python. For more information, see the Java WBEM Services website at:

wbemservices.sourceforge.net/

Java program for connecting to a system CIMOM shows a simple Java program that connects to a system CIMOM.

Figure 1. Java program for connecting to a system CIMOM
import java.util.*; 

import javax.wbem.cim.*; 
import javax.wbem.client.*; 

public class ITSOClient { 
	 public static void main(String[] args) 
	 { 
		  String username = args[0]; 
		  String password = args[1]; 
		  String masterConsoleIP = args[2]; 
		  String masterConsoleSecurePort = args[3]; 
		  UserPrincipal user = new UserPrincipal(username); 
		  PasswordCredential pwd = new PasswordCredential(password); 
		  CIMNameSpace ns = new CIMNameSpace("https://”+ 
			      masterConsoleIP+”:”+ 
			      masterConsoleSecurePort+”/root/ibm"); 

		  CIMClient client = null; 
		  try	 
		  { 
			   System.out.println("Connecting to CIMOM"); 
			   client = new CIMClient(ns,user,pwd); 
			} 
			catch (CIMException e) 
			{ 
				 // Handle the CIM Exception 
				 e.printStackTrace(); 
		  } 
}  

To view the complete Managed Object Format (MOF) documentation, including the CIM agent style pages, select the documentation information from the following website:

https://datacentersupport.lenovo.com/