Skip to content

CHICPRO

  • Life Log
  • Cycling Log
  • Photo Log
    • Portrait
    • Landscape
    • Flower
    • Etc
  • Coding Log
  • Information

netdata 에 php-fpm, mariadb 모니터링 추가

2018-10-19 by 편리

netdata 설치 후  php-fpm, mariadb 모니터링이 되지 않는다면 다음의 추가 작업이 필요하다. 설정 작업은 Ubuntu 16.04 환경을 기준으로 한다.

1. mariadb 모니터링 추가

위 이미지와 같이 mariadb(mysql) 서버의 모니터링 차트를 표시하기 위해서는 우선 python-mysqldb 패키지 설치가 필요하다.

sudo apt-get -y install python-mysqldb

다음으로 netdata 에서 mariadb 로 접속하기 위해 사용자를 추가해야 한다.

MariaDB [(none)]> create user 'netdata'@'localhost';
MariaDB [(none)]> grant usage on *.* to 'netdata'@'localhost';
MariaDB [(none)]> flush privileges;

netdata 를 재시작하면 이미지와 MySQL 차트가 표시된다.

2. php-fpm 모니터링 추가

php-fpm 모니터링은 php-fpm 에서 자체적으로 제공하는 /status 페이지를 이용한다.  netdata 에서 http://localhost/status 페이지로 접속해서 값을 확인할 수 있도록 설정을 추가해야 한다. 우선 php-fpm pool 설정 파일에서 ;pm.status_path = /status 항목의 ; 제거해서 주석을 해제한다. 다음으로 웹서버에 /status 페이지 접속을 위한 설정을 추가한다. nginx 기준 설정은 아래와 같다.

server {
    listen      80;
    server_name localhost;
    access_log  off;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    location /status {
        allow 127.0.0.1;
        #allow 1.2.3.4#your-ip;
        deny all;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        log_not_found off;
    }
}

nginx, php-fpm 재시작 후 curl http://localhost/status 명령 실행 후 아래의 결과가 표시되면 설정이 된 것이다.

pool:                 www
process manager:      dynamic
start time:           18/Oct/2018:17:13:41 +0900
start since:          65809
accepted conn:        254639
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       2
active processes:     1
total processes:      3
max active processes: 27
max children reached: 205
slow requests:        0

netdata 를 재시작하면 PHP-FPM 모니터링 차트가 표시된다.

참고자료 : https://docs.iredmail.org/integration.netdata.linux.html

Post navigation

Previous Post:

여러 대의 서버 모니터링을 위한 netdata 커스텀 대시보드

Next Post:

netdata 에 nginx 모니터링 추가

4 Commments

  1. 우성짱 says:
    2020-07-17 at 01:26

    음.. 이상하게 우분투 20.04에서는 MariaDB가 안되네요.

    나머지는 다 되네요. ㅎ 감사합니다.

    Reply
    1. 편리 says:
      2020-07-17 at 09:35

      그런가요? 요즘은 서버 관리할 일이 없어서 신경을 안쓰고 있었는데요.. 나중에 기회가 되면 한번 살펴봐야겠습니다.

      Reply
  2. 우성짱 says:
    2020-07-17 at 10:44

    요새는 서버리스 시대라서..

    이제 이런 모니터링 도구들도 없어질 듯 합니다. ㅎㅎ

    Reply
    1. 편리 says:
      2020-07-17 at 13:24

      그렇죠..
      그래도 SE에선 사용해야하기 때문에 사용성은 아직은 필요할 것 같습니다.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • SK 세븐모바일 유심 셀프교체
  • php 배열 연산에서 + 와 array_merge 의 차이
  • pcntl_fork 를 이용한 다중 프로세스 실행
  • 아이폰 단축어를 이용하여 주중 공휴일엔 알람 울리지 않게 하기
  • 구글 캘린더 전체일정 재동기화
  • OpenLiteSpeed 웹서버에 HTTP 인증 적용
  • OpenLiteSpeed 웹어드민 도메인 연결
  • WireGuard를 이용한 VPN 환경 구축
  • Ubuntu 22.04 서버에 OpenLiteSpeed 웹서버 세팅
  • 맥 vim 세팅

Recent Comments

  • 편리 on 업무관리용 그누보드 게시판 스킨
  • 임종섭 on 업무관리용 그누보드 게시판 스킨
  • 캐논 5D 펌웨어 | Dslr 펌웨어 업그레이드 방법 82 개의 베스트 답변 on 캐논 EOS 30D 펌웨어 Ver 1.0.6 , EOS 5D 펌웨어 Ver 1.1.1
  • Top 5 캐논 5D 펌웨어 Top 89 Best Answers on 캐논 EOS 30D 펌웨어 Ver 1.0.6 , EOS 5D 펌웨어 Ver 1.1.1
  • 편리 on 워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기
  • 임팀장 on 워드프레스 애니메이션 gif 파일을 mp4로 변환하여 출력하기
  • 편리 on Notepad++ NppFTP 플러그인 수동 설치
  • paul-j on Notepad++ NppFTP 플러그인 수동 설치
  • YS on Windows 10 iCloud 사진 저장 폴더 변경
  • 편리 on Docker를 이용한 Centos7 + httpd + php 5.4 개발환경 구축

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
© 2025 CHICPRO | Built using WordPress and SuperbThemes