canonical / nrpe_exporter

A Prometheus exporter for generating metrics from commands executed by a running NRPE daemon.
Apache License 2.0
48 stars 18 forks source link

Allow multiple commands against targets #2

Closed arj22 closed 4 years ago

arj22 commented 6 years ago

Hello,

Is it possible to specify multiple commands against targets?

I have tried the following and it seems to fail. It would be easy to group all checks for targets in a job.

- job_name: 'nrpe'
    metrics_path: /export
    params:
      target: ['127.0.0.1:5666']
      command: ['check_load','check_users']
    static_configs:
      - targets:
        - 127.0.0.1:9275

Thanks.

brian-brazil commented 6 years ago

You can create a job per check.

yadavpravinb commented 2 years ago

@brian-brazil,@arj22 , Can you please give the format of how multiple commands will write in prometheus.yml file??? I didn't find the proper specific answer on the internet. I stuck on this point for the last 2 days. thanks in advance!!

simskij commented 2 years ago

@brian-brazil,@arj22 , Can you please give the format of how multiple commands will write in prometheus.yml file??? I didn't find the proper specific answer on the internet. I stuck on this point for the last 2 days. thanks in advance!!

scrape_configs:
  - job_name: nrpe_check_load
    metrics_path: /export
    params:
      command: [check_load]
    static_configs:
      - targets: 
        - 'example.com:5666'
  - job_name: nrpe_check_users
    metrics_path: /export
    params:
      command: [check_users]
    static_configs:
      - targets: 
        - 'example.com:5666'

as advised by Brian.