Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 监控 > Zabbix > 正文

CentOS6.x下zabbix api与php的配置

时间:2016-05-27 21:15 来源:网络整理 作者:51ou.com 阅读:

因为api其实是发送了一个jason格式的post请求,手动使用curl来验证:
curl  -vvv -i -X POST -H 'Content-Type:application/json' -d

'{"params": {"templates": [{"templateid": "10117"}, {"templateid": "10132"}, {"templateid": "10133"}, {"templateid": "10134"},

{"templateid": "10135"}, {"templateid": "10136"}], "templateid": "10464"}, "jsonrpc": "2.0", "method": "template.update", "auth": "421a04b400e859834357b5681a586a5f", "id": "2"}'

http://zabbix.idc.vipshop.com/api_jsonrpc.php

返回500错误(即后端php处理时遇到错误导致),调整php的配置,把日志改成debug格式:

php-fpm.conf:

log_level = debug

在error log中发现如下错误:

[04-May-2014 14:04:32.115189] WARNING: pid 6270, fpm_request_check_timed_out(), line 271: [pool www] child 6294, script '/apps/svr/zabbix/wwwroot/api_jsonrpc.php' (request: "POST /api_jsonrpc.php") executing too slow (1.269946 sec), logging

[04-May-2014 14:04:32.115327] DEBUG: pid 6270, fpm_got_signal(), line 72: received SIGCHLD

[04-May-2014 14:04:32.115371] NOTICE: pid 6270, fpm_children_bury(), line 227: child 6294 stopped for tracing

[04-May-2014 14:04:32.115385] NOTICE: pid 6270, fpm_php_trace(), line 142: about to trace 6294

[04-May-2014 14:04:32.115835] NOTICE: pid 6270, fpm_php_trace(), line 170: finished trace of 6294

[04-May-2014 14:04:32.115874] DEBUG: pid 6270, fpm_event_loop(), line 409: event module triggered 1 events

[04-May-2014 14:04:35.318614] WARNING: pid 6270, fpm_stdio_child_said(), line 166: [pool www] child 6294 said into stderr: "NOTICE: sapi_cgi_log_message(), line 663: PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 512 bytes) in /apps/svr/zabbix/wwwroot/api/classes/CItem.php on line 1088"

[04-May-2014 14:04:35.318665] DEBUG: pid 6270, fpm_event_loop(), line 409: event module triggered 1 events

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《CentOS6.x下zabbix api与php的配置》技术文章,《CentOS6.x下zabbix api与php的配置》详细使用和说明,有时《CentOS6.x下zabbix api与php的配置》可能不完善、敬请谅解!如果《CentOS6.x下zabbix api与php的配置》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(1)
100%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片