扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
本篇内容介绍了“如何利用zabbix监控php环境”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
网站设计制作过程拒绝使用模板建站;使用PHP+MYSQL原生开发可交付网站源代码;符合网站优化排名的后台管理系统;网站制作、成都网站建设收费合理;免费进行网站备案等企业网站建设一条龙服务.我们是一家持续稳定运营了10年的成都创新互联网站建设公司。vim /usr/local/php/etc/php-fpm.conf 添加 pm.status_path = /phpfpmstatus vim /usr/local/nginx/conf/nginx.conf 添加 server { listen 80; server_name localhost; location ~ ^/(phpfpmstatus)$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; } } vim /usr/local/zabbix/etc/zabbix_agentd.conf UnsafeUserParameters=1 UserParameter=phpfpm.status.pool,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status pool UserParameter=phpfpm.status.process.manager,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status process_manager UserParameter=phpfpm.status.start.since,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status start_since UserParameter=phpfpm.status.accepted.conn,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status accepted_conn UserParameter=phpfpm.status.listen.queue,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status listen_queue UserParameter=phpfpm.status.max.listen.queue,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status max_listen_queue UserParameter=phpfpm.status.listen.queue.len,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status listen_queue_len UserParameter=phpfpm.status.idle.processes,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status idle_processes UserParameter=phpfpm.status.active.processes,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status active_processes UserParameter=phpfpm.status.total.processes,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status total_processes UserParameter=phpfpm.status.max.active.processes,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status max_active_processes UserParameter=phpfpm.status.max.children.reached,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status max_children_reached vim /usr/local/zabbix/etc/scripts/monitor_phpfpm_status #!/bin/bash source /etc/bashrc >/dev/null 2>&1 source /etc/profile >/dev/null 2>&1 LOG_FILE=/tmp/phpfpmstatus.log curl http://127.0.0.1/phpfpmstatus >${LOG_FILE} pool(){ awk '/pool/ {print $NF}' ${LOG_FILE} } process_manager() { awk '/process manager/ {print $NF}' ${LOG_FILE} } start_since(){ awk '/start since:/ {print $NF}' ${LOG_FILE} } accepted_conn(){ awk '/accepted conn:/ {print $NF}' ${LOG_FILE} } listen_queue(){ awk '/listen queue:/ {print $NF}' ${LOG_FILE} } max_listen_queue(){ awk '/max listen queue:/ {print $NF}' ${LOG_FILE} } listen_queue_len(){ awk '/listen queue len:/ {print $NF}' ${LOG_FILE} } idle_processes(){ awk '/idle processes:/ {print $NF}' ${LOG_FILE} } active_processes(){ awk '/active processes:/ {print $NF}' ${LOG_FILE} } total_processes(){ awk '/total processes:/ {print $NF}' ${LOG_FILE} } max_active_processes(){ awk '/max active processes:/ {print $NF}' ${LOG_FILE} } max_children_reached(){ awk '/max children reached:/ {print $NF}' ${LOG_FILE} } case "$1" in pool) pool ;; process_manager) process_manager ;; start_since) start_since ;; accepted_conn) accepted_conn ;; listen_queue) listen_queue ;; max_listen_queue) max_listen_queue ;; listen_queue_len) listen_queue_len ;; idle_processes) idle_processes ;; active_processes) active_processes ;; total_processes) total_processes ;; max_active_processes) max_active_processes ;; max_children_reached) max_children_reached ;; *) echo "Usage: $0 {pool|process_manager|start_since|accepted_conn|listen_queue|max_listen_queue|listen_queue_len|idle_processes|active _processes|total_processes|max_active_processes|max_children_reached}" esac chmod 755 /usr/local/zabbix/etc/scripts/monitor_phpfpm_status 最后重启nginx php-fpm 然后导入php-fpm模块,关联到相应主机“如何利用zabbix监控php环境”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流