Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"'bool' object has no attribute 'get'" error occurs in ZabbixSender.send() function #136

Open
valkyrie084 opened this issue Nov 13, 2020 · 2 comments

Comments

@valkyrie084
Copy link

Hello,

I found a problem and will report it.

Perhaps the conditional statement in the ZabbixSender._chunk_send() function on line 425 of pyzabbix/sender.py may be incorrect.

if response and response.get('response') != 'success':

If False is returned from ZabbixSender._get_response() function on line 422 of pyzabbix/sender.py, exception handling may not be executed.

Probably the correct one is as follows.

if not response or response.get('response') != 'success':

@adubkov
Copy link
Owner

adubkov commented Nov 13, 2020

Thanks. I have to look deeper into it, but it indeed looks like a bug, or at least something to improve.

Also not sure why logging has } character

logger.debug('Response error: %s}', response)
. I'm worry that somebody may use current log format in logstash or SIEMs already... have to be careful.

@valkyrie084
Copy link
Author

Thank you for your prompt reply.

Please investigate that.

Also not sure why logging has } character

logger.debug('Response error: %s}', response)

. I'm worry that somebody may use current log format in logstash or SIEMs already... have to be careful.

It's true, I didn't realize there was an error there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants