incubator-imperius-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeraj Joshi <jnee...@us.ibm.com>
Subject Re: AW: Imperius - Executing polices - Exception
Date Thu, 19 Aug 2010 14:21:40 GMT
Hey Christian,
It looks like PG_ComputerSystem.OperationalStatus is an uint16[] while 
OpStatus is a simple int. Can you try comparing simple properties  like 
PowerState perhaps?
Thanks
Neeraj
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"It is hard enough to remember my opinions, without also remembering my 
reasons for them". -Friedrich Wilhelm Nietzsche

Neeraj Joshi (knee-rudge)
WebSphere XD - Compute Grid
AIM, IBM
Apache Imperius - http://incubator.apache.org/imperius
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From:
"Christian Rupert" <christian.rupert@web.de>
To:
Neeraj Joshi/Durham/IBM@IBMUS
Date:
08/19/2010 07:46 AM
Subject:
AW: Imperius - Executing polices - Exception
Sent by:
christian.rupert@web.de



Hi Neeray,
 
thanks, by first creating the policy via –c option it works now.
But I have another question: all my policies check the instance of a 
testElement.
When I try to check my instance of e.g. the PG_ComputerSystem I get an 
CIM_ERR_FAILED, because it looks like he can´t access properties of an 
another class beside the testElement class.
Do I need a special provider to access properties of the instances?
 
This is my output:
 
root@rupchr-laptop:/opt/imperius/trunk/cimspl-samples/resources# 
./cimsplcmdline.sh -c ./samples/policies/ ProcessPolicy
CIMSPL Client
Established Connection
create policy :ProcessPolicy path ./samples/policies/
createPolicy** : ./samples/policies/ ProcessPolicy
path=./samples/policies/ProcessPolicy.spl
Import Qualifier root/cimv2 Class testElement;
Import Qualifier root/cimv2 Class PG_ComputerSystem;
Strategy Execute_All_Applicable;  /* Execute all policies */
Policy 
{
        Declaration
        {      
                               OpStatus = 2;
        }
        Condition 
        {  
                               PG_ComputerSystem.OperationalStatus == 
OpStatus;
        }
        Decision 
        {
                Set(testElement.s32 = 357) 
        }     
}:1;  /* Priority of the policy */
Error: CIM_ERR_FAILED
 
My Instance of PG_ComputerSystem looks like:

 
Von: Neeraj Joshi [mailto:jneeraj@us.ibm.com] 
Gesendet: Mittwoch, 11. August 2010 15:59
An: Christian Rupert; imperius-user@incubator.apache.org; 
imperius-dev@incubator.apache.org
Betreff: Re: Imperius - Executing polices - Exception
 

Hey Christian, 
Did you first create the policy via the -c option ? 


./cimsplcmdline.sh -c <policy path> <plicy name> 

Thanks 
Neeraj 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"It is hard enough to remember my opinions, without also remembering my 
reasons for them". -Friedrich Wilhelm Nietzsche

Neeraj Joshi (knee-rudge)
WebSphere XD - Compute Grid
AIM, IBM
Apache Imperius - http://incubator.apache.org/imperius
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

christian.rupert@web.de wrote on 08/11/2010 09:34:33 AM:

