Skip to content

Commit

Permalink
Upgrading ELK to v5.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Smith committed Jul 25, 2017
1 parent b92f53a commit 3b197ef
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 42 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ New Functionality:
Fixes:
* Optimized Logstash Config
* Updated Bro IDS to 2.5.1
* Updated Logstash to version 5.5.0
* Updated Elasticsearch to version 5.5.0
* Update kibana to version 5.5.0
* Updated Logstash to version 5.5.1
* Updated Elasticsearch to version 5.5.1
* Update kibana to version 5.5.1


14 changes: 7 additions & 7 deletions install/elasticSearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import hashCheck

def install(fileCheckKey):
elasticLatest='5.5.0'
elasticLatest='5.5.1'
#Install Elasticsearch
elasticInstalled=False
if os.path.isfile('/etc/elasticsearch/elasticsearch.yml'):
Expand All @@ -25,16 +25,16 @@ def install(fileCheckKey):
elasticInstalled=True
if elasticInstalled == False:
print "Installing Elasticsearch"
print " Downloading Elasticsearch 5.5.0"
os.popen('sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.deb 2>&1').read()
if not os.path.isfile('elasticsearch-5.5.0.deb'):
print " Downloading Elasticsearch 5.5.1"
os.popen('sudo wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.deb 2>&1').read()
if not os.path.isfile('elasticsearch-5.5.1.deb'):
sys.exit('Error downloading elasticsearch')
if not hashCheck.checkHash('elasticsearch-5.5.0.deb'):
if not hashCheck.checkHash('elasticsearch-5.5.1.deb'):
sys.exit('Error downloading elasticsearch, mismatched file hashes')
print " Installing Elasticsearch"
os.popen('sudo dpkg -i elasticsearch-5.5.0.deb').read()
os.popen('sudo dpkg -i elasticsearch-5.5.1.deb').read()
print " Cleaning Up Installation Files"
os.remove('elasticsearch-5.5.0.deb')
os.remove('elasticsearch-5.5.1.deb')
os.popen('sudo update-rc.d elasticsearch defaults').read()
#Change heap size to 500m (1/2 of phyical memory)
shutil.move('/etc/elasticsearch/jvm.options','/etc/elasticsearch/jvm.orig')
Expand Down
16 changes: 8 additions & 8 deletions install/hashCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@


def getHash(fileName):
if fileName == 'elasticsearch-5.5.0.deb':
return 'f386c932b2e6e661e43d81f79eaa44bdf6ecef7c'
elif fileName == 'kibana-5.5.0-linux-x86_64.tar.gz':
return '935e925713cb84eb1879a59ac68708fccf3361d4'
elif fileName == 'kibana-5.5.0-linux-x86.tar.gz':
return 'f114e00d2231508607203ec9080a8b61925fe45c'
elif fileName == 'logstash-5.5.0.deb':
return 'f7e5cd2e9191c9e7a2d0a616525f319343a23b64'
if fileName == 'elasticsearch-5.5.1.deb':
return 'd6beceeb93ade6c3bc18b76a7f0e365dd95f6f52'
elif fileName == 'kibana-5.5.1-linux-x86_64.tar.gz':
return '6dba24c876841fdf116a413c843f09d3e98b4002'
elif fileName == 'kibana-5.5.1-linux-x86.tar.gz':
return '47d7707b1b8feb490276fd69b597d27af610d28b'
elif fileName == 'logstash-5.5.1.deb':
return '88fbe43065cfaa6b13374f8f4a69f871b7110208'
elif fileName == 'bro-2.5.1.tar.gz':
return '9c133dd3a075be1084f9bf53d79c42ddcf23633c'
return ''
Expand Down
36 changes: 19 additions & 17 deletions install/kibana.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import hashCheck

def install(chosenInterfaceIP):
kibanaLatest = '5.5.0'
kibanaLatest = '5.5.1'

