Sign inSign up

crivella1/docker-sh-exporter

By crivella1

Updated almost 3 years ago

Image
0

1.5K

crivella1/docker-sh-exporter repository overview

docker-sh-exporter

This container makes use of the --collector.textfile of node exporter to create a custom prometheus exporter for monitoring files inside a directory.

Typical use-case

Monitoring files timestamps/sizes in a mounted volume that is used for periodic backups

Instructions

By default all exporters of node_exporter but the textfile one are disabled. The docker command can be used to re-enable specific collectors on a case-by-case basis

Installation

docker pull crivella1/docker-sh-exporter

Build
docker build -t crivella1/docker-sh-exporter 
Run
NOTE: Path set to `BACKUP_DIR` variable and mounted volume should match

docker run --name sh-exporter -v HOST_MONITOR_DIR:MONITOR_DIR -v HOST_SCRIPT_DIR:/scripts -c HOST_COLLECT_DIR:COLLECT_DIR -p XXXXX:9781  -h docker-sh-exporter -t crivella1/docker-sh-exporter

Container ports

Container PortUsage
9781Ports used for node-exporter to serve the metrics

Variables

VariableValuesUsage
SCRIPT_DIR/scriptsLocation of the mounted volume containing cron scripts to be periodically executed inside the container
COLLECT_DIR/dataLocation inside the container of the data collection dirs where the .prom files produced by the scripts should be stored
MONITOR_DIR/backupsLocation of the mounted volume containing the files to be monitored
CRON_SCHEDULE*/15 * * * The schedule with which the cron scripts will be executed
SCRIPT_REGEX^.*\.sh\$Regex matching scripts inside $SCRIPT_DIR
RUN_SCRIPTS_ON_STARTUPNO[YES]Whether to execute the scripts once at container startup
EXTRA_INSTALLSPACE separated list of apt packages to be installed at container startup (eg if some custom scripts depends on packages that are not installed by default)

| NODE_EXPORTER_VERSION | 1.5.0 | The version of node_exporter that will be installed the first time the container is launched (Must be a number github release version number) | | NODE_EXPORTER_ARCH | linux-amd64 | The system architecture (decides which arch version of node_exporter is installed) | | NODE_EXPORTER_LISTEN_ADDRESS | 0.0.0.0 | The address from which node_exporter will listen to GET requests (0.0.0.0 == ALL) | | NODE_EXPORTER_LISTEN_PORT | 9781 | The port from which node_exporter will listen to GET requests |

Tag summary

Content type

Image

Digest

sha256:58a9c169e

Size

60.3 MB

Last updated

almost 3 years ago

docker pull crivella1/docker-sh-exporter