0

사용 : Telegraf v1.0.1 개발자 또는 나중에Telegraf - procstat 플러그인 inputs.procstat - 사용 명령 줄 패턴 또는 사용자 이름

Telegraf의 procstat 플러그인의 설명서 : https://github.com/influxdata/telegraf/tree/master/plugins/inputs/procstat

문서에서, 그것은 말합니다 :

procstat 플러그인은/proc 데이터를 사용하여 개별 프로세스에서 시스템 리소스 사용을 모니터링하는 데 사용할 수 있습니다.

플러그인은 PID와 프로세스 이름으로 프로세스를 태그 지정합니다.

프로세스는 PID 파일에 의해 실행 이름, 커맨드 라인 패턴 매칭에 의해 어느 특정하거나 자명하여 (실행 이름 PID를 획득하기 위해 제공되는 경우 Procstat 플러그인 pgrep을을 사용 순서 또는 우선 순위. 일 수있다.
/etc/telegraf/telegraf.d/my_custom_process_service-telegraf.conf 포함 :

[[inputs.procstat]] 
    exe = "." 
    prefix = "service_process" 

[[inputs.procstat]] 
    pid_file = "/var/run/jenkins/jenkins.pid" 
    prefix = "service_process" 

위의 구성 t 당 잘 작동

내 사용자 지정 설정 파일이 그는 구문입니다.

질문 :

문서는 exe, pid_file을 사용하는 방법에 대해 말한다, 그러나 그것은 command line pattern matching 또는 username에 의해를 사용하는 방법에 대한 예제를 제공하지 않습니다. 어떻게 사용하는지 알고 있다면 몇 가지 예를 얻을 수 있습니까? https://github.com/influxdata/telegraf/blob/master/plugins/inputs/procstat/procstat.go (

## Must specify one of: pid_file, exe, or pattern 
    ## PID file to monitor process 
    pid_file = "/var/run/nginx.pid" 

    ## executable name (ie, pgrep <exe>) 
    # exe = "nginx" 
    ## pattern as argument for pgrep (ie, pgrep -f <pattern>) 

    # pattern = "nginx" 
    ## user as argument for pgrep (ie, pgrep -u <user>) 
    # user = "nginx" 

    ## override for process_name 
    ## This is optional; default is sourced from /proc/<pid>/status 
    # process_name = "bar" 

    ## Field name prefix 
    prefix = "" 


    ## comment this out if you want raw cpu_time stats 
    fielddrop = ["cpu_time_*"] 

    ## This is optional; moves pid into a tag instead of a field 
    pid_tag = false 
+0

그것은 README에 아니었지만 난 소스 파일로 보았다 var sampleConfig = 변수에 따라 그것은 거기에 언급 한 것 : –

답변

3

은 소스 파일에이 정보를 발견.