refactor splunk recipe
This commit is contained in:
parent
1a9041a3c0
commit
ea25b28c5c
1 changed files with 17 additions and 21 deletions
|
|
@ -1,39 +1,35 @@
|
||||||
execute "Download splunk" do
|
unless system "splunk status"
|
||||||
command "cd /tmp/install && wget 'http://www.splunk.com/index.php/download_track?file=4.1.5/linux/splunk-4.1.5-85165-Linux-x86_64.tgz&ac=&wget=true&name=wget&typed=releases'"
|
execute "Download splunk" do
|
||||||
end
|
command "cd /tmp/install && wget 'http://www.splunk.com/index.php/download_track?file=4.1.5/linux/splunk-4.1.5-85165-Linux-x86_64.tgz&ac=&wget=true&name=wget&typed=releases'"
|
||||||
|
end
|
||||||
|
|
||||||
execute "Untar splunk" do
|
execute "Untar splunk" do
|
||||||
command "cd /tmp/install && tar -xvf splunk-4.1.5-85165-Linux-x86_64.tgz"
|
command "tar -xvf /tmp/install/splunk-4.1.5-85165-Linux-x86_64.tgz -C /opt/"
|
||||||
end
|
end
|
||||||
|
|
||||||
execute "Stop old splunk" do
|
link "/usr/local/bin/splunk" do
|
||||||
command "/opt/splunk/bin/splunk stop || true"
|
to "/opt/splunk/bin/splunk"
|
||||||
end
|
end
|
||||||
|
|
||||||
execute "Remove old splunk" do
|
|
||||||
command "rm -rf /opt/splunk"
|
|
||||||
end
|
|
||||||
|
|
||||||
execute "Install splunk" do
|
|
||||||
command "mv /tmp/install/splunk /opt/splunk"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
execute "Start splunk" do
|
execute "Start splunk" do
|
||||||
command "cd /opt/splunk/bin && ./splunk start --accept-license"
|
command "splunk start --accept-license || true"
|
||||||
end
|
end
|
||||||
|
|
||||||
execute "Put splunk into forwarding mode" do
|
execute "Put splunk into forwarding mode" do
|
||||||
command "cd /opt/splunk/bin && ./splunk enable app SplunkLightForwarder -auth admin:changeme"
|
command "splunk enable app SplunkLightForwarder -auth admin:changeme"
|
||||||
end
|
end
|
||||||
|
|
||||||
execute "Add forwarding server" do
|
execute "Add forwarding server" do
|
||||||
command "cd /opt/splunk/bin && ./splunk add forward-server splunk.joindiaspora.com:9997 -auth admin:changeme"
|
command "splunk add forward-server splunk.joindiaspora.com:9997 -auth admin:changeme"
|
||||||
|
not_if "splunk list forward-server | grep splunk.joindiaspora.com:9997"
|
||||||
end
|
end
|
||||||
|
|
||||||
execute "Add monitor for diaspora" do
|
execute "Add monitor for diaspora" do
|
||||||
command "cd /opt/splunk/bin && ./splunk add monitor /usr/local/app/diaspora/log"
|
command "splunk add monitor /usr/local/app/diaspora/log"
|
||||||
|
not_if "splunk list monitor | grep diaspora"
|
||||||
end
|
end
|
||||||
|
|
||||||
execute 'Splunk Restart' do
|
execute 'Splunk Restart' do
|
||||||
command "cd /opt/splunk/bin && ./splunk restart"
|
command "splunk restart"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue