Add --config flag to __prometheus_alertmanager
This commit is contained in:
parent
6957edfc1e
commit
ead3a3637c
2 changed files with 23 additions and 8 deletions
|
@ -3,17 +3,31 @@
|
|||
os="$(cat "${__global:?}/explorer/os")"
|
||||
case "$os" in
|
||||
alpine)
|
||||
__package blackbox_exporter
|
||||
require="__package/blackbox_exporter" __start_on_boot \
|
||||
blackbox_exporter
|
||||
require="__package/blackbox_exporter" __service \
|
||||
blackbox_exporter --action start
|
||||
;;
|
||||
debian|ubuntu)
|
||||
__package prometheus-blackbox-exporter
|
||||
config=/etc/blackbox_exporter/blackbox.yml
|
||||
package=blackbox_exporter
|
||||
service="$package"
|
||||
;;
|
||||
*)
|
||||
echo "This type does not supper $os. Exiting." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Install software.
|
||||
__package "$package"
|
||||
require="__package/$package" __start_on_boot "$service"
|
||||
require="__package/$package" __service "$service" --action start
|
||||
|
||||
if [ -f "${__object:?}/parameter/config" ]; then
|
||||
if [ "$(cat "${__object:?}/parameter/config")" = "-" ]; then
|
||||
user_config="${__object:?}/stdin"
|
||||
else
|
||||
user_config="${__object:?}/parameter/config"
|
||||
fi
|
||||
|
||||
require="__package/$package" __file "$config" \
|
||||
--source "$user_config" \
|
||||
--mode 0644 \
|
||||
--owner root \
|
||||
--onchange "service $service restart"
|
||||
fi
|
||||
|
|
1
type/__prometheus_blackbox_exporter/parameter/optional
Normal file
1
type/__prometheus_blackbox_exporter/parameter/optional
Normal file
|
@ -0,0 +1 @@
|
|||
config
|
Reference in a new issue