> [image removed] 
> 
> Imperius - Executing polices - Exception 
> 
> Christian Rupert 
> 
> to: 
> 
> Neeraj Joshi 
> 
> 08/11/2010 09:34 AM 
> 
> Sent by: 
> 
> christian.rupert@web.de 
> 
> Hi Joshi, 
>   
> I´m trying to execute some policies and following errors occurs 
> while executing: 
>   
> root@rupchr-laptop:/opt/imperius/trunk/cimspl-samples/resources# ./
> cimsplcmdline.sh -x ./samples/policies/testElement1Policy.spl 
> CIMSPL Client 
> Established Connection 
> exec policy./samples/policies/testElement1Policy.spl 
> cimObjectPath : root/cimv2:CIM_SPLPolicyRule 
> Error: CIM_ERR_FAILED 
>   
> When executing the cimsplclientsideprovider this error occurs: 
>   
> root@rupchr-laptop:/opt/imperius/trunk/imperius-
> cimsplclientsideprovider/resources# ./cimsplcmdline.sh -x ./
> policies/testElement1Policy.spl 
> CIMSPL Client Side 
> got new cim client 
> Established Connection 
> exec policy./policies/testElement1Policy.spl 
> executePolicy client SPL policy ./policies/testElement1Policy.spl 
>  no instances passed in , evaluating against all instances 
> Error: policy does not exist in the Repository 
>   
> I´ve added both, the class CIM_SPLPolicyRule.mof and the provider 
> CIM_SPLPolicyRuleProviderR.mof, successfully. 
> What is meant by “policy does not exist in the Repository”? 
>   
> Really need some help, would be great. 
> Thank you in advance, 
>   
> Christian Rupert 
> University of Applied Sciences Pforzheim 
> Research project SECURITAS 
>   
>   
> Appendix: 
>   
> - CIM Server (OpenPegasus 2.11.0) is running: 
>   
> root@rupchr-laptop:/opt/imperius/trunk/cimspl-samples/resources# 
cimserver 
> CIM Server 2.11.0 Development 
> Listening on HTTP port 5988. 
> Listening on local connection socket. 
> Started. 
>   
>   
> -I registered the testElement.mof and there´s an instance of it: 
>   
> root@rupchr-laptop:/opt/imperius/trunk/cimspl-samples/resources# 
> cimcli gi testElement1 
> 1: testElement1.ElementName="element10" 
> 2: testElement1.ElementName="element11" 
> 3: testElement1.ElementName="element12" 
> 4: testElement1.ElementName="" 
> Select an Instance (1..4)? 1 
> path= testElement1 
>   
> //Instance of testElement1 
> instance of testElement1 
> { 
> ElementName = "element10"; 
> s = "string5"; 
> c = d; 
> n64 = 54; 
> n32 = 54; 
> n16 = 54; 
> n8 = 54; 
> r64 = 5.4000000000000000e+01; 
> r32 = 5.4000000000000000e+01; 
> d = "20071129071628.000000-480"; 
> s64 = -530; 
> s32 = -530; 
> s16 = -50; 
> s8 = -10; 
> b = FALSE; 
> childProperty = "child property5"; 
> }; 
>   
>   
>   
> - The testElement1Policy.spl looks like: 
>   
> Import Qualifier root/cimv2 Class testElement1; 
>   
> Strategy Execute_All_Applicable; 
>   
> Policy 
> { 
>     Declaration 
>     { 
>         evenArray = [2,4,6,8]; 
>         oddArray = [1,3,5,7,9]; 
>         mixedArray = [1,3,4,5,8]; 
>     }     
>     Condition 
>     {   
>         SubCollection(mixedArray,Union(evenArray,oddArray)) 
>     } 
>     Decision 
>     { 
>         Set(testElement1.s = "xyzs") 
>     } 
> }:1; 
>   
>   
>   
> - Testing my CIMServer: 
>   
> root@rupchr-laptop:/opt/imperius/trunk/imperius-
> cimsplclientsideprovider/resources# TestClient 
> Config file from //cimserver.conf 
> Namespace = root/cimv2 
> Connecting to localhost:5988 
> Client Connected 
> ++++ Begin tests... ++++ 
> ++++ Test NameSpace Operations ++++ 
> 6 namespaces  returned. 
> root 
> root/PG_InterOp 
> root/SampleProvider 
> root/benchmark 
> root/PG_Internal 
> root/cimv2 
> In 0.016126 Seconds 
>   
> ++++ Test Qualifier Operations ++++ 
> 71 Qualifiers 
> In 0.010503 Seconds 
>   
> ++++ Test EnumerateClassNames ++++ 
> 1401 ClassNames 
> In 0.008621 Seconds 
>   
> ++++ Test Class Operations ++++ 
> In 0.585187 Seconds 
>   
> ++++ Test Instance Get Operations ++++ 
> 1401 Classes found 
> Class testElement 8 Instances 
> Class CIM_StatisticalData 25 Instances 
> Class CIM_ComputerSystem 1 Instances 
> Class PG_ComputerSystem 1 Instances 
> Class CIM_PolicySet 1 Instances 
> Class CIM_CIMOMStatisticalData 25 Instances 
> Class PG_UnixProcess 162 Instances 
> Class testElementAssociation2 2 Instances 
> Class CIM_OperatingSystem 1 Instances 
> Class CIM_Capabilities 1 Instances 
> Class CIM_UnitaryComputerSystem 1 Instances 
> Class testElement1 4 Instances 
> Class testElement2 2 Instances 
> Class CIM_EnabledLogicalElement 164 Instances 
> Class CIM_ManagedSystemElement 164 Instances 
> Class PG_UnixProcessStatisticalInformation 162 Instances 
> Class CIM_PolicyRule 1 Instances 
> Class testElementAssociation 2 Instances 
> Class CIM_Process 162 Instances 
> Class CIM_Policy 1 Instances 
> Class CIM_LogicalElement 164 Instances 
> Class PG_OperatingSystem 1 Instances 
> Class CIM_System 1 Instances 
> Class CIM_QueryCapabilities 1 Instances 
> Class CIM_StatisticalInformation 162 Instances 
> Class CIM_ManagedElement 353 Instances 
> In 8.07605 Seconds 
>   
> ++++ Test Instance Modification Operations ++++ 
> InstanceModify bypassed because it modifies repository. Set active to 
execute. 
> In 3.3e-05 Seconds 
>   
> ++++ Test Associations ++++ 
> In 0.210524 Seconds 
>   
> ++++ Test Invoke Method Execution ++++ 
> Executed 10 methods 
> Executed 10 methods 
> Executed 10 methods 
> In 0.118207 Seconds 
>   
> ++++ Test Enumerate Instances Execution ++++ 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Found 3 Instances of Sample_InstanceProviderClass 
> Enumerate 3 instances 10 times 
> In 0.035202 Seconds 
>   
> +++++ Overall time taken for the operation +++++ 
> In 10.0625 Seconds 
>   
> +++++ TestClient Terminated Normally 
>   


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message