2017-01-30 3 views
1

I가 프로 메테우스의 경고를 얻으려고 노력하고 실행하지만 경고를 정의 할 때, 항상 구문은 내가 프로 메테우스에게프로 메테우스 규칙 오류

./prometheus -config.file=prometheus.yml -alertmanager.url http://localhost:9093 
를 시작하는 데 사용하고 잘못된

명령임을 알려줍니다 해요 여기

내가 여기

prometheus, version 0.15.1 (branch: master, revision: 64349aa) 
    build user:  [email protected] 
    build date:  20150727-17:56:51 
    go version:  1.4.2 
INFO[0000] Loading configuration file prometheus.yml  file=main.go line=173 
ERRO[0000] Error loading rules, previous rule set restored: error parsing /home/ubuntu/alert.rules: Parse error at line 4, char 4: alert summary missing file=manager.go line=348 

가 alert.rule 파일

ALERT node_down 
    IF up == 0 
    FOR 5m 
    LABELS { 
    severity="critical" 
    } 
    ANNOTATIONS { 
     summary = "Instance {{$labels.instance}} down", 
     description = "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes." 
    } 
0123입니다 얻을 그 오류입니다

는 그리고 이것은 경고 주위에 약간 다른 문법을 가지고 프로 메테우스의 오히려 이전 버전의 내 prometheus.yml 파일

global: 
    scrape_interval:  15s 
    evaluation_interval: 15s 
'evaluation_interval'. 
rule_files: 
    - "/home/ubuntu/alert.rules" 

scrape_configs: 
    - job_name: 'prometheus' 
    target_groups: 
    - targets: ['localhost:9100','xxx.xxx.xxx.xxx:9100'] 

답변

2

입니다. 최신 버전을 사용해보십시오.

+0

그게 문제였습니다! 고맙습니다. 나는 0.15 버전을 사용하고 있었다. (그리고 왜 그런지 모르겠다.) 작업 한 사람은 1.5 –

+0

경고 규칙의 올바른 형식은 무엇입니까?를 참조하십시오. (https://github.com/prometheus/docs/issues/907) –