cpuArch = os.uname()[4]
cwd = os.getcwd()
Expand All @@ -20,33 +20,33 @@ def install(chosenInterfaceIP):
kibanaInstalled = True
if kibanaInstalled == False:
print "Installing Kibana"
print " Downloading Kibana 5.5.0"
print " Downloading Kibana 5.5.1"
if cpuArch == 'x86_64':
os.popen(
'sudo wget https://artifacts.elastic.co/downloads/kibana/kibana-5.5.0-linux-x86_64.tar.gz 2>&1').read()
if not os.path.isfile('kibana-5.5.0-linux-x86_64.tar.gz'):
'sudo wget https://artifacts.elastic.co/downloads/kibana/kibana-5.5.1-linux-x86_64.tar.gz 2>&1').read()
if not os.path.isfile('kibana-5.5.1-linux-x86_64.tar.gz'):
sys.exit('Error downloading Kibana')
if not hashCheck.checkHash('kibana-5.5.0-linux-x86_64.tar.gz'):
if not hashCheck.checkHash('kibana-5.5.1-linux-x86_64.tar.gz'):
sys.exit('Error downloading kibana, mismatched file hashes')
print " Installing Kibana"
os.popen('sudo tar -xzf kibana-5.5.0-linux-x86_64.tar.gz').read()
shutil.copytree('kibana-5.5.0-linux-x86_64/', '/opt/kibana')
os.popen('sudo tar -xzf kibana-5.5.1-linux-x86_64.tar.gz').read()
shutil.copytree('kibana-5.5.1-linux-x86_64/', '/opt/kibana')
print " Cleaning Up Installation Files"
os.remove('kibana-5.5.0-linux-x86_64.tar.gz')
shutil.rmtree("kibana-5.5.0-linux-x86_64/")
os.remove('kibana-5.5.1-linux-x86_64.tar.gz')
shutil.rmtree("kibana-5.5.1-linux-x86_64/")
else:
os.popen(
'sudo wget https://artifacts.elastic.co/downloads/kibana/kibana-5.5.0-linux-x86.tar.gz 2>&1').read()
if not os.path.isfile('kibana-5.5.0-linux-x86.tar.gz'):
'sudo wget https://artifacts.elastic.co/downloads/kibana/kibana-5.5.1-linux-x86.tar.gz 2>&1').read()
if not os.path.isfile('kibana-5.5.1-linux-x86.tar.gz'):
sys.exit('Error downloading Kibana')
if not hashCheck.checkHash('kibana-5.5.0-linux-x86.tar.gz'):
if not hashCheck.checkHash('kibana-5.5.1-linux-x86.tar.gz'):
sys.exit('Error downloading kibana, mismatched file hashes')
print " Installing Kibana"
os.popen('sudo tar -xzf kibana-5.5.0-linux-x86.tar.gz').read()
shutil.copytree('kibana-5.5.0-linux-x86/', '/opt/kibana')
os.popen('sudo tar -xzf kibana-5.5.1-linux-x86.tar.gz').read()
shutil.copytree('kibana-5.5.1-linux-x86/', '/opt/kibana')
print " Cleaning Up Installation Files"
os.remove('kibana-5.5.0-linux-x86.tar.gz')
shutil.rmtree("kibana-5.5.0-linux-x86/")
os.remove('kibana-5.5.1-linux-x86.tar.gz')
shutil.rmtree("kibana-5.5.1-linux-x86/")

# Custom stuff for ARM
if not cpuArch.startswith('x86'):
Expand Down Expand Up @@ -94,7 +94,7 @@ def install(chosenInterfaceIP):
while True:

try:
esService.update(index='.kibana', id='5.5.0', doc_type='config', body=body)
esService.update(index='.kibana', id='5.5.1', doc_type='config', body=body)
break
except:
print "Waiting for Elasticsearch to start..."
Expand All @@ -103,6 +103,7 @@ def install(chosenInterfaceIP):


def importDashboard(jsonFileName):
print "Importing %s" % jsonFileName
from elasticsearch import Elasticsearch
esService = Elasticsearch()
with open(jsonFileName) as kibana_file:
Expand All @@ -112,6 +113,7 @@ def importDashboard(jsonFileName):


def importIndexMapping(jsonFileName):
print "Importing %s" % jsonFileName
from elasticsearch import Elasticsearch
esService = Elasticsearch()
with open(jsonFileName) as kibanaFile:
Expand Down
14 changes: 7 additions & 7 deletions install/logstash.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_user_input(input_string):

def install(esServer,esUser,esPass):
print "Installing Logstash"
logstashLatest='5.5.0'
logstashLatest='5.5.1'

cpuArch=os.uname()[4]
cwd=os.getcwd()
Expand Down Expand Up @@ -54,16 +54,16 @@ def install(esServer,esUser,esPass):
smtpPort = get_user_input(" \033[1mEnter SMTP Port (ex: 587)\033[0m: ")
smtpUser = get_user_input(" \033[1mEnter Email Address (ex: [email protected])\033[0m: ")
smtpPass = getpass.getpass(" \033[1mEnter Email Password (ex: P@55word)\033[0m: ")
print " Downloading Logstash 5.5.0"
os.popen('sudo wget https://artifacts.elastic.co/downloads/logstash/logstash-5.5.0.deb 2>&1').read()
if not os.path.isfile('logstash-5.5.0.deb'):
print " Downloading Logstash 5.5.1"
os.popen('sudo wget https://artifacts.elastic.co/downloads/logstash/logstash-5.5.1.deb 2>&1').read()
if not os.path.isfile('logstash-5.5.1.deb'):
sys.exit('Error downloading logstash')
if not hashCheck.checkHash('logstash-5.5.0.deb'):
if not hashCheck.checkHash('logstash-5.5.1.deb'):
sys.exit('Error downloading logstash, mismatched file hashes')
print " Installing Logstash"
os.popen('sudo dpkg -i logstash-5.5.0.deb').read()
os.popen('sudo dpkg -i logstash-5.5.1.deb').read()
print " Cleaning Up Logstash Installation Files"
os.remove('logstash-5.5.0.deb')
os.remove('logstash-5.5.1.deb')
os.popen('sudo systemctl enable logstash.service').read()

if not cpuArch.startswith('x86'):
Expand Down

0 comments on commit 3b197ef

Please sign in to comment.