jasonmcintosh / rabbitmq-zabbix

Zabbix RabbitMQ Configuration
Apache License 2.0
251 stars 168 forks source link

value of key rabbitmq[server,partitions] is always 0 #85

Closed ansemz closed 6 years ago

ansemz commented 6 years ago

Expression of trigger named "RabbitMQ Cluster partition detected" is {Template App RabbitMQ v3:rabbitmq[server,partitions].regexp([]|^\s*$)}=0. So i always get a problem. I test the script manually,api.py cannot get the correct value. it should be [], not a number. $ ./api.py ..... --check=server --metric=partitions. Please fix it. Thanks

jasonmcintosh commented 6 years ago

Note though that there's a regexp in there. It looks for [] and returns 0 if it found literally []. See https://www.zabbix.com/documentation/3.0/manual/regular_expressions

The api SHOULD return [] if it doesn't detect any partitions. Possible issues though could be character encoding, failure to run the command, etc. If thoug the api.py returns [] then it's doing exactly as it should. It also allows a blank string... see for an explanation of the second regex block (https://stackoverflow.com/questions/3012788/how-to-check-if-a-line-is-blank-using-regex).

jasonmcintosh commented 6 years ago

Also https://www.zabbix.com/documentation/3.0/manual/regular_expressions