Forum Discussion

Julius_G's avatar
3 years ago

LM monitoring IBM Storage V7000 and Flash Systems


We would like to add our IBM storage on LM and with no success. There is a custom datasource that was given to us but it does not work. Did anyone successfully add their IBM storage in LM? Here is a copy of the Datasource we are using. It is supposed to be a cluster statistics.


//script for IBM Cluster Statistics Active Discovery 

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

// variables to hold system info
def hostname = "https://" + hostProps.get("system.hostname")
def username = hostProps.get("cim.user")
def password = hostProps.get("cim.pass")
//variables to hold cim information 
def namespace = "root/ibm"
def cim_class = "IBMTSSVC_Cluster"

    //connect to WBEM server and retrieve a WBEM client
    client = connectToLink(hostname, username, password)
    //loop through instances  
    getDesiredMetrics(client, cim_class,namespace).each
    { output->
        //instacne name
        entry_name = output.'ID'

        //instance level properties
        console_IP = output.'ConsoleIP'
        console_port = output.'ConsolePort'
        //prints in active discovery format 
        println "${entry_name}##${entry_name}${console_IP}&&${console_port}"    

    return 0//success!!

// Catch any exception, print it out and return 1.
catch (Exception e)
    println e
    return 1 //fail!!

 * Helper method that obtains the desired metrics
 * @param WBEMClient client
 * @param String cim_class
 * @param String namespace
 * @return Array of instances' and their metrics.
def getDesiredMetrics(WBEMClient client, String cim_class, String namespace)
    //list of desired instances' properties
    def instance_List = []
    //map of instances' and their given properties
    def metrics_Map = [:]

        //grabs all instances
        final CloseableIterator<CIMInstance> iterator = client.enumerateInstances(new CIMObjectPath(cim_class, namespace), true, false, false, null)

        //goes through the instances
        while (iterator.hasNext())
            //current instance
            final CIMInstance instance =

            //grabs properties for an instance
            props = instance.getProperties()

            //iterates through list of propertes
            { it ->
                //add to map of metrics for a given instance


            //add a given instance's map to list of instances
            //clear map for next instance
            metrics_Map = [:]

    // Catch WMEME exception, print it out
    catch (WBEMException e)
        print e.toString()

    //return list of instances and their metric maps
    return instance_List

 * Helper method that handles the API connection.
 * @param hostname
 * @param username
 * @param password
 * @return API client 
def connectToLink (String hostname, String username, String password)
    //grabs desired URL for given device
    URL cimomUrl = new URL("https://${hostname}:5989")

    //establishes client and path to connect
    final WBEMClient client = WBEMClientFactory.getClient(WBEMClientConstants.PROTOCOL_CIMXML)
    final CIMObjectPath path = new CIMObjectPath(cimomUrl.getProtocol(), cimomUrl.getHost(), String.valueOf(cimomUrl.getPort()), null, null, null)

    //holder for credentials
    final Subject subject = new Subject()

    //establishes username and password credentials 
    subject.getPrincipals().add(new UserPrincipal(username))
    subject.getPrivateCredentials().add(new PasswordCredential(password))

        //initializes client pool
        client.initialize(path, subject, null)

    // Catch any exception, print it out
    catch (Exception e)
        print e.toString()
    return client



1 Reply

  • Anonymous's avatar

    Does the DS "test applies to" button correctly apply to the device? Check that first.