elasticsearch_exporter/files/elasticsearch_exporter.in

43 lines
1.6 KiB
Plaintext
Raw Normal View History

2021-12-23 11:58:10 +01:00
#!/bin/sh
# $FreeBSD: head/sysutils/elasticsearch_exporter/files/elasticsearchg_exporter.in 529909 2020-03-30 19:18:03Z decke $
#
# PROVIDE: elasticsearch_exporter
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# elasticsearch_exporter_enable (bool): Set to "YES" to enable elasticsearchg_exporter.
# (default: "NO")
#
# elasticsearch_exporter_listen (str): Exporter listening address
# (default: ":9114")
#
# elasticsearch_exporter_endpoint (str): Protocol, host and port on which elasticsearch
# listen
# (default: "http://localhost:9200")
#
# elasticsearch_exporter_log_level (str): Only log messages with the given severity
# or above. [debug,info,warn,error]
# (default: "info")
#
. /etc/rc.subr
name=elasticsearch_exporter
rcvar=elasticsearch_exporter_enable
load_rc_config $name
: ${elasticsearch_exporter_enable="NO"}
: ${elasticsearch_exporter_listen=":9114"}
: ${elasticsearch_exporter_endpoint="http://localhost:9200"}
: ${elasticsearch_exporter_log_level="info"}
: ${elasticsearch_exporter_pidfile:="/var/run/elasticsearch_exporter.pid"}
: ${elasticsearch_exporter_user:="prometheus"}
command="/usr/local/bin/elasticsearch_exporter"
command_args="--es.uri=\${elasticsearch_exporter_endpoint} --web.listen-address=\${elasticsearch_exporter_listen} --log.level=\${elasticsearch_exporter_log_level}"
2021-12-23 11:58:10 +01:00
start_cmd="/usr/sbin/daemon -u ${elasticsearch_exporter_user} ${command} ${command_args}"
run_rc_command "$1"