Closed ansemz closed 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).
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