当前位置: 首页 > 工具软件 > Open Pegasus > 使用案例 >

openpegasus的启动方式(即cimserver的启动方式)

闾丘成礼
2023-12-01

我使用的操作系统为Fedora 12

 

1.安装

安装tog-pegasus和tog-pegasus-devel这两个包

 

2.配置启动选项

[root@lore ~]# cimconfig -s enableHttpConnection=True -p
Property 'enableHttpConnection' updated in configuration file.

 

还需禁用HTTPS方式的登录:

[root@lore Pegasus]# cimconfig -s enableHttpsConnection=False -p
Property 'enableHttpsConnection' updated in configuration file.

否则启动时会有如下错误

[root@lore Pegasus]# cimserver
cimserver not started: SSL Exception: Could not get server certificate.

 

会在/etc/Pegasus/目录下增加两个.conf文件

[root@lore Pegasus]# ls /etc/Pegasus/
access.conf  cimserver_current.conf  cimserver_planned.conf

 

3.启动cimserver

[root@lore Pegasus]# cimserver

 

 

4.测试连接

使用pywbem作为客户端连接cimserver

>>> import pywbem

>>> cliconn = pywbem.WBEMConnection('http://127.0.0.1',('root','password'))
>>> process_names = cliconn.EnumerateInstances('CIM_Process')
>>> print process_names[0].items()
[(u'OSCreationClassName', u'CIM_OperatingSystem'), (u'UserModeTime', 1000L), (u'Parameters', [u'/sbin/init']), (u'ExecutionState', 6L), (u'ProcessGroupID', 0L), (u'Priority', 20L), (u'OtherExecutionDescription', None), (u'Handle', u'1'), (u'Description', u'/sbin/init'), (u'RealUserID', 0L), (u'CSCreationClassName', u'CIM_UnitaryComputerSystem'), (u'ProcessTTY', u'?'), (u'OSName', u'Fedora'), (u'ProcessSessionID', 1L), (u'CreationClassName', u'PG_UnixProcess'), (u'WorkingSetSize', 0L), (u'Name', u'init'), (u'CSName', u'localhost'), (u'ParentProcessID', u'0'), (u'KernelModeTime', 66000L), (u'Caption', u'init'), (u'ProcessNiceValue', 0L)]

可以查询到服务器的一些信息。

 

 

5.添加用户(目前还有一些疑问)

cimauth -a -u lore -n root/cimv2 -R

 类似资料: