Skip to content

Commit cdca570

Browse files
authored
Merge pull request galexrt#7 from mje-nz/handle-other-scripts-better
Better support for running other scripts
2 parents e8bd9e2 + 9a0f1a9 commit cdca570

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ This docker image contains the [prometheus-community/node-exporter-textfile-coll
1818

1919
## Usage
2020

21-
**This Docker image needs to be run in privileged mode for most of the scripts in the `prometheus-community/node-exporter-textfile-collector-scripts` repository, e.g., for `smartctl.sh` it is needed to be able to collect the SMART values.**
21+
**This Docker image needs to be run in privileged mode for most of the scripts in the `prometheus-community/node-exporter-textfile-collector-scripts` repository, e.g., for `smartmon.sh` it is needed to be able to collect the SMART values.**
2222

23-
The entrypoint script is putting the output into the directory `/var/lib/node_exporter` by default, filename `smartmon.prom`.
23+
The entrypoint script is putting the output into the directory `/var/lib/node_exporter`, by default filename named after which script is running.
2424

2525
### Variables
2626

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ if [ -n "$DEBUG" ]; then
88
fi
99

1010
SCRIPT="${SCRIPT:-smartmon.sh}"
11-
OUTPUT_FILENAME="${OUTPUT_FILENAME:-smartmon}"
11+
OUTPUT_FILENAME="${OUTPUT_FILENAME:-${SCRIPT%.*}}"
1212
INTERVAL="${INTERVAL:-300}"
1313

1414
if [ ! -f "/scripts/${SCRIPT}" ]; then
1515
echo "Script ${SCRIPT} doesn't exist. Exiting 1"
1616
exit 1
1717
fi
1818

19-
echo "Starting smartmon.sh loop ..."
19+
echo "Starting ${SCRIPT} loop ..."
2020
while true; do
2121
"/scripts/${SCRIPT}" "${@}" | sponge "/var/lib/node_exporter/${OUTPUT_FILENAME}.prom"
2222
sleep "${INTERVAL}"

0 commit comments

Comments
 (0)