ssh_exporter icon indicating copy to clipboard operation
ssh_exporter copied to clipboard

text format parsing error: second TYPE line for metric name "ssh_exporter", or TYPE reported after samples

Open noizo opened this issue 7 years ago • 0 comments

Hi. I'm using current master build of ssh_exporter Prometheus is 1.7.1

ssh_exporter config:

version: v0
scripts:
  - name: bastion_toolbox
    script: echo success
    timeout: 1s
    pattern: success
    credentials:
    - host: 1.ssh.host
      port: "22"
      user: monitoring
      keyfile: ./bastion_check.pem
      scriptresult: ""
      scriptreturncode: 0
      scripterror: ""
      resultpatternmatch: 0
    parsedtimeout: 1s
    ignored: false
  - name: bastion_management
    script: echo success
    timeout: 1s
    pattern: success
    credentials:
    - host: 2.ssh.host
      port: "22"
      user: monitoring
      keyfile: ./bastion_check.pem
      scriptresult: ""
      scriptreturncode: 0
      scripterror: ""
      resultpatternmatch: 0
    parsedtimeout: 1s
    ignored: false

Prometheus config:

  - job_name: 'bastion_ssh_exporter_toolbox'
    static_configs:
      - targets: ['ssh_exporter:9428]
    metrics_path: /probe
    params:
      pattern: ['bastion_toolbox']
  
  - job_name: 'bastion_ssh_exporter_management'
    static_configs:
      - targets: ['ssh_exporter:9428']
    metrics_path: /probe
    params:
      pattern: ['bastion_management']

Prometheus gives me this output:

text format parsing error in line 5: second TYPE line for metric name "ssh_exporter", or TYPE reported after samples

Console output

# curl http://localhost:9428/probe?pattern=bastion
# HELP ssh_exporter_bastion_toolbox_exit_status Integer exit status of commands and metadata about the command's execution.
# TYPE ssh_exporter gauge
ssh_exporter_bastion_toolbox_exit_status{name="bastion_toolbox",host="1.ssh.host",user="monitoring",script="echo success",exit_status="0"} 0
# HELP ssh_exporter_bastion_toolbox_pattern_match Boolean match of regex on output of script of commands and metadata about the command's execution.
# TYPE ssh_exporter gauge
ssh_exporter_bastion_toolbox_pattern_match{name="bastion_toolbox",host="1.ssh-host",user="monitoring",script="echo success",regex="success"} 1
# HELP ssh_exporter_bastion_management_exit_status Integer exit status of commands and metadata about the command's execution.
# TYPE ssh_exporter gauge
ssh_exporter_bastion_management_exit_status{name="bastion_management",host="2.ssh.host",user="monitoring",script="echo success",exit_status="0"} 0
# HELP ssh_exporter_bastion_management_pattern_match Boolean match of regex on output of script of commands and metadata about the command's execution.
# TYPE ssh_exporter gauge
ssh_exporter_bastion_management_pattern_match{name="bastion_management",host="2.ssh.host",user="monitoring",script="echo success",regex="success"} 1

noizo avatar Dec 11 '18 08:12 noizo