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 invoke 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:
Figure 1 shows a simple Java program that connects to a Lenovo Storage V series 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/us/en/products/storage/lenovo-storage/v3700v2/6535 or http://support.lenovo.com/us/en/products/servers/lenovo-storage/v5030