Splunk installation on CentOs

Bash script for easy installation of Splunk on CentOs

13

Votes

#!/bin/sh
setenforce 0
useradd splunk -G wheel -m -d /opt/splunk -s /bin/bash
echo -e "\$plunk1\n\$plunk1" | passwd splunk

mkdir /opt/splunk
cd /opt/splunk

#Splunk Enterprise
wget -O splunk-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.1.3&product=splunk&filename=splunk-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm&wget=true'
#wget -O splunk-7.1.0-2e75b3406c5b-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.1.0&product=splunk&filename=splunk-7.1.0-2e75b3406c5b-linux-2.6-x86_64.rpm&wget=true'
#wget -O splunk-7.0.1-2b5b15c4ee89-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.0.1&product=splunk&filename=splunk-7.0.1-2b5b15c4ee89-linux-2.6-x86_64.rpm&wget=true'
#wget -O splunk-7.0.0-c8a78efdd40f-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.0.0&product=splunk&filename=splunk-7.0.0-c8a78efdd40f-linux-2.6-x86_64.rpm&wget=true'
#wget -O splunk-6.6.3-e21ee54bc796-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=6.6.3&product=splunk&filename=splunk-6.6.3-e21ee54bc796-linux-2.6-x86_64.rpm&wget=true'

#Universal Forwarder
wget -O splunkforwarder-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.1.3&product=universalforwarder&filename=splunkforwarder-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm&wget=true'
#wget -O splunkforwarder-7.1.0-2e75b3406c5b-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.1.0&product=universalforwarder&filename=splunkforwarder-7.1.0-2e75b3406c5b-linux-2.6-x86_64.rpm&wget=true'
#wget -Owget -O splunkforwarder-7.1.0-2e75b3406c5b-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.1.0&product=universalforwarder&filename=splunkforwarder-7.1.0-2e75b3406c5b-linux-2.6-x86_64.rpm&wget=true' splunkforwarder-7.0.1-2b5b15c4ee89-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.0.1&product=universalforwarder&filename=splunkforwarder-7.0.1-2b5b15c4ee89-linux-2.6-x86_64.rpm&wget=true'
#wget -O splunkforwarder-7.0.0-c8a78efdd40f-linux-2.6-x86_64.rpm 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=7.0.0&product=universalforwarder&filename=splunkforwarder-7.0.0-c8a78efdd40f-linux-2.6-x86_64.rpm&wget=true'

#Quick Reference
wget -O splunk-quick-reference-guide.pdf 'https://www.splunk.com/pdfs/solution-guides/splunk-quick-reference-guide.pdf'

#Install software
rpm -i splunk-7.1.3-51d9cac7b837-linux-2.6-x86_64.rpm

chown -R splunk:splunk /opt/splunk
/opt/splunk/bin/splunk start --answer-yes --no-prompt --accept-license --seed-passwd splunk.713

yum -y install firewalld
systemctl start firewalld.service
firewall-cmd --zone=public --add-service=https
firewall-cmd --zone=public --add-port=8000/tcp  --permanent
firewall-cmd --zone=public --add-port=8089/tcp  --permanent
firewall-cmd --zone=public --add-port=9997/tcp  --permanent
firewall-cmd --reload
setenforce 1

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png