Archived community.zenoss.org | full text search
Skip navigation
50308 Views 7 Replies Latest reply: Feb 3, 2010 4:35 PM by jmp242 RSS
ZenKeck Rank: White Belt 16 posts since
Jan 4, 2010
Currently Being Moderated

Feb 3, 2010 10:18 AM

python interpreter using different unicode than root

I am attempting to use check_esx_wbmem.py to monitor VMware's esxi (free) server. You need to add the PYWbem library to do so. As root, I downloaded pywbem-0.7.0.tar.gz from http://sourceforge.net/projects/pywbem/files/.

 

I then ran the script as root and it worked successfully.

 

Then I created a template in Zenoss, and added the script in the datasource tab and tested it. This is the result.

 

max uni code is
1114111
UCS4 build
20100203 10:07:09 Connection to https:/xxxxxxxxxx
20100203 10:07:09 Check classe CIM_ComputerSystem
Traceback (most recent call last):
File "/opt/zenoss/libexec/check_esx_wbmem.py", line 83, in ?
instance_list = wbemclient.EnumerateInstances(classe)
File "/usr/lib/python2.4/site-packages/pywbem/cim_operations.py", line 403, in EnumerateInstances
ClassName = CIMClassName(ClassName),
File "/usr/lib/python2.4/site-packages/pywbem/cim_operations.py", line 178, in imethodcall
reply_dom = minidom.parseString(resp_xml)
File "/opt/zenoss/lib/python/_xmlplus/dom/minidom.py", line 1924, in parseString
from xml.dom import expatbuilder
File "/opt/zenoss/lib/python/_xmlplus/dom/expatbuilder.py", line 32, in ?
from xml.parsers import expat
File "/opt/zenoss/lib/python/_xmlplus/parsers/expat.py", line 4, in ?
from pyexpat import *
ImportError: /opt/zenoss/lib/python/_xmlplus/parsers/pyexpat.so: undefined symbol: PyUnicodeUCS2_Decode

 

From the Python website, I found this explanation:

 

PYUnicodeUCS2_Decode == The only way to solve this problem is to use extension modules compiled with a Python binary built using the same size for Unicode characters.

 

So, as a novice in Python, etc. I'm confused as to why it works as root, but when run as Zenoss it craps out. I can only assume that zenoss's pyexpat.so was compiled with an interpreter where unicode was set to ucs2.  How do I get my python script to compile with ucs2 and not ucs4?


Thanks in advance.

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points