Skip to content

Latest commit

 

History

History
83 lines (62 loc) · 3.05 KB

README.md

File metadata and controls

83 lines (62 loc) · 3.05 KB

sftp-exporter

Prometheus Exporter for SFTP server.

Build Status

Configurations

Configurations can be provided in various ways.

Command-line Flags

Prometheus Exporter for SFTP.

Usage:
  sftp-exporter [flags]
  sftp-exporter [command]

Available Commands:
  help        Help about any command
  version     Prints the current version

Flags:
      --bind-address string          exporter bind address (default "127.0.0.1")
  -c, --config-file string           exporter config file (default "sftp-exporter.yaml")
  -h, --help                         help for sftp-exporter
      --log-level string             log level [panic | fatal | error | warning | info | debug | trace] (default "info")
      --port int                     exporter port (default 8080)
      --sftp-host string             SFTP host (default "localhost")
      --sftp-key string              SFTP key (base64 encoded)
      --sftp-key-passphrase string   SFTP key passphrase
      --sftp-password string         SFTP password
      --sftp-paths strings           SFTP paths (default [/])
      --sftp-port int                SFTP port (default 22)
      --sftp-user string             SFTP user

Use "sftp-exporter [command] --help" for more information about a command.

Environment Variables

Configs can be passed using environment variables. For example:

$ SFTP_HOST=example.com SFTP_PORT=22 SFTP_USER=example SFTP_PASS=password ./sftp-exporter

Config File

Sample config file: sftp-exporter.yaml

By default sftp-exporter looks for a config file named sftp-exporter.yaml in the PWD. Custom config file can be provided using --config-file flag.

Order of precedence: Flags > Environment variables > Config file

Metrics

# HELP sftp_filesystem_free_space_bytes Free space in the filesystem containing the path
# TYPE sftp_filesystem_free_space_bytes gauge
sftp_filesystem_free_space_bytes{path="/upload1"} 7.370901504e+10
sftp_filesystem_free_space_bytes{path="/upload2"} 7.370901504e+10
# HELP sftp_filesystem_total_space_bytes Total space in the filesystem containing the path
# TYPE sftp_filesystem_total_space_bytes gauge
sftp_filesystem_total_space_bytes{path="/upload1"} 8.4281810944e+10
sftp_filesystem_total_space_bytes{path="/upload2"} 8.4281810944e+10
# HELP sftp_objects_available Number of objects in the path
# TYPE sftp_objects_available gauge
sftp_objects_available{path="/upload1"} 1
sftp_objects_available{path="/upload2"} 3
# HELP sftp_objects_total_size_bytes Total size of all the objects in the path
# TYPE sftp_objects_total_size_bytes gauge
sftp_objects_total_size_bytes{path="/upload1"} 312
sftp_objects_total_size_bytes{path="/upload2"} 2337
# HELP sftp_up Tells if exporter is able to connect to SFTP
# TYPE sftp_up gauge
sftp_up 1

Grafana Dashboard

Grafana Dashoard