64 위 CentOS 5.6 에서 Smokeping 의 설치, 중국어 지원, Master / Slave

필요 한 가방 은:
  • CGI-SpeedyCGI-2.22.tar.gz                      2f80df78874e3efa80f180923c4967a1
  • echoping-6.0.2.tar.gz                          991478532b56ab3b6f46ea9fa332626f
  • fping.tar.gz                                   d5e8be59e307cef76bc479e1684df705
  • smokeping-2.6.8.tar.gz                         14a968daab2d17a27d41600077e3e967

  • 선행 조건:
    rrdtool:http://blog.csdn.net/liv2005/article/details/7180438
    nginx:http://blog.csdn.net/liv2005/article/details/7181508
    우선 기본 도구 의 컴 파일 설 치 를 진행 합 니 다.
    tar -zxvf fping.tar.gz 
    cd fping-2.4b2_to/
    ./configure 
    make
    make install
    cd ..
    
    tar -zxvf CGI-SpeedyCGI-2.22.tar.gz 
    cd CGI-SpeedyCGI-2.22
    perl Makefile.PL
    make
    make install
    cd ..
    
    tar -zxvf echoping-6.0.2.tar.gz 
    cd echoping-6.0.2
    ./configure 
    make
    make install
    cd ..
    
    tar -zxvf smokeping-2.6.8.tar.gz 
    cd smokeping-2.6.8
    ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
    cp -rf /usr/local/rrdtool/lib/perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/5.8.8/
    ./configure --prefix=/usr/local/smokeping
    LC_ALL=
    /usr/bin/gmake install

    smokeping 을 설정 할 때 perl 구성 요소 가 Failed 인 경우 설치 하려 고 시도 하고 perl - MRRDs - le 'print q (ok!)' 와 유사 한 문구 로 확인 하면 됩 니 다.
    perl -MCPAN -e 'install Time::HiRes'   
    위의 문장 과 유사 한 자동 업그레이드 모듈 을 사용 할 수 있 습 니 다. 
    / / = = = = = = = = = = = = 설치 완료 = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    그리고 배치 와 수정 작업 을 하 러 왔 습 니 다. 사실 특별한 것 은 없습니다.
      bin  ,  smokeping   smokeping_cgi  
       :         use lib qw(); # PERL5LIB
       :         use lib qw(/usr/local/rrdtool/lib/perl);
      htdocs  
    mv smokeping.fcgi.dist smokeping.fcgi
      etc  
    cp config.dist config
    vim config
      binary = /usr/local/sbin/fping
    
    
    Targets            ,  Targets,   ...
    +localhost
    menu = localhost
    title = localhost
    ++localhost
    menu = localhost
    title = localhost
    host = localhost
    mkdir /usr/local/smokeping/data /usr/local/smokeping/var /usr/local/smokeping/cache
    
      smokeping log  ,         ,  !!
    touch /var/log/smokeping.log
    chown web.web /var/log/smokeping.log
    chown web.web /usr/local/smokeping -R
    chmod u+x /usr /usr/local/smokeping -R
    vi /usr/local/nginx/conf/nginx.conf
            nginx, cgi        :
    location ~ .*\.fcgi$ {
            root  /usr/local/smokeping/htdocs/;
            gzip off;
            fastcgi_pass  unix:/tmp/cgiwrap-dispatch.sock;
            fastcgi_index smokeping.fcgi;
            include fcgi.conf;
        }
    

    그리고 시동 을 걸 어 볼 수 있어 요.
      smokeping
    perl /usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log

    하지만 그림 은 영어... Smoke Ping 원생 은 중국 어 를 지원 하지 않 습 니 다. 이 건 머리 가 아 픕 니 다. 아래 방법 으로 수정 해 보 세 요.
    우선 rrdtool 에서 중국 어 를 표시 하 는 문제 입 니 다.
    rrdtool 1.4.3 이후 에는 지원 되 지 않 는 것 같 습 니 다. "- font TITLE: 8: simsun. ttc" 라 는 방식 입 니 다.
    rrdtool 1.4.5         :
    
     rrdtool            
    sed -i 's/setlocale(LC_NUMERIC, "C")/setlocale(LC_ALL, "zh_CN.gb2312")/g' src/rrd_graph.c
    
       setlocale(LC_NUMERIC, "C"),  setlocale(LC_ALL, "zh_CN.gb2312")
    
    make
    
    mv ./src/rrdtool /usr/local/rrdtool/bin/rrdtool 
    
       windows C:\WINDOWS\Fonts\simsun.ttc   /usr/share/fonts/chinese/TrueType/   ,rrdtool      
    
    cp C:\WINDOWS\Fonts\simsun.ttc C:\
             ,  /usr/share/fonts/chinese/TrueType/   

    현재 rrdtool 이 그린 그림 은 중국 어 를 지원 할 수 있 지만 Smokeping 자 체 를 설정 해 야 합 니 다.
    vi /usr/local/smokeping/etc/config
     *** Presentation *** ,     charset = gb2312

    이렇게 하면 중국어 트 리 디 렉 터 리 도 표시 할 수 있 고 rrdtool 이 그린 그림 에 중국 어 를 표시 할 수 있 습 니 다.
    //==========================================
    tips:
               ,          :
    
    vi lib/Smokeping.pm  1559      
        ,   smokeping.fcgi?target=_charts ,nginx   502 bad gate,       “upstream closed prematurely FastCGI stdout while reading response header from upstream”,      ,   stderr      ?
    1559 #                        warn "Warning: Dropping $chart/$path from sortercache
    ";
           "median RTT from      ",    “display_name =        ”,  “display_name =      ”
    
      :
         ,  --debug    ,     ,    perl      
    perl -MCPAN -e 'install Time::HiRes' 
                     

    //==========================================
    Master / Slave
    이 건 분명히 Smokeping 이 NB 라 는 설정 인 데...
    1. Slave 에 nginx 나 apache 같은 것 은 필요 없습니다....................................................................................
    2. Slave 에 서 는 설정 이 필요 없습니다. Slave 의 / usr / local / smokeping / etc 아래 에 파일 을 만 듭 니 다: slave secret. txt, 그 안에 '당신 의 Slave 비밀번호' 라 는 줄 을 써 야 합 니 다.
    3. Slave 에서 실행: chown web.web /usr/local/smokeping -R; chmod u+x /usr /usr/local/smokeping -R;chmod 600 /usr/local/smokeping/etc/slave_secret.txt
    4. Master 에 etc / smokeping secrets. dist 파일 에 다음 과 같은 내용 을 기록 합 니 다. "당신 의 Slave 이름: 당신 의 Slave 비밀번호".
    5. Master 에서 etc / config 수정
    *** Slaves ***
    secrets=/usr/local/smokeping/etc/smokeping_secrets.dist
    +  Slave  
    display_name=  Slave  
    color=0000ff
    
    slaves =   Slave  
    

    6. Master 에서 실행: chmod 600 / usr / local / smokeping / etc / smokeping secrets. dist
    7. Slave 에서 smokeping 프로 세 스 시작: / usr / local / smokeping / bin / smokeping -- master - url = http: / / Master 주소 / smokeping / smokeping / fcgi -- cache - dir = / usr / local / smokeping / cache / -- shared - secret = / usr / local / smokeping / etc / slave secret. txt
    끝 났 습 니 다. 정상 적 인 상황 에서 조금 만 기다 리 면 Master 의 data 디 렉 터 리 에서 새로운 rrd 파일 을 발견 할 수 있 습 니 다. 그것 이 바로 Slave 에서 온 데이터 입 니 다.
    메모: 또한 주의해 야 할 것 은 master 에서 'smokeping' 프로 세 스 를 시작 하 는 것 과 nginx 프로 세 스 를 시작 하 는 사용 자 는 일치 해 야 한 다 는 것 입 니 다. rrd 파일 은 'smokeping' 프로 세 스 로 만 들 어 졌 고 데이터 의 update 는 'smokeping. fcgi' 이기 때 문 입 니 다."진행 되 는 것 은 nginx 사용자 입 니 다. 일치 하지 않 으 면 rrd 파일 이 업데이트 되 지 않 는 상황 이 발생 할 수 있 습 니 다. 이 상황 은 slave 호스트 에서 debug 를 진행 하 더 라 도 알 수 없습니다. 구체 적 인 현상 은 페이지 에서 master 의 그림 을 보고 데이터 가 나타 나 는 것 입 니 다. 그러나 slave 의 그림 은 항상 비어 있 습 니 다. 데 이 터 는" nan "입 니 다.
    smokeping 을 시작 할 때 LC ALL 에 대한 알림 이 있 으 면 lib / Smokeping. pm 에서 if (setlocale (LC NUMERIC, ") ne" C ") {.

    좋은 웹페이지 즐겨찾기