#! /usr/local/bin/python3
import os
import sys
import json
import platform
import datetime

#Get OS distribution and version
plat = platform.linux_distribution()
plat = plat[0] + ' ' + plat[1]
data = {'OS': plat}

#Get date
today = datetime.date.today()
data['Date'] = today.strftime('%d/%m/%Y')


#Get free memory
cmd = "free | awk \'FNR == 2 {print $4}\'"
mem =  int(os.popen(cmd).read().strip("\n"))
data['Memory'] = mem

#Get free disk space
cmd =  "df | awk \'FNR == 2 {print $4}\'"
stor = int(os.popen(cmd).read().strip("\n"))
data['Storage'] = stor

#Get current build with enviroment from Jenkins
data['Build'] = sys.argv[1]

#Get workspace path
data['Workspace'] = os.getcwd()

with open('data.json', 'w') as fp:
        json.dump(data, fp)

22b8109158713c310f8c013ca4f8f34af0a51bf4
<mask token>

<mask token>
with open('data.json', 'w') as fp:
    json.dump(data, fp)

<mask token>
plat = platform.linux_distribution()
plat = plat[0] + ' ' + plat[1]
data = {'OS': plat}
today = datetime.date.today()
data['Date'] = today.strftime('%d/%m/%Y')
cmd = "free | awk 'FNR == 2 {print $4}'"
mem = int(os.popen(cmd).read().strip('\n'))
data['Memory'] = mem
cmd = "df | awk 'FNR == 2 {print $4}'"
stor = int(os.popen(cmd).read().strip('\n'))
data['Storage'] = stor
data['Build'] = sys.argv[1]
data['Workspace'] = os.getcwd()
with open('data.json', 'w') as fp:
    json.dump(data, fp)

import os
import sys
import json
import platform
import datetime
plat = platform.linux_distribution()
plat = plat[0] + ' ' + plat[1]
data = {'OS': plat}
today = datetime.date.today()
data['Date'] = today.strftime('%d/%m/%Y')
cmd = "free | awk 'FNR == 2 {print $4}'"
mem = int(os.popen(cmd).read().strip('\n'))
data['Memory'] = mem
cmd = "df | awk 'FNR == 2 {print $4}'"
stor = int(os.popen(cmd).read().strip('\n'))
data['Storage'] = stor
data['Build'] = sys.argv[1]
data['Workspace'] = os.getcwd()
with open('data.json', 'w') as fp:
    json.dump(data, fp)

#! /usr/local/bin/python3
import os
import sys
import json
import platform
import datetime

#Get OS distribution and version
plat = platform.linux_distribution()
plat = plat[0] + ' ' + plat[1]
data = {'OS': plat}

#Get date
today = datetime.date.today()
data['Date'] = today.strftime('%d/%m/%Y')


#Get free memory
cmd = "free | awk \'FNR == 2 {print $4}\'"
mem =  int(os.popen(cmd).read().strip("\n"))
data['Memory'] = mem

#Get free disk space
cmd =  "df | awk \'FNR == 2 {print $4}\'"
stor = int(os.popen(cmd).read().strip("\n"))
data['Storage'] = stor

#Get current build with enviroment from Jenkins
data['Build'] = sys.argv[1]

#Get workspace path
data['Workspace'] = os.getcwd()

with open('data.json', 'w') as fp:
        json.dump(data, fp)
