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 Web site at:

wbemservices.sourceforge.net/

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

Figure 1. Java program for connecting to asystem 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 Web site: