iamseth / python-zenoss Goto Github PK
View Code? Open in Web Editor NEWPython module to work the Zenoss API
License: Do What The F*ck You Want To Public License
Python module to work the Zenoss API
License: Do What The F*ck You Want To Public License
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)
How to run request with verify=False ?
I am not able to find any API to get the list of devices based on the group name in zenoss?
Let me know if it can be achieved using some workaround.
Hi There,
as of today, 11/09/2016, I have problem installing the package.
using pip failed at copying 'LICENSE.txt' :
........
running install_data
error: can't copy 'LICENSE.txt': doesn't exist or not a regular file
Cleaning up...
Command /usr/bin/python2.7 -c "import setuptools, tokenize;file='/tmp/pip_build_root/zenoss/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-vH0qAV-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/zenoss
Storing debug log for failure in /root/.pip/pip.log
Manual install --
running install_data
error: can't copy 'list_devices.py': doesn't exist or not a regular file
workaround:
I have to modify the 'setup.py' file with below change, then manual install succeeded:
From:
data_files = [('', ['LICENSE.txt']),('', ['README.md']),('examples', ['list_devices.py']),]
To:
data_files = [('', ['LICENSE.txt']),('', ['README.md']),('examples','', ['list_devices.py']),]
Can you please fix the installation issue?
We launched a new Zenoss instance and it now uses SSL. I'm trying to use your code to get devices from my new Zenoss instance but I keep getting this error message:
File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [Errno 1] _ssl.c:492: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
I have access to the certificate file from the new Zenoss instance and tried using it in the script but it does not work. Here is how I configured to use the certificate file:
def init(self, host, username, password, ssl_verify='/home/user/filename.cer'):
self.__host = host
self.__session = requests.Session()
self.__session.auth = (username, password)
self.__session.verify = ssl_verify
self.__req_count = 0
If I set ssl_verify equal to False the script works and pulls all the devices but does give a "InsecureRequestWarning: Unverified HTTPS request is being made." warning. I'm trying to use SSL but can't get it to work. Can you please point me in the right direction?
Thanks
Mohsin
error message using example function to list all devices in Zenoss
[test@xxxxx bin]$ ./zenoss_test.py
Traceback (most recent call last):
File "./zenoss_test.py", line 7, in
for device in zenoss.get_devices()['devices']:
File "/usr/lib/python2.6/site-packages/zenoss-0.6.2-py2.6.egg/zenoss.py", line 90, in get_devices
data=[{'uid': device_class, 'params': {}, 'limit': limit}])
File "/usr/lib/python2.6/site-packages/zenoss-0.6.2-py2.6.egg/zenoss.py", line 68, in router_request
return json.loads(response.content.decode("utf-8"))['result']
File "/usr/lib64/python2.6/json/__init.py", line 307, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.6/json/decoder.py", line 338, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
RPS and version installed
Product: zenoss-resmgr-4.2.4 (id = zenoss-resmgr-4.2.4)
Home: /opt/zenoss
Revision: 863
Upgrading: None
Minimum: 863
Updated On: Thu Mar 10 09:06:40 2016
Would really like to use your package since it looks super useful. Any idea what this means?
Thanks
Ed
it woud be nice to set prodState as "maintenance" instead of having to guess the int value for that
Hi I would like to get the raw RRD Data as an input to my nvd3 visualisation.
I used the _rrd_request method but it returns only one value instead of retuning a time series values. Can some one point me on the right direction?. Is there any other method available?
We have a functional Zenoss 5.1.5 installation... I have been trying to get even a basic device list out of this module, but it's not working at all...
from getpass import getpass
from zenoss import Zenoss
password = getpass('Zenoss password for mpenning: ')
zz = Zenoss('https://zenoss.mycompany.local/', 'mpenning', password,
ssl_verify=False)
print zz.get_devices('/zport/dmd/Devices/Network/Switch/')
Running this with valid credentials returns nothing... I just get:
ValueError: No JSON object could be decoded
I know there were some REST API changes between Zenoss4 and Zenoss5... was this module only coded and tested against Zenoss4?
Hey!
there are several files in git which are missing in the tarball released on PyPI: most importantly LICENSE.txt, but then also tests, examples and maybe README.md and requirements.txt would be helpful.
the absence of the license file, and the fact the license is not explicitly stated anywhere in the pypi tarball, makes it a rather important bug.
thanks for considering
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.