47 lines
1.8 KiB
Bash
47 lines
1.8 KiB
Bash
#!/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")
|
|
#
|
|
# elasticsearch_exporter_log_file (str): log messages to this file
|
|
# (default: "/var/log/elasticsearch_exporter.log")
|
|
#
|
|
|
|
. /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_log_file="/var/log/elasticsearch_exporter.log"}
|
|
: ${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} 2>&1 > ${elasticsearch_exporter_log_file}"
|
|
start_cmd="/usr/sbin/daemon -u ${elasticsearch_exporter_user} ${command} ${command_args}"
|
|
|
|
run_rc_command "$1"
|