Ad Widget

Collapse

question on "zabbix-ldap-sync"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kovas
    Member
    • Dec 2012
    • 39

    #1

    question on "zabbix-ldap-sync"

    Hi,

    I am new to linux.

    I have downloaded zabbix-ldap-sync and properly configured zabbix-ldap.conf file.

    I successfully installed pyzabbix:
    sudo pip install pyzabbix

    But if I execute:
    ./zabbix-ldap-sync -f zabbix-ldap.conf

    I get:
    ImportError: No module named 'pyzabbix'

    Any suggestions?
    Many thanks
    k
  • kovas
    Member
    • Dec 2012
    • 39

    #2
    If I execute:
    source venv/bin/activate
    ./zabbix-ldap-sync -f zabbix-ldap.conf

    I get:
    2018-06-12 11:16:30,417 - INFO - JSON-RPC Server Endpoint: http://1.1.1.1/zabbix/api_jsonrpc.php
    2018-06-12 11:16:30,417 - INFO - JSON-RPC Server Endpoint: http://1.1.1.1/zabbix/api_jsonrpc.php
    2018-06-12 11:16:30,417 - INFO - JSON-RPC Server Endpoint: http://1.1.1.1/zabbix/api_jsonrpc.php
    2018-06-12 11:17:01,521 - INFO - Connected to Zabbix API Version 3.2.5
    2018-06-12 11:17:01,521 - INFO - Connected to Zabbix API Version 3.2.5
    Traceback (most recent call last):
    File "./zabbix-ldap-sync", line 90, in <module>
    main()
    File "./zabbix-ldap-sync", line 87, in main
    zabbix_conn.sync_users()
    File "/home/user/zabbix-ldap-sync/lib/zabbixconn.py", line 344, in sync_users
    ldap_users = self.ldap_conn.get_group_members(eachGroup)
    File "/home/user/zabbix-ldap-sync/lib/ldapconn.py", line 154, in get_group_members
    attrlist=attrlist)
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 852, in search_s
    return self.search_ext_s(base,scope,filterstr,attrlist,at trsonly,None,None,timeout=self.timeout)
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 846, in search_ext_s
    return self.result(msgid,all=1,timeout=timeout)[1]
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 738, in result
    resp_type, resp_data, resp_msgid = self.result2(msgid,all,timeout)
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 742, in result2
    resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all,timeout)
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 749, in result3
    resp_ctrl_classes=resp_ctrl_classes
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 756, in result4
    ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout, add_ctrls,add_intermediates,add_extop)
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 329, in _ldap_call
    reraise(exc_type, exc_value, exc_traceback)
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/compat.py", line 44, in reraise
    raise exc_value
    File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 313, in _ldap_call
    result = func(*args,**kwargs)
    ldap.REFERRAL: {'info': 'Referral:\nldap://company.local/CN=User1,OU=Users,DC=company,DC=local', 'desc': 'Referral'}

    Any advice would be great
    Many thanks
    Last edited by kovas; 12-06-2018, 15:32.

    Comment

    • kernbug
      Senior Member
      • Feb 2013
      • 330

      #3
      Originally posted by kovas
      Hi,

      I successfully installed pyzabbix:
      sudo pip install pyzabbix

      But if I execute:
      ./zabbix-ldap-sync -f zabbix-ldap.conf

      k
      Hello,

      Code:
      sudo ./zabbix-ldap-sync -f zabbix-ldap.conf
      or

      Code:
      pip install pyzabbix #without sudo
      Why this happens: by default pip modules are user-local.

      Originally posted by kovas
      File "/home/user/zabbix-ldap-sync/venv/lib/python3.5/site-packages/ldap/ldapobject.py", line 313, in _ldap_call
      result = func(*args,**kwargs)
      ldap.REFERRAL: {'info': '(<censored company name>)'}
      You need no check LDAP connection properties.
      Last edited by kernbug; 12-06-2018, 18:16.

      Comment

      • kovas
        Member
        • Dec 2012
        • 39

        #4
        thanks kernbug
        Last edited by kovas; 13-06-2018, 11:05.

        Comment

        • kovas
          Member
          • Dec 2012
          • 39

          #5
          thanks kernbug
          Last edited by kovas; 13-06-2018, 16:56.

          Comment

          Working...