mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 09:17:05 +02:00
Add dryrun method to agents
This commit is contained in:
parent
8119c5222e
commit
f80ab8a69a
@ -5,7 +5,7 @@ class Fluentd
|
||||
include LocalCommon
|
||||
|
||||
def self.default_options
|
||||
{
|
||||
{
|
||||
:pid_file => "#{ENV["HOME"]}/.fluentd-ui/fluent.pid",
|
||||
:log_file => "#{ENV["HOME"]}/.fluentd-ui/fluent.log",
|
||||
:config_file => "#{ENV["HOME"]}/.fluentd-ui/fluent.conf",
|
||||
@ -42,6 +42,12 @@ class Fluentd
|
||||
actual_reload
|
||||
end
|
||||
|
||||
def dryrun
|
||||
Bundler.with_clean_env do
|
||||
system("fluentd --dry-run #{options_to_argv}")
|
||||
end
|
||||
end
|
||||
|
||||
def version
|
||||
Bundler.with_clean_env do
|
||||
`fluentd --version`.strip
|
||||
@ -60,9 +66,7 @@ class Fluentd
|
||||
end
|
||||
|
||||
def validate_fluentd_options
|
||||
Bundler.with_clean_env do
|
||||
system("fluentd --dry-run #{options_to_argv}")
|
||||
end
|
||||
dryrun
|
||||
end
|
||||
|
||||
def actual_start
|
||||
|
@ -2,7 +2,6 @@ class Fluentd
|
||||
class Agent
|
||||
class TdAgent
|
||||
module Macosx
|
||||
|
||||
def start
|
||||
backup_running_config do
|
||||
detached_command("launchctl load #{plist}") && pid_from_launchctl
|
||||
@ -17,6 +16,10 @@ class Fluentd
|
||||
stop && start
|
||||
end
|
||||
|
||||
def dryrun
|
||||
detached_command("/usr/sbin/td-agent --dry-run -q --use-v1-config -c #{config_file} -o #{log_file}")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def plist
|
||||
|
@ -17,6 +17,10 @@ class Fluentd
|
||||
# https://github.com/treasure-data/td-agent/blob/master/debian/td-agent.init#L156
|
||||
detached_command('/etc/init.d/td-agent restart')
|
||||
end
|
||||
|
||||
def dryrun
|
||||
detached_command('/etc/init.d/td-agent configtest')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user