美文网首页
zabbix监控php

zabbix监控php

作者: zwb_jianshu | 来源:发表于2019-08-07 19:33 被阅读0次

    一、开启监控页面

    vim /etc/php-fpm.d/www.conf
    pm.status_path = /php_status
    vim /etc/nginx/nginx.conf
    location /php_status { 
      fastcgi_pass 127.0.0.1:9000; 
      fastcgi_index index.php; 
      fastcgi_param SCRIPT_FILENAME html$fastcgi_script_name; 
      include fastcgi_params; 
    }
    systemctl restart php-fpm.service nginx.service
    
    image.png

    二、导入模板

    image.png image.png image.png

    三、准备zabbix的配置文件,并测试脚本

    mkdir /server/scripts
    vim /etc/zabbix/zabbix_agentd.d/fpm.conf
    UserParameter=php-fpm[*],/bin/bash /server/scripts/fpm.sh "$1" "$2"
    sh /server/scripts/fpm.sh "total processes" http://127.0.0.1/php_status
    systemctl restart zabbix-agent
    systemctl restart  nginx  php-fpm
    

    四、在zabbix-server上zabbix-get测试取值

    zabbix_get -s 10.0.0.12 -k php-fpm["total processes",http://127.0.0.1/php_status]
    

    五、链接模板

    image.png

    六、查看监控

    image.png

    相关文章

      网友评论

          本文标题:zabbix监控php

          本文链接:https://www.haomeiwen.com/subject/wfiadctx.html