q1x / zabbix-gnomes

Various scripts to automate tasks in Zabbix
Other
179 stars 94 forks source link

LogIn with API #10

Open steevivo opened 5 years ago

steevivo commented 5 years ago

Hi,

Since few days , I have a strange error with login API : Traceback (most recent call last): File "./zhostfinder.py", line 114, in zapi.login(username, password) TypeError: 'ZabbixAPIObjectClass' object is not callable

Any Ideas ? Thx

steevivo commented 5 years ago

It's ok now

q1x commented 5 years ago

Hi Stephane,

Can you share what the problem was?

steevivo commented 5 years ago

Hi Raymond,

In fact I think this is not a good way but for my test I modify this line :

# Login to the Zabbix API
zapi.login(username, password)

By this 
#zapi.login(username, password)

And it's running.... I use zabbix 4.2.1 and I don't know if it's an API problem or not

q1x commented 5 years ago

Hi Stephane,

I just checked on a fresh Centos7 install with Zabbix 4.0.9, no issues there as far as I can see right now. Did you use a configuration file or did you pass api parameters on the cli as arguments?

Regards,

Raymond

steevivo commented 5 years ago

Raymond , Yes I use it with .zbx.conf , this is why I have the message I think so , sorry about that

Regards Stephane

q1x commented 5 years ago

Ok, is this with all scripts or just with a specific one?

steevivo commented 5 years ago

For All scripts

q1x commented 5 years ago

which version of pyzabbix are you using?

steevivo commented 5 years ago

pyzabbix 0.7.5

herdir commented 2 years ago

Same issue with pyzabbix Version: 1.0.0 using Python 2.7.18

Traceback (most recent call last): File "./zhostupdater.py", line 126, in <module> zapi.login(username, password) TypeError: 'ZabbixAPIObjectClass' object is not callable

Same issue using Python 3.9.2 and pyzabbix Version: 1.0.0