Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different results when querying from Windows and Linux. #415

Open
Wayenyin opened this issue Oct 17, 2017 · 6 comments
Open

Different results when querying from Windows and Linux. #415

Wayenyin opened this issue Oct 17, 2017 · 6 comments
Assignees

Comments

@Wayenyin
Copy link

For this question, the array is just empty, we will query and get different results by following ways.

ENV

  • Win2012 erver: omi-w12r2-01 [10.226.190.74]
  • Clients: py64-cent7-t2 [10.226.193.46]

Build

Repro Steps

  1. Install omi version 1.3.0-105;
  2. Install python provider: \\ostcnfs-01\OSTCDATA\Team\v-zhenpy\providers\OMIScriptProvider-1.1.1-1.ssl_.x64.rpm
  3. Currently copy customized python provider to /opt/omi/lib
  4. Switch to above directory: "cd /opt/omi/lib";
  5. Register Python provider and check it: "/opt/omi/bin/omireg --Python xyz_dog"
    root@py64-cent7-t2 # cat /etc/opt/omi/conf/omiregister/root-cimv2/xyz_dog.reg
    # omireg xyz_dog
    INTERPRETER=python2.7
    STARTUP=client.py
    LIBRARY=xyz_dog
    CLASS=XYZ_Dog
  6. Execute enumerated command and get result on Linux:” /opt/omi/bin/omicli ei root/cimv2 XYZ_Dog”
    root@py64-cent7-t2 # /opt/omi/bin/omicli ei root/cimv2 XYZ_Dog
    instance of XYZ_Dog
    {
    [Key] Key=1001
    Array2={}
    Array3={10, 20, 30}
    }
  7. Execute enumerated command with “none” auth and get result on Linux:” /opt/omi/bin/omicli ei root/cimv2 XYZ_Dog”
    root@py64-cent7-t2 # /opt/omi/bin/omicli ei -u root -p *** --auth Basic --hostname py64-cent7-t2 root/cimv2 XYZ_Dog --encryption none --port 5985
    instance of XYZ_Dog
    {
    Key=1001
    Array3={10, 20, 30}
    }
  8. Execute enumerated command with “unencrypted” auth and get result on Win2012:” winrm enumerate http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/XYZ_Dog?__cimnamespace=root/cimv2 -r:http://py64-cent7-t2:5985 -auth:Basic -u:root -p:*** -unencrypted -encoding:utf-8”
    PS C:\Windows\system32> winrm enumerate http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/XYZ_Dog?__cimnamespace=root/cimv2 -r:http://py64-cent7-t2:5985 -auth:Basic -u:root -p:*** -unencrypted -encoding:utf-8
    XYZ_Dog
    Key = 1001
    Array1 = null
    Array3 = 10, 20, 30

Expectly: The results should be same.
Actual: The results are different by above ways.

@palladia
Copy link
Contributor

Eric, could you please investigate this?

@EMumau
Copy link
Contributor

EMumau commented Feb 20, 2018

I looked into this.

The XYZ_Dog provider appears to add a test case that doesn't exist in OMI.

The XYZ_Dog sample provider returns an empty array. The array is not NULL. It is deliberately an array with zero items.

The omicli demonstrates that the omiserver is handling this correctly. It appears that whatever additional serialization is occurring because of the --auth parameter is handling empty arrays differently.

I am passing to Bruce because he implemented the auth layer.

@palladia
Copy link
Contributor

Jumping, please investigate this. If you need authentication help, please contact Bruce.

@JumpingYang001
Copy link
Contributor

Investigating.

@sarojcare
Copy link
Contributor

Jumping will further investigate the issue and update the findings accordingly.

@JumpingYang001
Copy link
Contributor

we tried c provider https://github.com/Microsoft/omi/blob/master/Unix/samples/Providers/Dog/schema.mof and shows same result:

root@ost64-ora7-01  # /opt/omi/bin/omicli ei root/cimv2 XYZ_Dog
instance of XYZ_Dog
{
    [Key] Key=1001
    Array2={}
    Array3={10, 20, 30}
} 
root@ost64-ora7-01  # /opt/omi/bin/omicli ei -u root -p *** --auth Basic --hostname *** root/cimv2 XYZ_Dog --encryption none --port 5985
instance of XYZ_Dog
{
    Key=1001
    Array3={10, 20, 30}
} 
PS C:\Windows\system32> winrm enumerate http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/XYZ_Dog?__cimnamespace=ro
ot/cimv2 -r:http://ost64-ora7-01:5985 -auth:Basic -u:root -p:*** -unencrypted -encoding:utf-8
XYZ_Dog
    Key = 1001
    Array1 = null
    Array3 = 10, 20, 30

just want to double check it is really on omi, and I will continue to investigate the --auth issue tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants