Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3644054
/opt/phpfpm_exporter/run.sh
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
dereckson
Oct 10 2024, 23:37
2024-10-10 23:37:10 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
/opt/phpfpm_exporter/run.sh
View Options
#!/bin/sh
# -------------------------------------------------------------
# Run php-fpm metrics exporter
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: BSD-2-Clause
# -------------------------------------------------------------
set
-e
# -------------------------------------------------------------
# Ensure user is root
#
# Note: POSIX shells don't always define $UID or $EUID.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# shellcheck disable=SC3028
if
[
"
${
EUID
:-$(
id -u
)
}
"
-ne
0
]
;
then
echo
"This command must be run as root."
>
&
2
exit
1
fi
# -------------------------------------------------------------
# Service configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PHP_FPM_SOCKETS_ROOT
=
/var/run/web
PHP_FPM_SOCKETS_PATTERN
=
"php-fpm.sock"
BIND_ADDRESS
=
"127.0.0.1:9253"
BIND_ADDRESS
=
"172.27.27.35:9253"
# -------------------------------------------------------------
# Run service
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SOCKET_PATHS
=
$(
find
"
$PHP_FPM_SOCKETS_ROOT
"
-type s -name
"
$PHP_FPM_SOCKETS_PATTERN
"
-print0
|
xargs -0 -n1
echo
--phpfpm.socket-paths
|
paste -sd
" "
-
)
# shellcheck disable=SC2086
echo
sudo -u web-admin phpfpm_exporter --web.listen-address
=
"
$BIND_ADDRESS
"
--phpfpm.status-path
=
"/php-fpm-status"
$SOCKET_PATHS
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2188340
Default Alt Text
/opt/phpfpm_exporter/run.sh (1 KB)
Attached To
Mode
P362 /opt/phpfpm_exporter/run.sh
Attached
Detach File
Event Timeline
Log In to Comment