user1195650
user1195650

Reputation: 1

CIM/SMI-S Client with PHP

I'm working on a web interface to pull information from storage arrays. I'd like to use SMI-S There are Java CIM clients I can use (SBLIM CIM Client), but I'd really like there to be a way for PHP to pull information via CIM. Can anybody point me in the right direction? Is there a way I can, say, send a request over http (port 5988) and just parse out an xml response?

If anybody can suggest a better way that'd be great as well. Thank you.

Upvotes: 0

Views: 1152

Answers (2)

Madan Acharya
Madan Acharya

Reputation: 11

SMI-S calls to get array details may use GetInstances() or EnumerateInstances(), which are basically predefined methods. These methods come with library such as OpenPegasus. If you are successful in including the required libraries, then you can create the client variable, connect to the CIM server and invoke the required method.

If you are specifically using OpenPegasus, you may need to know how to use C++ in PHP as the former is implemented in C++. Refer http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/

Upvotes: 1

Andreas Maier
Andreas Maier

Reputation: 3080

I don't know of a CIM client written directly in PHP, but normally you can integrate packages written in Perl or Python into your server side PHP.

You could also integrate a command line CIM client into PHP, e.g. cimcli from OpenPegasus, but parsing the output of a command line client may not really be convenient.

I would recommend against writing your own CIM-XML parser - there are many details to observe in the specs (DSP0200, DSP0201), this would definitely be a major undertaking.

For Python, there is the PyWBEM CIM client which works very well, even though there is not much activity on the project. Also, there is the PowerCIM CIM client for Python, which is newer but I did not use it yet. PowerCIM provides the CIM classes as Python classes, while PyWBEM provides generic Python classes such as CIMInstance or CIMClass. Just two different styles to deal with, for integration into a next higher layer such as PHP it seems to me you'd be better off with the generic style provided by PyWBEM.

There is a Perl interface on top of the OpenWEM client, but I don't have experience with that.

Andy

Upvotes: 2

Related Questions