elasticsearch_exporter/files/elasticsearch_exporter.in

47 lines
1.8 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")
#
2022-04-01 13:47:07 +02:00
# elasticsearch_exporter_log_file (str): log messages to this file
# (default: "/var/log/elasticsearch_exporter.log")
#
2021-12-23 11:58:10 +01:00
. /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"}
2022-04-01 13:47:07 +02:00
: ${elasticsearch_exporter_log_file="/var/log/elasticsearch_exporter.log"}
2021-12-23 11:58:10 +01:00
: ${elasticsearch_exporter_pidfile:="/var/run/elasticsearch_exporter.pid"}
: ${elasticsearch_exporter_user:="prometheus"}
command="/usr/local/bin/elasticsearch_exporter"
2022-04-01 13:47:07 +02:00
command_args="--es.uri=\${elasticsearch_exporter_endpoint} --web.listen-address=\${elasticsearch_exporter_listen} --log.level=\${elasticsearch_exporter_log_level} 2>&1 > ${elasticsearch_exporter_log_file}"
2021-12-23 11:58:10 +01:00
start_cmd="/usr/sbin/daemon -u ${elasticsearch_exporter_user} ${command} ${command_args}"
run_rc_command "$1"