Giter Site home page Giter Site logo

Comments (11)

resmo avatar resmo commented on May 26, 2024

Hi

I am pretty sure I tested it with 2.2, so this should work with 2.4 too. Could you check you are using the 'right' zabbix python module?

Seems there are 2 with similar API. pyzabbix and zabbix_api. In the module the requirement is specified for zabbix_api. Please test this one first with an up to date version. But in my opinion pyzabbix should be used, it seems maintained and was updated recently.

Cloud you please test again with this infos?

from ansible-modules-extras.

nicolas-g avatar nicolas-g commented on May 26, 2024

Hi @resmo ,

The Ansible zabbix_maintenance module needs the zabbix-api install, if I remove zabbix-api and install pyzabbix I get :

msg: Missing requried zabbix-api module (check docs or install with: pip install zabbix-api)

By using zabbix-api I get the error :

msg: Failed to connect to Zabbix server: (u'Error -32602: Invalid params., Incorrect method "user.authenticate". while sending {"params": {"password": "zabbixpassword", "user": "zabbixuser"}, "jsonrpc": "2.0", "method": "user.authenticate", "auth": "", "id": 0}', -32602)

pyzabbix version :

pip show pyzabbix
---
Name: pyzabbix
Version: 0.7.2
Location: /usr/lib/python2.6/site-packages
Requires: requests

zabbix-api version

pip show zabbix-api
---
Name: zabbix-api
Version: 1.0
Location: /usr/lib/python2.6/site-packages
Requires:

Are you sure did you try with version 2.2 ? I found in the documentation it's mentioned the user.authenticate method is official deprecated (https://www.zabbix.com/documentation/2.0/manual/appendix/api/user/authenticate) and user.login should be used, I coulnd't find any reference for user.authenticate in documentation version 2.2 or 2.4 ...

from ansible-modules-extras.

nicolas-g avatar nicolas-g commented on May 26, 2024

How can I check what's the latest version of zabbix-api available ? Does anyone knows the home page of the project module ?

According to https://github.com/gnetsman/zabbix_api , it only supports Zabbix version 1.8 and 2.0 :(

from ansible-modules-extras.

galindro avatar galindro commented on May 26, 2024

@nicolas-g , I've a solution for this, but is BIZARRE. I'll try to explain:

1 - First execute this command:

$ sudo pip search zabbix

It will return a list of packages related to zabbix. In my case, it returned this list:

