ssh-exporter

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

Prometheus SSH Exporter

CI Status Go Report Card

This tool exposes metrics from remote hosts for prometheus by running commands remotely via SSH and regex-matching the stdout.

Note Storing credentials on a networked computer for another computer causes security implications.

Command line options

Usage of ./ssh-exporter:
  -config.file string
    	Configuration file (default "ssh-exporter.yml")
  -log.level string
    	Valid levels: [debug, info, warn, error, fatal] (default "info")
  -version
    	Print version and exit
  -web.listen-address string
    	Address to listen on (default "[::]:9342")
  -web.telemetry-path string
    	Path under which to expose metrics (default "/metrics")

Example configuration

---

hosts:
  example.com:
    username: monitoring
    password: example
    commands:
      - command: uptime
        debug: true  # displays all stdout read from remote host - set log.level to debug!
        metrics:
          load_avg_1min:
            help: Load average last 1 min 
            regex: "load average:\\s+(\\d+\\.\\d+)"
            labels:
              example: bar 
          load_avg_5min:
            regex: "load average:\\s+\\d+\\.\\d+,\\s+(\\d+\\.\\d+)"

results in the following metrics being reported

load_avg_1min{command="uptime",example="bar",target="example.com"} 23
load_avg_5min{command="uptime",target="example.com"} 42
ssh_exporter_up{target="example.com"} 1

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL