![]() |
![]() |
Subject: | Zenoss5 - How to install python modules? |
Author: | [Not Specified] |
Posted: | 2015-05-02 03:25 |
Hi,
I'm trying to use the MongoDB zenpack which relies on the pymongo module. I've installed pymongo through pip and it's in /usr/local/lib/python3.4/dist-packages/pymongo and /usr/local/lib/python2.7/dist-packages/pymongo.
However, whenever I try to add a MongoDB monitoring template to a server I get an error that the pymongo module could not be found.
Is there a different place to add python modules in Zenoss5
Thanks,
Neil.
Subject: | You have to install pymongo |
Author: | Jan Garaj |
Posted: | 2015-05-02 07:01 |
You have to install pymongo in Zenoss container. Try:
serviced service shell -i -s pymongochange zope bash
easy_install pymongo
serviced snapshot commit pymongochange
serviced service restart Zenoss.core
Devops Monitoring Expert advice:
Dockerize/automate/monitor all the things.
DevOps stack:
Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform /
Elasticsearch
Subject: | Hi, |
Author: | [Not Specified] |
Posted: | 2015-05-02 14:29 |
Hi,
Thanks for that but I get the same error. I installed python-devel and gcc too as these are required by the pymongo install and the result looked positive:
[root@f52c0db4cf30 /]# easy_install -m pymongo
Searching for pymongo
Reading https://pypi.python.org/simple/pymongo/
Best match: pymongo 3.0.1
Downloading https://pypi.python.org/packages/source/p/pymongo/pymongo-3.0.1.tar.gz#m...
Processing pymongo-3.0.1.tar.gz
Writing /tmp/easy_install-sYaEiK/pymongo-3.0.1/setup.cfg
Running pymongo-3.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-sYaEiK/pymongo-3.0.1/egg-dist-tmp-TbxBPW
zip_safe flag not set; analyzing archive contents...
Installed /usr/lib/python2.7/site-packages/pymongo-3.0.1-py2.7-linux-x86_64.egg
Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:
pkg_resources.require("pymongo") # latest installed version
pkg_resources.require("pymongo==3.0.1") # this exact version
pkg_resources.require("pymongo>=3.0.1") # this version or higher
Processing dependencies for pymongo
Finished processing dependencies for pymongo
[root@f52c0db4cf30 /]# exit
exit
root@frnms1:/home/neil# serviced snapshot commit pymongochange2
2hr7mgilus6vavnx52ii1925o_20150502-191818
root@frnms1:/home/neil# serviced service restart Zenoss.core
Restarting 33 service(s)
However the error is the same in zenoss:
Traceback (most recent call last): File "/opt/zenoss/ZenPacks/ZenPacks.community.zenMongoDB-1.1.egg/ZenPacks/community/zenMongoDB/libexec/check_mongo", line 33, in import pymongo ImportError: No module named pymongo
Thanks,
Neil.
Subject: | 2nd attempt: |
Author: | Jan Garaj |
Posted: | 2015-05-02 16:04 |
2nd attempt:
serviced service shell -i -s pymongochange zope bash
sudo su - zenoss
easy_install pymongo
serviced snapshot commit pymongochange
serviced service restart Zenoss.core
Devops Monitoring Expert advice:
Dockerize/automate/monitor all the things.
DevOps stack:
Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform /
Elasticsearch
Subject: | Ah, I never knew python |
Author: | [Not Specified] |
Posted: | 2015-05-03 03:58 |
Ah, I never knew python modules were user specific! Thanks, that got me further, but it looks like the mongo guys have changed the interfaces in pymongo 3.x. I'm now getting the following error:
AttributeError: 'module' object has no attribute 'Connection'
I'll have a crack at modernising the python scripts to use the newer methods and report back.
Thanks for all your help.
Neil.
Subject: | You can specify version |
Author: | Jan Garaj |
Posted: | 2015-05-03 06:11 |
You can specify version
easy_install pymongo=x.x.x
Try to install older version (2.) of pymongo and maybe it will be OK.
Devops Monitoring Expert advice:
Dockerize/automate/monitor all the things.
DevOps stack:
Docker / Kubernetes / Mesos / Zabbix / Zenoss / Grafana / Puppet / Ansible / Vagrant / Terraform /
Elasticsearch
< |
Previous Windows server monitoring in zenoss 5 |
Next unable to install Percona |
> |