ludolph-zabbix            - Ludolph: Zabbix API plugin
zm                        - Zabbix management command-line client
zabbix-api-erigones       - Zabbix API Python Library
zabbix-client             - Zabbix API wrapper
zabbixcli                 - Tool for manage zabbix templates as YAML files.
zbx-statsd                - Clone of Etsy's statsd and Steve Ivy's py-statsd designed to work with Zabbix (http://www.zabbix.com/).
pyzabbix                  - Zabbix API Python interface
graphite-to-zabbix        - This tool allow handle alerts based on graphite metrics. It works as a proxy between graphite and zabbix. It use graphite as data source and zabbix as an
                            alerting system.
py-zabbix                 - Python modules for work with zabbix.
ztc                       - Zabbix Template Collection
docker-zabbix-sender      - Push Docker containers statistics to Zabbix efficiently
zabbixapi                 - a tool to communicate to zabbix
zabbix-powerline-status   - Zabbix powerline extension to show current triggers
dbaas_zabbix              - A Zabbix Integration for DBaaS.
zems                      - ZEMS (Zabbix Extended Monitoring Scripts) is a tool to retrieve all sorts of metrics from applications and deliver it to Zabbix in a generic way.
blackbird                 - Daemon that monitor each middleware by using ZABBIX-SENDER
zbx-dashboard             - Simple Django applicattion that provides an alternative to the Zabbix screens.
zabbix-api-gnetsman       - Zabbix API scripts for creation and deletion hosts
sentry-zabbix             - A Sentry extension which send errors stats to Zabbix
zabbix-api                - Zabbix API
  INSTALLED: 1.0
  LATEST:    0.4
zstat                     - A set of metrics to be sent to the Zabbix monitoring system
zbxsend                   - Module used to send metrics to Zabbix.

If you see, I've the zabbix-api 1.0 installed. Now the bizarre situation: the latest package is 0.4! So, I decide to remove and install it again:

$ sudo pip uninstall zabbix-api
Uninstalling zabbix-api:
  /usr/local/lib/python2.7/dist-packages/setup.py
  /usr/local/lib/python2.7/dist-packages/setup.pyc
  /usr/local/lib/python2.7/dist-packages/zabbix_api-1.0.egg-info
  /usr/local/lib/python2.7/dist-packages/zabbix_api.py
  /usr/local/lib/python2.7/dist-packages/zabbix_api.pyc
  /usr/local/lib/python2.7/dist-packages/zabbix_credentials.py
  /usr/local/lib/python2.7/dist-packages/zabbix_credentials.pyc
  /usr/local/lib/python2.7/dist-packages/zabbix_host_add.py
  /usr/local/lib/python2.7/dist-packages/zabbix_host_add.pyc
  /usr/local/lib/python2.7/dist-packages/zabbix_host_del.py
  /usr/local/lib/python2.7/dist-packages/zabbix_host_del.pyc
  /usr/local/lib/python2.7/dist-packages/zabbix_methods.py
  /usr/local/lib/python2.7/dist-packages/zabbix_methods.pyc
Proceed (y/n)? y
  Successfully uninstalled zabbix-api

$ sudo pip search zabbix
ludolph-zabbix            - Ludolph: Zabbix API plugin
zm                        - Zabbix management command-line client
zabbix-api-erigones       - Zabbix API Python Library
zabbix-client             - Zabbix API wrapper
zabbixcli                 - Tool for manage zabbix templates as YAML files.
zbx-statsd                - Clone of Etsy's statsd and Steve Ivy's py-statsd designed to work with Zabbix (http://www.zabbix.com/).
pyzabbix                  - Zabbix API Python interface
graphite-to-zabbix        - This tool allow handle alerts based on graphite metrics. It works as a proxy between graphite and zabbix. It use graphite as data source and zabbix as an
                            alerting system.
py-zabbix                 - Python modules for work with zabbix.
ztc                       - Zabbix Template Collection
docker-zabbix-sender      - Push Docker containers statistics to Zabbix efficiently
zabbixapi                 - a tool to communicate to zabbix
zabbix-powerline-status   - Zabbix powerline extension to show current triggers
dbaas_zabbix              - A Zabbix Integration for DBaaS.
zems                      - ZEMS (Zabbix Extended Monitoring Scripts) is a tool to retrieve all sorts of metrics from applications and deliver it to Zabbix in a generic way.
blackbird                 - Daemon that monitor each middleware by using ZABBIX-SENDER
zbx-dashboard             - Simple Django applicattion that provides an alternative to the Zabbix screens.
zabbix-api-gnetsman       - Zabbix API scripts for creation and deletion hosts
sentry-zabbix             - A Sentry extension which send errors stats to Zabbix
zabbix-api                - Zabbix API
zstat                     - A set of metrics to be sent to the Zabbix monitoring system
zbxsend                   - Module used to send metrics to Zabbix.

$ sudo pip install zabbix-api
Downloading/unpacking zabbix-api
  Downloading zabbix-api-0.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/zabbix-api/setup.py) egg_info for package zabbix-api

Installing collected packages: zabbix-api
  Running setup.py install for zabbix-api

Successfully installed zabbix-api
Cleaning up...

Now the reported problem is solved. Maybe the package maintainer restarted his version control....

from ansible-modules-extras.

resmo avatar resmo commented on May 26, 2024

that explains everything. I was not able to reproduce. And now I see why.

from ansible-modules-extras.

galindro avatar galindro commented on May 26, 2024

@resmo . The hard part is to simulate this. I don't know how to install the version 1.0.0 (I don't know how this was installed on my desktop). But, I think this could be considered a solution for this case.

from ansible-modules-extras.

resmo avatar resmo commented on May 26, 2024

@galindro this is IMHO not ansible's business. Maybe a note in the zabbix modules would be good to inform users about this.

from ansible-modules-extras.

galindro avatar galindro commented on May 26, 2024

Agree @resmo. Could you please put this note in zabbix module?

from ansible-modules-extras.

resmo avatar resmo commented on May 26, 2024

yes, I'll take care of this.

from ansible-modules-extras.

galindro avatar galindro commented on May 26, 2024

Thanks!

from ansible-modules-extras.

bcoca avatar bcoca commented on May 26, 2024

closing this then as the problem seems to have been a packaging mishap of the underlying library. We'll merge in resmo's doc update to hopefully prevent other users from hitting this frustrating wall.

from ansible-modules-extras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.