This bug is a known issue: https://www.zabbix.com/documentation/4.0/manual/installation/known_issues#compatibility_issue_with_php_70
It could be useful to fix this bug for those who cannot update to php7.1 or later.
Steps to reproduce:
- Try to push a template with a web scenario and a trigger trough the API
- zabbix-frontend-php: 1:4.0.5-1+stretch
- php7.0-fpm: 7.0.33-0+deb9u3
Expected: Working API call
This issue seems to come from the web scenario items that are not properly generated because of a bug in php7.0.
Some unnecessary quotes are added in the item "key_" (if you push a template without trigger, the API call is ok but... you cannot assign the template to a host later).
The issue seems to be located in include/classes/api/managers/CHttpTestManager.php when the function createHttpTestItems is called.
The array httpTest in parameters looks like this :
But when it gets the "name" value, it ended up with additional quotes
A quick workaround in createHttpTestItems function seems to do the job:
Same issue as: