-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added php-fpm_exporter binary and entrypoint script
- Loading branch information
1 parent
0f40a79
commit e54287b
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env sh | ||
set -euo pipefail | ||
|
||
#/ Usage: PHP_FPM_EXPORTER_ENABLED=true ./bay-php-fpm_exporter.sh | ||
#/ Options: | ||
#/ --help: Display this help message | ||
usage() { grep '^#/' "$0" | cut -c4- ; exit 0 ; } | ||
expr "$*" : ".*--help" > /dev/null && usage | ||
|
||
echoerr() { printf "%s\n" "$*" >&2 ; } | ||
info() { echoerr "[INFO] $*" ; } | ||
warning() { echoerr "[WARNING] $*" ; } | ||
error() { echoerr "[ERROR] $*" ; } | ||
fatal() { echoerr "[FATAL] $*" ; exit 1 ; } | ||
|
||
if [ "${PHP_FPM_EXPORTER_ENABLED:-false}" = "true" ]; then | ||
info starting php-fpm_exporter metrics server | ||
php-fpm_exporter server & | ||
else | ||
info php-fpm_exporter metrics server disabled | ||
fi |