zabbix-gnomes icon indicating copy to clipboard operation
zabbix-gnomes copied to clipboard

LogIn with API

Open steevivo opened this issue 5 years ago • 10 comments

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 avatar Jun 22 '19 13:06 steevivo

It's ok now

steevivo avatar Jun 24 '19 21:06 steevivo

Hi Stephane,

Can you share what the problem was?

q1x avatar Jun 27 '19 05:06 q1x

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

steevivo avatar Jun 27 '19 10:06 steevivo

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

q1x avatar Jun 27 '19 11:06 q1x

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

Regards Stephane

steevivo avatar Jun 27 '19 12:06 steevivo

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

q1x avatar Jun 27 '19 12:06 q1x

For All scripts

steevivo avatar Jun 27 '19 17:06 steevivo

which version of pyzabbix are you using?

q1x avatar Jun 28 '19 11:06 q1x

pyzabbix 0.7.5

steevivo avatar Jun 28 '19 12:06 steevivo

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

herdir avatar May 17 '22 11:05 herdir