rabbitmq-zabbix
rabbitmq-zabbix copied to clipboard
api.py output errors to Zabbix
Hey guys, sometimes api.py throws an error, which gets send to zabbix. For example:
Trigger: RabbitMQ Cluster partition detected
Trigger status: PROBLEM
Trigger severity: Average
Trigger URL:
Item values:
1. RabbitMQ Server Partitions (Jumplead - RabbitMQ:rabbitmq[server,partitions]): Traceback (most recent call last):
File "./api.py", line 212, in <module>
main()
File "./api.py", line 207, in main
print api.check_server(options.metric, options.node)
File "./api.py", line 150, in check_server
for nodeData in self.call
2. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
Unfortunately I know literally nothing about python. Is there some way this could be handed better? I'm guessing its some sort of timeout issue.
Yep - it's failing on the API call to the RabbitMQ server. PROBABLY should put an error handler in here that would catch it and return a failure situation vs. the string of the error.
Note, it COULD also be an error with the JSON or other parsing. But regardless SHOULD be caught and logged as an error, then the api return a meaningful message implying an error.