aouyar/PyMunin — Issue #12: pymunin-fsstats cannot locate _ESL module
Author: cwells
Created: 2012-02-27 05:06:59+00:00
State: open

Scientific Linux 6.1 (same as RHEL 6.1).

munin installed from EPEL repository.
pymunin installed via pip.
freeswitch ESL module properly installed (can import ESL from python CLI).

munin-node logs show the following:

```
2012/02/26-20:58:51 [1555] Error output from pymunin-fsstats:
2012/02/26-20:58:51 [1555] Traceback (most recent call last):
2012/02/26-20:58:51 [1555] File "/etc/munin/plugins/pymunin-fsstats", line 9, in
2012/02/26-20:58:51 [1555] load_entry_point('PyMunin==0.9.7', 'console_scripts', 'pymunin-fsstats')()
2012/02/26-20:58:51 [1555] File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
2012/02/26-20:58:51 [1555] return get_distribution(dist).load_entry_point(group, name)
2012/02/26-20:58:51 [1555] File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
2012/02/26-20:58:51 [1555] return ep.load()
2012/02/26-20:58:51 [1555] File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
2012/02/26-20:58:51 [1555] entry = __import__(self.module_name, globals(),globals(), ['__name__'])
2012/02/26-20:58:51 [1555] File "/usr/lib/python2.6/site-packages/pymunin/plugins/fsstats.py", line 38, in
2012/02/26-20:58:51 [1555] from pysysinfo.freeswitch import FSinfo
2012/02/26-20:58:51 [1555] File "/usr/lib/python2.6/site-packages/pysysinfo/freeswitch.py", line 6, in
2012/02/26-20:58:51 [1555] import ESL
2012/02/26-20:58:51 [1555] File "/usr/lib/python2.6/site-packages/ESL.py", line 7, in
2012/02/26-20:58:51 [1555] ImportError: No module named _ESL
2012/02/26-20:58:51 [1555] Service 'pymunin-fsstats' exited with status 1/0.
```

Verifying that ESL is properly installed:

```
Python 2.6.6 (r266:84292, May 20 2011, 16:42:11)
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ESL
>>> dir(ESL)
['ESLconnection', 'ESLconnection_swigregister', 'ESLevent', 'ESLevent_swigregister', '_ESL', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_swig_getattr', '_swig_repr', '_swig_setattr', '_swig_setattr_nondynamic', 'eslSetLogLevel', 'new', 'new_instancemethod']
>>>
```

Interestingly, running the module from the command line works:

```
./pymunin-fsstats
EXCEPTION: Connection to FreeSWITCH ESL Interface on host 127.0.0.1 and port 8021 failed.
```

The failure here is expected, since it lacks the proper connection information, however it does not issue a traceback regarding failing to find modules.