Skip to content

Instantly share code, notes, and snippets.

@replay
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save replay/37babfff408ae9ddcd60 to your computer and use it in GitHub Desktop.
Save replay/37babfff408ae9ddcd60 to your computer and use it in GitHub Desktop.
splunk install script
#!/bin/bash
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "You need to be 'root' dude." 1>&2
exit 1
fi
clear
. ./setuprc
echo;
echo "####################################################################################################
This script is installing and configuring Splunk for ingestion of the OpenStack logs. Splunk can
be used to debug and monitor your OpenStack configuration. Access it from the following URL:
http://$SG_SERVICE_CONTROLLER_IP:8000/
####################################################################################################
"
echo;
# download
wget -O splunk-6.1.3-220630-Linux-x86_64.tgz 'http://15.126.241.150/splunk-6.1.3-220630-Linux-x86_64.tgz'
# extract, move, cleanup
tar xvfz splunk-6.1.3-220630-Linux-x86_64.tgz
mv splunk /opt/splunk
rm splunk-6.1.3-220630-Linux-x86_64.tgz
# whack on inputs.conf file
echo "
[monitor:///var/log/keystone]
disabled = false
followTail = 0
[monitor:///var/log/nova]
disabled = false
followTail = 0
[monitor:///var/log/glance]
disabled = false
followTail = 0
[monitor:///var/log/cinder]
disabled = false
followTail = 0
[monitor:///var/log/rabbit]
disabled = false
followTail = 0
[monitor:///var/log/mongodb]
disabled = false
followTail = 0
[monitor:///var/log/ceilometer]
disabled = false
followTail = 0
[monitor:///var/log/libvirt]
disabled = false
followTail = 0
" >> /opt/splunk/etc/apps/launcher/default/inputs.conf
# Auto start Splunk on boot
/opt/splunk/bin/splunk enable boot-start --accept-license
# start splunk
/opt/splunk/bin/splunk start --accept-license
echo;
echo "##########################################################################################"
echo;
echo "Splunk setup complete. Continue the setup by doing a './openstack_mysql.sh'."
echo;
echo "##########################################################################################"
echo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment